Chris Lattner
d9c15ebb9a
make ExtensionDecl be a DeclContext, install members into it properly.
...
Swift SVN r896
2011-12-05 23:22:04 +00:00
Chris Lattner
ef5fc52220
add basic type checking.
...
Swift SVN r893
2011-11-29 22:45:38 +00:00
John McCall
32736ea2ab
Rename hasSingleElement to isTransparentType to better
...
capture what's being tested. This also makes IR gen
correctly avoid a discriminator for a non-transparent
single-element oneof.
Swift SVN r887
2011-11-18 01:17:53 +00:00
John McCall
b700f171a2
More getters.
...
Swift SVN r886
2011-11-18 01:10:03 +00:00
John McCall
d716f82984
Getterize ValueDecl.
...
Swift SVN r885
2011-11-18 01:04:12 +00:00
John McCall
9079154ded
Getterize TypeAliasDecl.
...
Swift SVN r884
2011-11-18 00:48:14 +00:00
John McCall
50fb0d63f6
More incremental getterization.
...
.w
Swift SVN r883
2011-11-18 00:29:15 +00:00
John McCall
d74f17259c
Incremental getterization of Decl.h.
...
Swift SVN r882
2011-11-18 00:17:20 +00:00
Chris Lattner
bd663190d9
parse (and still discard) the body of an extension.
...
Swift SVN r866
2011-11-10 21:52:42 +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
ffa9a55002
implement skeleton of extension body parsing.
...
Swift SVN r839
2011-11-09 00:49:54 +00:00
Chris Lattner
0b9b982758
rework parseDecl to do validation itself, allow decls in oneof's
...
Swift SVN r837
2011-11-08 22:41:27 +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
7e08140150
rearrange some code to use common predicates.
...
Swift SVN r834
2011-11-08 20:12:05 +00:00
Chris Lattner
9b7ec6785f
improve error recovery with mangled decls.
...
Swift SVN r832
2011-11-08 19:59:45 +00:00
Chris Lattner
d95aadc8bf
structs can now contain any 'decl'
...
Swift SVN r831
2011-11-08 19:45:24 +00:00
Chris Lattner
eac219bee8
Rework the decl grammar a bit: now "decl" doesn't include import
...
declarations, but they are explicitly allowed at translation unit scope.
This also introduces a parseDecl method which does the obvious thing.
Swift SVN r830
2011-11-08 19:30:00 +00:00
Chris Lattner
b61fe6db10
reject unnamed members in structs.
...
Swift SVN r829
2011-11-08 00:08:05 +00:00
Chris Lattner
45bcd19f58
allow typealias's in structs, inject struct members into the proper declcontext.
...
Swift SVN r828
2011-11-07 23:47:20 +00:00
Chris Lattner
ff63661812
disallow operators in structs.
...
Swift SVN r827
2011-11-07 23:39:15 +00:00
Chris Lattner
c67304f287
reject var's in structs, all data members must come before all func's.
...
Swift SVN r826
2011-11-07 23:34:47 +00:00
Chris Lattner
b559c3f648
allow var's and funcs within structs, part of rdar://10157702
...
Swift SVN r824
2011-11-03 22:19:48 +00:00
Chris Lattner
b081915dd3
clean up the interface to parseDeclFunc, and fix a FIXME whereby the
...
'this' argument to protocol methods wasn't injected early enough to be
found by name lookup.
Swift SVN r822
2011-11-03 18:46:39 +00:00
Chris Lattner
174d86d537
eliminate anonymous protocols, resolving rdar://10157535.
...
Swift SVN r819
2011-11-01 23:26:39 +00:00
Chris Lattner
80caaa7d87
remove support for anonymous oneof types, which cause issues for mangling
...
and are more of a theoretically good idea than an actually useful idea.
This is the first half of rdar://10157535
Swift SVN r818
2011-11-01 23:20:23 +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
0c3b3fe76b
use Type and Identifier arguments to diagnostics more uniformly.
...
Swift SVN r774
2011-10-21 23:32:14 +00:00
Chris Lattner
8c07ba4034
switch parseStmtBrace to the new diagnostics api
...
Swift SVN r764
2011-10-20 20:18:36 +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
ff9d19afbb
switch another diagnostic off deprecated calls.
...
Swift SVN r760
2011-10-19 01:04:18 +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
John McCall
f121bd5e2d
Arbitrary-associativity operator precedence parsing.
...
Swift SVN r743
2011-09-29 01:31:16 +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
b2facdae4b
Getterize Stmt.h.
...
Swift SVN r720
2011-09-20 07:07:53 +00:00
John McCall
b351394b6e
Getterify the rest of Expr.h.
...
Swift SVN r719
2011-09-20 00:18:57 +00:00
John McCall
c61c807589
Mangle types for all declarations. Save the names of modules and mangle
...
those in, too.
Swift SVN r713
2011-09-18 09:21:42 +00:00
John McCall
b82dc62938
Enter a function context correctly when parsing a FuncDecl's body.
...
Swift SVN r711
2011-09-16 04:53:05 +00:00
John McCall
54ff2ccf4a
Lop the last word off ModuleDecl and TranslationUnitDecl.
...
Swift SVN r693
2011-09-06 21:43:46 +00:00
John McCall
6ddc15143b
Support qualified names for types.
...
Swift SVN r683
2011-09-03 06:07:44 +00:00
Chris Lattner
0090c43b80
all members of a protocol have to be NamedDecl's, tighten up
...
typing. Various tidying up.
Swift SVN r678
2011-09-02 00:58:38 +00:00
Chris Lattner
34ec8bc4aa
implement support for var members of protocols.
...
Swift SVN r672
2011-09-01 21:57:35 +00:00
Chris Lattner
c7fd9ec3bc
remove the old grammar production for func's in protocols and just use
...
decl-func instead. Hey look, now we have support for default
implementations.
Swift SVN r671
2011-09-01 21:34:04 +00:00
Chris Lattner
5d78286e3f
split the "func a::b()" form out to its own grammar production.
...
Swift SVN r669
2011-09-01 18:21:27 +00:00
Chris Lattner
fa34062b2d
refactor the attribute grammar so that attribute-list is nullable,
...
simplifying LangRef and the parser.
Swift SVN r667
2011-09-01 18:06:46 +00:00