summaryrefslogtreecommitdiffstats
path: root/clang/lib/Parse
Commit message (Collapse)AuthorAgeFilesLines
* Make CXXScopeSpec invalid when incomplete, and propagate that into anyJeffrey Yasskin2010-04-083-12/+13
| | | | | | | Declarator that depends on it. This fixes several redundant errors and bad recoveries. llvm-svn: 100779
* Patch to implement gcc's cstyle arguments in objcFariborz Jahanian2010-04-081-4/+13
| | | | | | methods. wip. llvm-svn: 100734
* Fix some redundant errors by changing CXXScopeSpec::isSet calls intoJeffrey Yasskin2010-04-072-2/+2
| | | | | | isNotEmpty calls. llvm-svn: 100722
* Implement code completion for Objective-C method declarations andDouglas Gregor2010-04-071-0/+12
| | | | | | | | | | | | | | | | definitions, e.g., after - or - (id) we'll find all of the "likely" instance methods that one would want to declare or define at this point. In the latter case, we only produce results whose return types match "id". llvm-svn: 100587
* Patch to not build ivar ASTs when they are ilegallyFariborz Jahanian2010-04-061-1/+2
| | | | | | declared in categories. llvm-svn: 100577
* Perform code-completion within ParseCastExpression, which handles,Douglas Gregor2010-04-061-1/+6
| | | | | | e.g., the right-hand side of binary expressions. llvm-svn: 100526
* fix PR6782, an accept invalid. We weren't emitting the diagnostic Chris Lattner2010-04-052-8/+11
| | | | | | returned by SetTypeSpecType. llvm-svn: 100443
* Improve diagnosing when a method type does not start with '-'|'+'Fariborz Jahanian2010-04-021-27/+41
| | | | | | when parsing. Fixes radar 7822196. llvm-svn: 100248
* Issue better syntax error when objc's messagingFariborz Jahanian2010-03-311-2/+5
| | | | | | ares are not separated by ':' (radar 7030268). llvm-svn: 100040
* Reinstate my CodeModificationHint -> FixItHint renaming patch, withoutDouglas Gregor2010-03-318-24/+23
| | | | | | the C-only "optimization". llvm-svn: 100022
* Revert r100008, which inexplicably breaks the clang-i686-darwin10 builderDouglas Gregor2010-03-318-23/+24
| | | | llvm-svn: 100018
* Rename CodeModificationHint to FixItHint, since we've been using theDouglas Gregor2010-03-318-24/+23
| | | | | | | term "fix-it" everywhere and even *I* get tired of long names sometimes. No functionality change. llvm-svn: 100008
* Add a few asserts to be on the safe side.Argyrios Kyrtzidis2010-03-311-0/+13
| | | | llvm-svn: 99973
* Don't skip past the '}' if an expression has error and is not followed by ';'.Argyrios Kyrtzidis2010-03-311-3/+5
| | | | llvm-svn: 99972
* When "delayed parsing" C++ default arguments, if there is an error, there ↵Argyrios Kyrtzidis2010-03-301-0/+12
| | | | | | | | | | | | may be tokens left in the token stream that will interfere (they will be parsed as if they are after the class' '}') and a crash will occur because the CachedTokens that holds them will be deleted while the lexer is still using them. Make sure that the tokens of default args are removed from the token stream. Fixes PR6647. llvm-svn: 99939
* Support __attribute__((packed)) (along with other attributes) at theDouglas Gregor2010-03-291-2/+3
| | | | | | end of a struct/class/union in C++, from Justin Bogner! llvm-svn: 99811
* revert r98661, gcc_tdiag is not an attribute (PR6542).Chris Lattner2010-03-221-1/+0
| | | | | | Will fix correctly now that I have a testcase llvm-svn: 99207
* Fixes access rues for ivars declared in classFariborz Jahanian2010-03-221-1/+1
| | | | | | implementations (radar 7547942). llvm-svn: 99198
* Remove the capture, serialization, and deserialization of commentDouglas Gregor2010-03-191-18/+0
| | | | | | | | ranges as part of the ASTContext. This code is not and was never used, but contributes ~250k to the size of the Cocoa.h precompiled header. llvm-svn: 99007
* Clean up after ourselves when there's an error parsing the base clause.John McCall2010-03-171-2/+5
| | | | | | Fixes the crash-on-invalid in PR6629. llvm-svn: 98698
* Audit all Preprocessor::getSpelling() callers, improving failureDouglas Gregor2010-03-161-1/+4
| | | | | | recovery for those that need it. llvm-svn: 98689
* accept and ignore __gcc_tdiag__ so we don't produce warningsChris Lattner2010-03-161-1/+1
| | | | | | building mainline GCC, PR6542 llvm-svn: 98661
* Make sure we actually override ReadHeaderFileInfo when we meant toDouglas Gregor2010-03-161-1/+1
| | | | llvm-svn: 98655
* Don't consume tokens past the end-of-file in an @interface. FixesDouglas Gregor2010-03-161-0/+4
| | | | | | <rdar://problem/7735566>. llvm-svn: 98613
* Use SmallString instead of SmallVectorKovarththanan Rajaratnam2010-03-131-47/+47
| | | | llvm-svn: 98436
* Allow users to set CPPFLAGS and CXXFLAGS on the make command line.Jeffrey Yasskin2010-03-121-1/+1
| | | | | Tested: make CPPFLAGS=-m64 CXXFLAGS=-m64 -j8 && (cd tools/clang;make test) llvm-svn: 98399
* Diagnose the declaration of enum templates. Also, be a bit moreDouglas Gregor2010-03-021-3/+13
| | | | | | careful about value-dependent enumerators. Fixes PR5786. llvm-svn: 97570
* Fix an amusing typo that completely the re-introduction of parametersDouglas Gregor2010-03-021-1/+1
| | | | | | | | | | | for the purposes of parsing default arguments. In effect, we would re-introduce the parameter with a default argument N times (where N is the number of parameters preceding the parameter with a default argument). This showed up when a defaulted parameter of a member function of a local class shadowed a parameter of the enclosing function. Fixes PR6383. llvm-svn: 97534
* Add commentDouglas Gregor2010-03-021-1/+2
| | | | llvm-svn: 97528
* When we're parsing template names as part of base-specifiers, we areDouglas Gregor2010-03-011-1/+1
| | | | | | | | *not* entering the context of the nested-name-specifier. This was causing us to look into an uninstantiated template that we shouldn't look into. Fixes PR6376. llvm-svn: 97524
* Unbreak the buildDouglas Gregor2010-03-011-1/+1
| | | | llvm-svn: 97519
* Keep an explicit stack of function and block scopes, each element ofDouglas Gregor2010-03-011-0/+1
| | | | | | | | | | | | | | | | | | | | which has the label map, switch statement stack, etc. Previously, we had a single set of maps in Sema (for the function) along with a stack of block scopes. However, this lead to funky behavior with nested functions, e.g., in the member functions of local classes. The explicit-stack approach is far cleaner, and we retain a 1-element cache so that we're not malloc/free'ing every time we enter a function. Fixes PR6382. Also, tweaked the unused-variable warning suppression logic to look at errors within a given Scope rather than within a given function. The prior code wasn't looking at the right number-of-errors count when dealing with blocks, since the block's count would be deallocated before we got to ActOnPopScope. This approach works with nested blocks/functions, and gives tighter error recovery. llvm-svn: 97518
* Robustify instantiation of templates when there are errors in theDouglas Gregor2010-03-011-4/+4
| | | | | | | | | template definition. Do this both by being more tolerant of errors in our asserts and by not dropping a variable declaration completely when its initializer is ill-formed. Fixes the crash-on-invalid in PR6375, but not the original issue. llvm-svn: 97463
* Don't infinite-loop if TryAnnotateCXXScopeToken fails to annotate but doesn'tJohn McCall2010-03-011-0/+2
| | | | | | | | | signal an error. This can happen even when the current token is '::' if this is a ::new or ::delete expression. This was an oversight in my recent parser refactor; fixes PR 5825. llvm-svn: 97462
* pull some altivec stuff out of line.Chris Lattner2010-02-281-0/+66
| | | | llvm-svn: 97405
* Implement PR6423 by using one token of lookahead to disambiguate Chris Lattner2010-02-282-9/+73
| | | | | | | | | | | | | | | | | | | | | | | | | | an *almost* always incorrect case. This only does the lookahead in the insanely unlikely case, so it shouldn't impact performance. On this testcase: struct foo { } typedef int x; Before: t.c:3:9: error: cannot combine with previous 'struct' declaration specifier typedef int x; ^ After: t.c:2:2: error: expected ';' after struct } ^ ; llvm-svn: 97403
* Add an overload of Preprocessor::getSpelling which takes a SmallVector andBenjamin Kramer2010-02-271-4/+2
| | | | | | returns a StringRef. Use it to simplify some repetitive code. llvm-svn: 97322
* Fix an assertion-on-error during tentative constructor parsing byJohn McCall2010-02-266-75/+107
| | | | | | | | | | propagating error conditions out of the various annotate-me-a-snowflake routines. Generally (but not universally) removes redundant diagnostics as well as, you know, not crashing on bad code. On the other hand, I have just signed myself up to fix fiddly parser errors for the next week. Again. llvm-svn: 97221
* Restore the invariant that a nested-name-specifier can only containDouglas Gregor2010-02-252-14/+4
| | | | | | | | | class types, dependent types, and namespaces. I had previously weakened this invariant while working on parsing pseudo-destructor expressions, but recent work in that area has made these changes unnecessary. llvm-svn: 97112
* Make sure that we finish the DeclSpec when parsing a C++Douglas Gregor2010-02-241-0/+1
| | | | | | | | type-specifier-seq. Fixes some conditional-jump-on-unitialized-value errors in valgrind. Also counts as attempt #2 at making the MSVC buildbot happy. llvm-svn: 97077
* ActOnPseudoDestructorExpr now performs all semantic analysis forDouglas Gregor2010-02-241-2/+6
| | | | | | | | | | | | | | | | pseudo-destructor expressions, and builds the CXXPseudoDestructorExpr node directly. Currently, this only affects pseudo-destructor expressions when they are parsed, but not after template instantiation. That's coming next... Improve parsing of pseudo-destructor-names. When parsing the nested-name-specifier and we hit the sequence of tokens X :: ~, query the actual module to determine whether X is a type-name (in which case the X :: is part of the pseudo-destructor-name but not the nested-name-specifier) or not (in which case the X :: is part of the nested-name-specifier). llvm-svn: 97058
* Rework parsing of pseudo-destructor expressions and explicitDouglas Gregor2010-02-242-20/+144
| | | | | | | | | | | | | | | | | | | | | | | | | | | | destructor calls, e.g., p->T::~T We now detect when the member access that we've parsed, e.g., p-> or x. may be a pseudo-destructor expression, either because the type of p or x is a scalar or because it is dependent (and, therefore, may become a scalar at template instantiation time). We then parse the pseudo-destructor grammar specifically: ::[opt] nested-name-specifier[opt] type-name :: ∼ type-name and hand those results to a new action, ActOnPseudoDestructorExpr, which will cope with both dependent member accesses of destructors and with pseudo-destructor expressions. This commit affects the parsing of pseudo-destructors, only; the semantic actions still go through the semantic actions for member access expressions. That will change soon. llvm-svn: 97045
* Add support for the weakref attribute. We still produce "alias weak" as ↵Rafael Espindola2010-02-231-0/+1
| | | | | | llvm-gcc does, but are more strict on what uses of weakref we accept. llvm-svn: 96992
* Retain attributes for K&R style parameter declarations.Richard Pennington2010-02-231-4/+5
| | | | llvm-svn: 96941
* Early support for declaring ivars in class extensions. wip.Fariborz Jahanian2010-02-221-4/+8
| | | | llvm-svn: 96819
* Implement support for parsing pseudo-destructor expression with a ↵Douglas Gregor2010-02-212-16/+30
| | | | | | | | | | | | nested-name-specifier, e.g., typedef int Int; int *p; p->Int::~Int(); This weakens the invariant that the only types in nested-name-specifiers are tag types (restricted to class types in C++98/03). However, we weaken this invariant as little as possible, accepting arbitrary types in nested-name-specifiers only when we're in a member access expression that looks like a pseudo-destructor expression. llvm-svn: 96743
* Only parse C++0x attribute specifiers in declarators when in C++0xDouglas Gregor2010-02-191-1/+1
| | | | | | | mode. This allows us to detect invalid VLAs in Objective-C++ mode. This should be the last of <rdar://problem/7660386>. llvm-svn: 96679
* Allow GNU attributes to appear in an Objective-C method declarationTed Kremenek2010-02-181-4/+10
| | | | | | | before the selector name (but after the return type). Among other things, this allows IBAction to be implemented with an attribute. llvm-svn: 96623
* Add 'ns_returns_not_retained' and 'cf_returns_not_retained' attributes toTed Kremenek2010-02-181-0/+2
| | | | | | | match 'ns_returns_retained' and 'cf_returns_retained' respectively. These are not yet hooked up to the static analyzer. llvm-svn: 96535
* Add IBAction attribute to keep the IBOutlet attribute company.Ted Kremenek2010-02-171-0/+1
| | | | llvm-svn: 96447
OpenPOWER on IntegriCloud