Commit Graph

118 Commits

Author SHA1 Message Date
Argyrios Kyrtzidis 2545aeb710 Support "typeof unary-expression" (GNU C++ extension).
llvm-svn: 55833
2008-09-05 11:26:19 +00:00
Steve Naroff 0ac012835f Add parser/action support for block literal expressions.
Parser support for blocks is almost complete...just need to add support for the __block() storage class qualifier.

llvm-svn: 55495
2008-08-28 19:20:44 +00:00
Steve Naroff 94e3ab20b7 Fix Parser::ParseDeclaratorInternal(): add langopts test when recognizing blocks.
llvm-svn: 55468
2008-08-28 10:07:06 +00:00
Steve Naroff ec33ed9ced First wave of changes to support "blocks" (an extension to C).
This commit adds the declaration syntax (and associated type).

llvm-svn: 55417
2008-08-27 16:04:49 +00:00
Daniel Dunbar ad3cdc2ba7 Synthesize property setter method as we do for getter.
- Also, fix Parser to construct proper SetterName selector (should be
   lifted out of parser though).

llvm-svn: 55352
2008-08-26 02:32:45 +00:00
Argyrios Kyrtzidis bf667e23d1 Pass SourceRanges by reference to the various Diag methods.
llvm-svn: 55284
2008-08-24 13:14:02 +00:00
Argyrios Kyrtzidis 26da1f46e4 Add a Parser::Diag overload that can receive a custom string along with a SourceRange.
llvm-svn: 55283
2008-08-24 12:51:04 +00:00
Anders Carlsson 6305c5f437 Add support for parsing the objc_gc attribute. Tests will come shortly.
llvm-svn: 55269
2008-08-23 23:22:21 +00:00
Anders Carlsson f93f56a28e Reserved C++ words are valid selectors in Objective-C++
llvm-svn: 55253
2008-08-23 21:00:01 +00:00
Chris Lattner f440440616 make sure that ParseAST invokes the action for end of translation unit.
llvm-svn: 55222
2008-08-23 03:19:52 +00:00
Chris Lattner 9e8c057ab7 add action to know about end of translation unit.
llvm-svn: 55218
2008-08-23 02:06:50 +00:00
Chris Lattner ce90ef51b9 we already have a handle on the 'in' keyword, don't bother getting two.
llvm-svn: 55217
2008-08-23 02:02:23 +00:00
Chris Lattner 2cc35ae286 minor cleanup, remove finalize method.
llvm-svn: 55216
2008-08-23 02:00:52 +00:00
Chris Lattner 2ebb178f8b Fix a FIXME by not creating an invalid AST on erroneous input. Also
make diagnostic output in some other malformed cases significantly
more useful.  This fixes PR2708

llvm-svn: 55215
2008-08-23 01:48:03 +00:00
Argyrios Kyrtzidis 857fcc2f8e Add support for C++'s "type-specifier ( expression-list )" expression:
-The Parser calls a new "ActOnCXXTypeConstructExpr" action.
-Sema, depending on the type and expressions number:
   -If the type is a class, it will treat it as a class constructor. [TODO]
   -If there's only one expression (i.e. "int(0.5)" ), creates a new "CXXFunctionalCastExpr" Expr node
   -If there are no expressions (i.e "int()" ), creates a new "CXXZeroInitValueExpr" Expr node.

llvm-svn: 55177
2008-08-22 15:38:55 +00:00
Eli Friedman 002ad1274b Fix a minor crash-on-invalid.
llvm-svn: 55082
2008-08-20 22:07:34 +00:00
Argyrios Kyrtzidis 22fc2665e6 "Remove the 'else' since the code is fallthrough after it." - suggestion by Chris.
llvm-svn: 54952
2008-08-18 22:49:40 +00:00
Argyrios Kyrtzidis 69af9eebd7 Put (argument)-expression-list parsing in a separate function so that it can be re-used.
llvm-svn: 54851
2008-08-16 20:03:01 +00:00
Argyrios Kyrtzidis 16d63a727e C++ casts, (static_cast. dynamic_cast, etc.) can have postfix-expression pieces.
llvm-svn: 54850
2008-08-16 19:45:32 +00:00
Argyrios Kyrtzidis 37779ade44 Move handling of postfix-expression suffixes out of ParseCXXThis and into ParseCastExpression.
No functionality change, this follows the convention of how postfix-expressions are handled.

llvm-svn: 54849
2008-08-16 19:34:46 +00:00
Argyrios Kyrtzidis e97dcc1248 Set the SourceRange ending of DeclSpec, when Parser::ParseTypeofSpecifier finishes.
llvm-svn: 54840
2008-08-16 10:21:33 +00:00
Daniel Dunbar 12c9ddced1 Change Parser & Sema to use interned "super" for comparions.
- Added as private members for each because it is not clear where to
   put the common definition. Perhaps the IdentifierInfos all of these
   "pseudo-keywords" should be collected into one place (this would
   KnownFunctionIDs and Objective-C property IDs, for example).

Remove Token::isNamedIdentifier.
 - There isn't a good reason to use strcmp when we have interned
   strings, and there isn't a good reason to encourage clients to do
   so.

llvm-svn: 54794
2008-08-14 22:04:54 +00:00
Daniel Dunbar 56fdb6ae69 More #include cleaning
- Kill unnecessary #includes in .cpp files. This is an automatic
   sweep so some things removed are actually used, but happen to be
   included by a previous header. I tried to get rid of the obvious
   examples and this was the easiest way to trim the #includes in one
   fell swoop.
 - We now return to regularly scheduled development.

llvm-svn: 54632
2008-08-11 06:23:49 +00:00
Daniel Dunbar c74b5cc2bc More #include cleaning
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
   implementation .cpp

llvm-svn: 54626
2008-08-11 03:45:03 +00:00
Chris Lattner 6307f19726 rename PreDefinedExpr -> PredefinedExpr
llvm-svn: 54605
2008-08-10 01:53:14 +00:00
Argyrios Kyrtzidis 40e9e4828f Implement support for the 'wchar_t' C++ type.
llvm-svn: 54585
2008-08-09 16:51:54 +00:00
Argyrios Kyrtzidis 5c45c9b063 Passing right brace location to ActOnFinishCXXClassDef is redundant, since it gets passed to ActOnFinishCXXMemberSpecification too.
llvm-svn: 54567
2008-08-09 00:39:29 +00:00
Daniel Dunbar 1ff1d1fd51 Move AsmLabel into Declarator instead of just a parameter to
ActOnDeclarator.

llvm-svn: 54353
2008-08-05 16:28:08 +00:00
Chris Lattner 197a301669 Fix rdar://6124613 a crash on invalid code.
llvm-svn: 54340
2008-08-05 06:19:09 +00:00
Daniel Dunbar 4983df37a7 Add more Parser/Sema support for GCC asm-label extension.
- ActOnDeclarator now takes an additional parameter which is the
   AsmLabel if used. Its unfortunate that this bubbles up this high,
   but we cannot just lump it in as an attribute without mistakenly
   *accepting* it as an attribute.
 - The actual asm-label itself is, however, encoded as an AsmLabelAttr
   on the FunctionDecl.
 - Slightly improved parser error recovery on malformed asm-labels.
 - CodeGen support still missing...

llvm-svn: 54339
2008-08-05 01:35:17 +00:00
Ted Kremenek be9b33bf0f Nico Weber:
"the attached patch fixes some typos, 80 cols violations, etc. in comments."

llvm-svn: 54328
2008-08-04 22:51:42 +00:00
Argyrios Kyrtzidis 25d05e88a5 Wherever a type is used/returned from the Action module, use TypeTy instead of DeclTy or void.
No functionality change.

llvm-svn: 54265
2008-08-01 10:35:27 +00:00
Daniel Dunbar 032db47f0f Support __attribute__(({con,de}structor)) in Parse & Sema
- Including possible priority argument
 - In other news, the attribute parsing code really needs a cleanup

llvm-svn: 54257
2008-07-31 22:40:48 +00:00
Chris Lattner df59f5aa3c Pull protocol resolution of out ActOnStartClassInterface, this is also the
last client of the old ParseObjCProtocolReferences, so it also removes it.

llvm-svn: 54094
2008-07-26 04:13:19 +00:00
Chris Lattner b1f3c948ee refactor protocol resolution out of ActOnStartCategoryInterface
llvm-svn: 54093
2008-07-26 04:07:02 +00:00
Chris Lattner 3bbae00f50 pull protocol resolution out into ActOnStartProtocolInterface.
This temporarily duplicates ParseObjCProtocolReferences, but it
will be removed in the future.

llvm-svn: 54092
2008-07-26 04:03:38 +00:00
Chris Lattner 9c1842b612 simplify some code.
llvm-svn: 54091
2008-07-26 03:47:43 +00:00
Chris Lattner 8b2ec166b8 < only starts a declspec in objc mode.
llvm-svn: 54089
2008-07-26 03:38:44 +00:00
Chris Lattner 12fd035d6f remove fixed fixme
llvm-svn: 54088
2008-07-26 01:56:46 +00:00
Chris Lattner bc76297674 make DeclSpec manage its own protocol qualifier list memory instead of having
clients allocate the memory and it delete it.

llvm-svn: 54087
2008-07-26 01:53:50 +00:00
Chris Lattner 16fac4f2ad Fix hte next wave of problems with protocol qualified ID:
1) reject stuff like "id<foo> short" and "<foo> short".  2) set
the declspec range correctly 3) only parse protocol qualifiers
when in objc mode.

llvm-svn: 54086
2008-07-26 01:18:38 +00:00
Chris Lattner 0974b2380f improve handling of the horrible GCC objc extension that treats "<foo>"
like "id<foo>".  This 1) fixes an infinite loop in the parser on things
like "short<foo>" 2) emits a warning about this bogus construct and 3)
changes the testcase to be substantially reduced.

llvm-svn: 54082
2008-07-26 00:20:22 +00:00
Chris Lattner 9acd2f1cd2 add a new diag helper that takes a range.
llvm-svn: 54081
2008-07-26 00:16:04 +00:00
Chris Lattner e08e47ab2f gcc requires a semicolon at the end of an interface, unlike its extension for structs.
rdar://6095245.

llvm-svn: 54044
2008-07-25 19:54:55 +00:00
Steve Naroff 542cd5d3f9 Move fix in r54013 from the parser to sema.
llvm-svn: 54032
2008-07-25 17:57:26 +00:00
Steve Naroff ce5206b4f2 Fix Parser::ParseObjCMethodDefinition(). Only call the actions module for valid MDecl's.
llvm-svn: 54013
2008-07-25 14:30:25 +00:00
Chris Lattner d7352d6801 minor cleanup to the actions interface to pass around SmallVectorImpl instead
of a specific smallvector size.

Fix protocol lists to pass down proper location info, so we get diagnostics
like this:

t.m:3:35: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
                                  ^

instead of this:

t.m:3:44: error: cannot find protocol definition for 'NSCopying', referenced by 'NSWhatever'
@interface NSWhatever : NSObject <NSCopying>
                                           ^


Add a new IdentifierLocPair typedef which is just a pair<IdentifierInfo*, SourceLocation>

llvm-svn: 53883
2008-07-21 22:17:28 +00:00
Chris Lattner 046485640d fix typo
llvm-svn: 53848
2008-07-21 07:13:18 +00:00
Argyrios Kyrtzidis 16c04102ed Add 'this' in the comments of Parser::ParseCastExpression to indicate that it is handled.
llvm-svn: 53665
2008-07-16 07:23:27 +00:00
Ted Kremenek 10c8d7653b Use lowercase of attribute iboutlet to not conflict with the macro IBOutlet
llvm-svn: 53645
2008-07-15 22:38:34 +00:00