734 Commits

Author SHA1 Message Date
Chris Lattner
cd29a77770 introduce a new parseIdentifier method that *just* parses identifiers,
but not operators.  Audit calls to make sure that we use the right one
in the right places.  This allows us to reject structs named * for example.


Swift SVN r1127
2012-02-26 18:20:58 +00:00
Chris Lattner
dd0c5aff52 Rename parseIdentifier to parseAnyIdentifier to match langref and
make it clear to it also allows operators.


Swift SVN r1126
2012-02-26 18:16:30 +00:00
John McCall
7b29a420f6 Design and implement the [byref] attribute, checking that
it doesn't appear in places it shouldn't.  The only limits on
this checking right now is the inadequacy of location information
for types, which is something we ought to fix.

Fix type-checking of byref applications.  Fix IR generation
of byref variables.  Whole lotta fixin' goin' on.

But hey, byref calls work.



Swift SVN r1111
2012-02-10 09:42:50 +00:00
John McCall
4f1b3de86f When the parser crashes, note where we are on the crash
report.



Swift SVN r1097
2012-01-26 00:07:38 +00:00
Chris Lattner
594c117658 remove a dead diagnostic, simplify the top-level translation unit parsing gunk
Swift SVN r1086
2012-01-19 00:39:33 +00:00
Chris Lattner
1c7d9f79ba simplify value-specifier code to eliminate the 'expr single' previous special case.
Since we reworked how expression binding works, this complexity isn't needed anymore.


Swift SVN r1083
2012-01-18 23:56:19 +00:00
Chris Lattner
70b97b61cb use the error type for errors instead of int32
Swift SVN r965
2011-12-22 06:57:43 +00:00
John McCall
6b935588e5 On second thought, components need to be known in the AST.
Swift SVN r918
2011-12-07 03:57:41 +00:00
Chris Lattner
212b56afec actually, the ASTStage should be on Translation unit. There can be multiple modules in a context and they can all be in different phases of translation.
Swift SVN r902
2011-12-06 00:51:56 +00:00
Chris Lattner
eaa6fcb12a move prototype for the verifier into Subsystems.
Swift SVN r901
2011-12-06 00:34:16 +00:00
Chris Lattner
02c9d9a3f1 Make the AST "phase" part of ASTContext, this is generally useful for assertions.
Swift SVN r900
2011-12-06 00:32:00 +00:00
Doug Gregor
fc183b9cc3 Decouple the lexer from the ASTContext and specific BufferID. They
aren't needed for the lexer proper (which just needs a buffer to dig
through). Also, make it possible to suppress lexer diagnostics merely
by not giving it a diagnostic engine to work with.


Swift SVN r852
2011-11-09 21:49:40 +00:00
Doug Gregor
d0dd4d44bc Surface the Token and Lexer headers as public headers, since we're
going to need to be able to use the lexer from the 'swift' tool itself.


Swift SVN r851
2011-11-09 21:09:49 +00:00
Chris Lattner
9e783adda1 introduce and use a new parseMatchingToken method.
Swift SVN r841
2011-11-09 01:09:07 +00:00
Chris Lattner
f02dc055d3 introduce a form of parseToken that returns the location of the parsed token
on success, allowing simplifications in clients.


Swift SVN r840
2011-11-09 00:56:52 +00:00
Chris Lattner
c872bb4782 improve error recovery in {}'s by using less hacky recovery.
Swift SVN r836
2011-11-08 21:09:28 +00:00
Chris Lattner
b5c6fa8e21 split error recovery behavior out of parseDecl, making it more
conventional and allowing more appropriate recovery in various 
caller's contexts.


Swift SVN r835
2011-11-08 21:05:10 +00:00
Chris Lattner
af0d4a6cdf use Diagnostic class to simplify parseIdentifier.
Swift SVN r785
2011-10-22 06:04:56 +00:00
Chris Lattner
9298082ebb move Diagnostics header to include/swift/AST to match .cpp files.
Swift SVN r782
2011-10-22 00:47:35 +00:00
Chris Lattner
dfd529ce3a rename diags::foo to diag::foo
Swift SVN r779
2011-10-22 00:36:19 +00:00
Chris Lattner
a1781fed38 switch expr parsing to the new diagnostics subsystem
Swift SVN r766
2011-10-20 20:41:48 +00:00
Chris Lattner
d8343e9a42 convert parseToken to new diagnostic api
Swift SVN r763
2011-10-20 20:09:04 +00:00
Chris Lattner
96f732b6a2 convert parseType to take a DiagID.
Swift SVN r762
2011-10-20 19:53:00 +00:00
Chris Lattner
fcc547d000 switch parseIdentifier and all its uses to the new diagnostics machinery.
Swift SVN r759
2011-10-19 00:57:50 +00:00
Chris Lattner
a7c7d64fa0 Switch swift to use SourceLoc instead of SMLoc.
Also use the new getAdvancedLoc() method instead of hacking
on SMLoc directly.

Also fix the warning/note/error methods to forward through ASTContext
instead of being replicated everywhere.



Swift SVN r750
2011-10-18 01:22:29 +00:00
Chris Lattner
2d43b8812f update for mainline API changes.
Swift SVN r745
2011-10-16 06:17:27 +00:00
Doug Gregor
3d15bf3d55 Introduce a diagnostic-formatting engine and port most of the parser's
diagnostics over to it.

There are a few differences between this diagnostic engine and Clang's
engine:
  - Diagnostics are specified by a .def file (Diagnostics.def), rather
  than via tblgen, which drastically simplifies the build and makes
  code completion work when you add a new diagnostic.
  - Calls to the "diagnose()" method are safely typed based on the
  argument types specified in the .def file, so it's harder to write a
  diagnostic whose expected arguments (in the string) and whose actual
  arguments (in the code) don't match.
  - It uses variadic templates, so it hangs with the cool kids.



Swift SVN r734
2011-09-26 23:46:28 +00:00
John McCall
b6f312aea0 Verification should clearly follow each phase rather than coming
at the start of the next phase.



Swift SVN r731
2011-09-24 09:32:18 +00:00
John McCall
54ff2ccf4a Lop the last word off ModuleDecl and TranslationUnitDecl.
Swift SVN r693
2011-09-06 21:43:46 +00:00
Chris Lattner
b04c19e647 introduce a enw AST/AST.h umbrella header and use it to
simplify #includes.



Swift SVN r578
2011-08-22 21:02:44 +00:00
Chris Lattner
88964126fe remove the old SemaDecl and Sema classes.
Swift SVN r563
2011-08-14 00:33:00 +00:00
Chris Lattner
cb18028c45 rework all of the scope and name lookup logic, introducing a new ScopeInfo class
and moving a bunch more stuff out of SemaDecl.


Swift SVN r561
2011-08-14 00:27:24 +00:00
Chris Lattner
75033678d0 split decl parsing logic out to ParseDecl.cpp
Swift SVN r558
2011-08-13 22:56:16 +00:00
Chris Lattner
26f66a8b24 move all the parser headers into lib/Parse since they are now all private.
I chose to just delete the -lex action in swift, since it was only useful for
about 10 minutes during bringup and probably never will be again.




Swift SVN r557
2011-08-13 22:51:04 +00:00
Chris Lattner
92051fd98e add a new Subsystems.h file to hold the entrypoints for various subsystems,
instead of smashing them into Parser.h, resolving some FIXME's.



Swift SVN r556
2011-08-13 22:43:17 +00:00
Chris Lattner
73a3f9d888 fix clients to not poke the Parser class directly.
Swift SVN r555
2011-08-13 22:38:20 +00:00
Chris Lattner
c863bea58d merge SemaExpr into ParseExpr.cpp
Swift SVN r554
2011-08-13 22:33:33 +00:00
Chris Lattner
047ecf3b27 split expr parsing out to its own file.
Swift SVN r553
2011-08-13 22:17:50 +00:00
Chris Lattner
f6ff397ab7 zap some more S.Context's now that Parser has its own context member.
Swift SVN r551
2011-08-13 22:14:40 +00:00
Chris Lattner
dab303a541 move statement parsing out to its own file.
Swift SVN r550
2011-08-13 22:13:33 +00:00
Chris Lattner
e5c5dab2df give parser its own ASTContext member instead of having to indirect through Sema.
Swift SVN r549
2011-08-13 22:09:49 +00:00
Chris Lattner
c86d4a5853 Split parsing for types out to its own ParseType.cpp file, and
merge SemaType into it.


Swift SVN r547
2011-08-13 22:06:33 +00:00
Chris Lattner
6009504ae6 split ParseResult out to its own file.
Swift SVN r545
2011-08-13 21:35:37 +00:00
Chris Lattner
5d9e2e4a8d now that the Sema code is in the parse library, the Sema headers are all private, make it so.
Swift SVN r544
2011-08-13 21:15:17 +00:00
Chris Lattner
33f774f9b7 Rearrange a bunch of code for better layering: instead of Parser depending on Sema,
just move the Sema code into the Parser library.  There is no way to use one without
the other.  The library formerly known as Sema will get renamed.


Swift SVN r542
2011-08-13 21:06:10 +00:00
Chris Lattner
b40d2ce29e fix naming convention violations.
Swift SVN r536
2011-08-12 22:52:33 +00:00
Chris Lattner
b8fd157450 rip out the dead "isPrecededByIdentifier" logic from the AST and Lexer.
Swift SVN r529
2011-08-12 21:36:25 +00:00
John McCall
ddd134854e Rename ApplyExpr to CallExpr and change the signature of SemaCallExpr.
Swift SVN r523
2011-08-12 17:31:14 +00:00
Chris Lattner
3ce8ca094e don't promote a sema error to a parse error.
Swift SVN r518
2011-08-12 06:13:49 +00:00
Chris Lattner
096c203901 oneof element names can't be operators.
Swift SVN r517
2011-08-12 06:02:06 +00:00