Граф коммитов

102 Коммитов

Автор SHA1 Сообщение Дата
Argyrios Kyrtzidis 4fdc1caeb1 "Remove the 'else' since the code is fallthrough after it." - suggestion by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54952 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-18 22:49:40 +00:00
Argyrios Kyrtzidis 0cd5b429fa Put (argument)-expression-list parsing in a separate function so that it can be re-used.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54851 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 20:03:01 +00:00
Argyrios Kyrtzidis b348b810e7 C++ casts, (static_cast. dynamic_cast, etc.) can have postfix-expression pieces.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54850 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 19:45:32 +00:00
Argyrios Kyrtzidis 289d77302a 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54849 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 19:34:46 +00:00
Argyrios Kyrtzidis 0919f9e800 Set the SourceRange ending of DeclSpec, when Parser::ParseTypeofSpecifier finishes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54840 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-16 10:21:33 +00:00
Daniel Dunbar 662e8b5647 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54794 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-14 22:04:54 +00:00
Daniel Dunbar acc5f3e423 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54632 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 06:23:49 +00:00
Daniel Dunbar e4858a65a9 More #include cleaning
- Drop Diagnostic.h from DeclSpec.h, move utility Diag methods into
   implementation .cpp


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54626 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-11 03:45:03 +00:00
Chris Lattner d9f6910f4e rename PreDefinedExpr -> PredefinedExpr
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54605 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-10 01:53:14 +00:00
Argyrios Kyrtzidis 64c438a4be Implement support for the 'wchar_t' C++ type.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54585 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 16:51:54 +00:00
Argyrios Kyrtzidis 5b7f0c8f47 Passing right brace location to ActOnFinishCXXClassDef is redundant, since it gets passed to ActOnFinishCXXMemberSpecification too.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54567 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-09 00:39:29 +00:00
Daniel Dunbar 914701ed49 Move AsmLabel into Declarator instead of just a parameter to
ActOnDeclarator.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54353 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 16:28:08 +00:00
Chris Lattner 4fef81d718 Fix rdar://6124613 a crash on invalid code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54340 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 06:19:09 +00:00
Daniel Dunbar a80f8749f2 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...


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54339 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-05 01:35:17 +00:00
Ted Kremenek a34ea07237 Nico Weber:
"the attached patch fixes some typos, 80 cols violations, etc. in comments."


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54328 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-04 22:51:42 +00:00
Argyrios Kyrtzidis 39caa08809 Wherever a type is used/returned from the Action module, use TypeTy instead of DeclTy or void.
No functionality change.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54265 91177308-0d34-0410-b5e6-96231b3b80d8
2008-08-01 10:35:27 +00:00
Daniel Dunbar 3068ae0feb Support __attribute__(({con,de}structor)) in Parse & Sema
- Including possible priority argument
 - In other news, the attribute parsing code really needs a cleanup


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54257 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-31 22:40:48 +00:00
Chris Lattner 06036d3709 Pull protocol resolution of out ActOnStartClassInterface, this is also the
last client of the old ParseObjCProtocolReferences, so it also removes it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54094 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 04:13:19 +00:00
Chris Lattner 6bd6d0b9d8 refactor protocol resolution out of ActOnStartCategoryInterface
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54093 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 04:07:02 +00:00
Chris Lattner e13b9595dc pull protocol resolution out into ActOnStartProtocolInterface.
This temporarily duplicates ParseObjCProtocolReferences, but it
will be removed in the future.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 04:03:38 +00:00
Chris Lattner eacc39212e simplify some code.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54091 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 03:47:43 +00:00
Chris Lattner f3948c41ca < only starts a declspec in objc mode.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54089 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 03:38:44 +00:00
Chris Lattner fc416a4e0d remove fixed fixme
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54088 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 01:56:46 +00:00
Chris Lattner ae4da6150b make DeclSpec manage its own protocol qualifier list memory instead of having
clients allocate the memory and it delete it.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54087 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 01:53:50 +00:00
Chris Lattner 3bd934a624 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54086 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 01:18:38 +00:00
Chris Lattner bce6135441 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.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54082 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 00:20:22 +00:00
Chris Lattner 844cef32e4 add a new diag helper that takes a range.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54081 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-26 00:16:04 +00:00
Chris Lattner 3872b5cadd gcc requires a semicolon at the end of an interface, unlike its extension for structs.
rdar://6095245.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54044 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 19:54:55 +00:00
Steve Naroff 394f3f483f Move fix in r54013 from the parser to sema.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54032 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 17:57:26 +00:00
Steve Naroff 5928cb633d Fix Parser::ParseObjCMethodDefinition(). Only call the actions module for valid MDecl's.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@54013 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-25 14:30:25 +00:00
Chris Lattner 7caeabd868 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>



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53883 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 22:17:28 +00:00
Chris Lattner cfb0ef5676 fix typo
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53848 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-21 07:13:18 +00:00
Argyrios Kyrtzidis d7464be982 Add 'this' in the comments of Parser::ParseCastExpression to indicate that it is handled.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53665 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-16 07:23:27 +00:00
Ted Kremenek f135e80b7b Use lowercase of attribute iboutlet to not conflict with the macro IBOutlet
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53645 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 22:38:34 +00:00
Ted Kremenek 96329d4e07 Added parsing/sema support for __attribute__ ((IBOutlet)), a clang-specific attribute that the static analyzer will use to recognize what ivars are IBOutlets.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53644 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-15 22:26:48 +00:00
Argyrios Kyrtzidis b9f930d7bd Use of NextToken() makes ParseIdentifierStatement unnecessary.
Simplify the parser by removing Parser::ParseIdentifierStatement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53520 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-12 21:04:42 +00:00
Argyrios Kyrtzidis f7da726f09 Simplify the parser a bit by looking at the next token without consuming it (by Preprocessor::LookNext):
-Remove ParseExpressionWithLeadingIdentifier and ParseAssignmentExprWithLeadingIdentifier.
-Separate ParseLabeledStatement from ParseIdentifierStatement.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@53376 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-09 22:53:07 +00:00
Argyrios Kyrtzidis 07952324dd Add Sema support for C++ classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52956 91177308-0d34-0410-b5e6-96231b3b80d8
2008-07-01 10:37:29 +00:00
Argyrios Kyrtzidis 3a9fdb4742 Handle unnamed bitfields when parsing C++ classes.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52855 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-28 08:10:48 +00:00
Chris Lattner 985abd958d Make Declarator::getDeclSpec() return a const reference to avoid
cases where mutation can introduce bugs.  Propagate around 'const'.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52772 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-26 06:49:43 +00:00
Argyrios Kyrtzidis e2fc9cf2ae The only caller of this knows that the current token is l_brace, so this can be an assert; suggestion by Chris.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52696 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 22:31:41 +00:00
Argyrios Kyrtzidis 4cc18a4d52 Add parsing support for C++ classes.
Note that Parser::ParseCXXMemberSpecification is temporarily disabled until the Sema support is in place.
Once ParseCXXMemberSpecification is enabled, the Parser/cxx-class.cpp test will pass.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52694 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-24 22:12:16 +00:00
Chris Lattner 5a6ddbf295 add parser and sema support for the funny ObjC '@defs' thing.
Patch by David Chisnall!


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52586 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 19:39:06 +00:00
Argyrios Kyrtzidis cf28c72980 K&R-style functions not allowed in C++.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52575 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-21 10:00:56 +00:00
Mike Stump d42043333a One more test checkin.
Remove an extra space at the end of a line.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52504 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 19:52:46 +00:00
Mike Stump a6f0177a86 Test commit to see if new account works.
I choose to remove extraneous whitespace at end of lines as a semantic
nop for the test.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52503 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-19 19:28:49 +00:00
Nuno Lopes d4cbda6292 implement the alias attirbute (in both Sema and Codegen)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52092 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-08 15:45:52 +00:00
Ted Kremenek 8a77931487 Initial work on additional memory collection for ObjC AST objects. We now
have Destroy methods of ObjcMethodDecl and ObjCInterfaceDecl which recursively
destroy their owned Decls and Stmts.  There are a few cases where it is not
clear what to do (FIXMEs included in the patch).


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@52050 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-06 16:45:15 +00:00
Steve Naroff d3ded1ffac Support "<p>" as a short-hand for "id<p>". Here's a comment from GCC (the only documentation I could find on it).
/* Make "<SomeProtocol>" equivalent to "id <SomeProtocol>" - nisse@lysator.liu.se.  */

This commit adds the parser magic. The type associated with <p> is still incorrect. Will discuss with Chris.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51972 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-05 00:02:44 +00:00
Steve Naroff 3ac438c383 Parser::ParseObjCSynchronizedStmt() needs to Enter/Exit a decl scope.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@51963 91177308-0d34-0410-b5e6-96231b3b80d8
2008-06-04 20:36:13 +00:00