summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Use the new guard variable mangling function and get rid of the old code.Anders Carlsson2009-04-131-65/+6
| | | | llvm-svn: 68971
* Add support for mangling guard variables.Anders Carlsson2009-04-132-1/+23
| | | | llvm-svn: 68969
* Change diagnostic as a result of researching <rdar://problem/6779809> ↵Steve Naroff2009-04-131-2/+1
| | | | | | | | missing interface name in "error: cannot declare variable inside a class, protocol or category ''. Since ObjC 2.0 class "extensions" have a null name, the diagnostic above is actually "correct". Nevertheless, it is confusing. Decided to remove the name entirely (from my perspective, it didn't add any value). Also simplified the text of the diagnostic a bit. llvm-svn: 68967
* Fix assertion failure in PTH when tokens followed a closing #endif.Daniel Dunbar2009-04-131-3/+2
| | | | | | | | | - Ted, please check. - Missing test case because PTH won't reliably cache the tokens in a test case. *cough* llvm-svn: 68966
* Make the reading of the line table from a PCH file more robust againstDouglas Gregor2009-04-131-6/+5
| | | | | | | | the unlikely event that the filename IDs in the stored line table end up being different from the filename IDs in the newly-created line table. llvm-svn: 68965
* Include the SourceManager's line table in the PCH file. We can nowDouglas Gregor2009-04-133-5/+104
| | | | | | properly cope with #line directives in PCH files. llvm-svn: 68963
* Factor the internals of SourceManager (specially, LineTableInfo) into a ↵Douglas Gregor2009-04-131-96/+1
| | | | | | separate Internals header. No functionality change llvm-svn: 68960
* Make the selection of type declarations in Sema::getTypeNameDouglas Gregor2009-04-131-2/+4
| | | | | | | deterministic when faced with an ambiguity. This eliminates the annoying test/SemaCXX/using-directive.cpp failure. llvm-svn: 68952
* implement the microsoft/gnu "__COUNTER__" macro: rdar://4329310Chris Lattner2009-04-134-5/+22
| | | | llvm-svn: 68933
* Improve error recovery for calls, fixing:Chris Lattner2009-04-131-3/+8
| | | | | | PR3972: Poor diagnostic with missing ')' llvm-svn: 68932
* fix PR3932: [ObjC]Type defined as 'id' is not recognized as a valid object type.Chris Lattner2009-04-121-11/+18
| | | | | | by making ASTContext::isObjCObjectPointerType accept typedefs of id. llvm-svn: 68931
* if we already know that a decl is invalid in an @catch, don't verify its type.Chris Lattner2009-04-121-1/+5
| | | | llvm-svn: 68925
* fix some out of date comments pointed out by SebastianChris Lattner2009-04-121-2/+1
| | | | llvm-svn: 68923
* fix a comment typo Sebastian noticed.Chris Lattner2009-04-121-1/+1
| | | | llvm-svn: 68921
* add support for handling C++'0x unified initializer syntaxChris Lattner2009-04-121-2/+2
| | | | | | to isValidAfterIdentifierInDeclarator, as suggested by Sebastian. llvm-svn: 68920
* Fix some C++ error recovery problems in init declarator parsingChris Lattner2009-04-121-6/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that I noticed working on other things. Instead of emitting: t2.cc:1:8: error: use of undeclared identifier 'g' int x(*g); ^ t2.cc:1:10: error: expected ')' int x(*g); ^ t2.cc:1:6: note: to match this '(' int x(*g); ^ We now only emit: t2.cc:1:7: warning: type specifier missing, defaults to 'int' int x(*g); ^ Note that the example in SemaCXX/nested-name-spec.cpp:f4 is still not great, we now produce both of: void f4(undef::C); // expected-error {{use of undeclared identifier 'undef'}} \ expected-error {{variable has incomplete type 'void'}} The second diagnostic should be silenced by something getting marked invalid. I don't plan to fix this though. llvm-svn: 68919
* fix another case that assumed that GetTypeForDeclarator would never return null.Chris Lattner2009-04-121-4/+5
| | | | llvm-svn: 68918
* mark the declspec as invalid when we recover instead of forcing to int,Chris Lattner2009-04-121-3/+3
| | | | | | this allows downstream diags to be properly silenced. llvm-svn: 68917
* fix code that incorrectly assumed that GetTypeForDeclarator cannotChris Lattner2009-04-121-2/+4
| | | | | | return null. llvm-svn: 68916
* Diagnose invalid uses of tagged types with a missing tag. For example, in:Chris Lattner2009-04-124-31/+80
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | struct xyz { int y; }; enum abc { ZZZ }; static xyz b; abc c; we used to produce: t2.c:4:8: error: unknown type name 'xyz' static xyz b; ^ t2.c:5:1: error: unknown type name 'abc' abc c; ^ we now produce: t2.c:4:8: error: use of tagged type 'xyz' without 'struct' tag static xyz b; ^ struct t2.c:5:1: error: use of tagged type 'abc' without 'enum' tag abc c; ^ enum GCC produces the normal: t2.c:4: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘b’ t2.c:5: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘c’ rdar://6783347 llvm-svn: 68914
* fix a valgrind problem I noticed while developing another patch,Chris Lattner2009-04-121-1/+1
| | | | | | | if a decl is invalid, it isn't added to the Decls array, so we need to pass in Decls.size() to avoid reading uninit memory. llvm-svn: 68913
* Implement the first set of changes for PR3963 and rdar://6759604,Chris Lattner2009-04-121-4/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | which tries to do better error recovery when it is "obvious" that an identifier is a mis-typed typename. In this case, we try to parse it as a typename instead of as the identifier in a declarator, which gives us several options for better error recovery and immediately makes diagnostics more useful. For example, we now produce: t.c:4:8: error: unknown type name 'foo_t' static foo_t a = 4; ^ instead of: t.c:4:14: error: invalid token after top level declarator static foo_t a = 4; ^ Also, since we now parse "a" correctly, we make a decl for it, preventing later uses of 'a' from emitting things like: t.c:12:20: error: use of undeclared identifier 'a' int bar() { return a + b; } ^ I'd really appreciate any scrutiny possible on this, it is a tricky area. llvm-svn: 68911
* add a new isNull() method to DeclGroupRef.Chris Lattner2009-04-121-2/+3
| | | | llvm-svn: 68909
* a few cleanups to StatementCreatesScope: unnest the whole thing,Chris Lattner2009-04-121-12/+15
| | | | | | | exit at the first decl found that creates a scope, don't evaluate decl_end() every iteration. llvm-svn: 68908
* Parse deleted member functions. Parsing member declarations goes through a ↵Sebastian Redl2009-04-126-47/+140
| | | | | | | | | different code path that I forgot previously. Implement the rvalue reference overload dance for returning local objects. Returning a local object first tries to find a move constructor now. The error message when no move constructor is defined (or is not applicable) and the copy constructor is deleted is quite ugly, though. llvm-svn: 68902
* Fix rdar://6770142 - Class and qualified id's are compatible, just likeChris Lattner2009-04-122-4/+7
| | | | | | Class and unqualified id's are. llvm-svn: 68899
* Fix rdar://6771034: don't warn on use of forward declared protocol in protocolChris Lattner2009-04-122-2/+2
| | | | | | | list of another protocol definition. This warning is very noisy and GCC doesn't produce it so existing code doesn't expect it. llvm-svn: 68894
* implement rdar://6780761, making sema reject some code that otherwiseChris Lattner2009-04-124-19/+30
| | | | | | crashes codegen. llvm-svn: 68891
* Implement support for GCC's -dD mode, which dumps -E output *and*Chris Lattner2009-04-121-0/+1
| | | | | | macro definitions. llvm-svn: 68884
* add a ppcallback hook for macro definitions.Chris Lattner2009-04-121-0/+4
| | | | llvm-svn: 68883
* now that we have an identifier table in the PCH file, finish hooking upChris Lattner2009-04-112-49/+43
| | | | | | | macro deserialization. We now correctly install II's in tokens, handle function-like macros, etc. llvm-svn: 68882
* improve location info for property stuff. In a property like this:Chris Lattner2009-04-111-11/+10
| | | | | | | | | | | @property int x; associate the location of X with the property decl, not the location of the @. Also, pass this info along to the synthesized ParmVarDecls so that redefinition and other diagnostics can use it. This eliminates a fixme. llvm-svn: 68880
* improve the 'conflicting types' diagnostics to include correct location ↵Chris Lattner2009-04-111-16/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | info, now that it is plumbed through Sema. On a file from growl, we used to emit: t.mi:107059:1: warning: conflicting types for 'removePluginHandler:forPluginTypes:' - (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions { ^ t.mi:105280:1: note: previous definition is here - (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types; ^ now we produce: t.mi:107059:55: warning: conflicting parameter types in implementation of 'removePluginHandler:forPluginTypes:': 'id<NSObject>' vs 'id<GrowlPluginHandler>' - (void) removePluginHandler:(id <GrowlPluginHandler>)handler forPluginTypes:(NSSet *)extensions { ^ t.mi:105280:45: note: previous definition is here - (void) removePluginHandler:(id <NSObject>)handler forPluginTypes:(NSSet *)types; ^ We still don't have proper loc info for properties, hence the FIXME. rdar://6782494 llvm-svn: 68879
* Set proper location info on objc method arguments.Chris Lattner2009-04-111-5/+3
| | | | llvm-svn: 68877
* simplify code to use adjustParameterType, apply objc arg attributesChris Lattner2009-04-112-19/+19
| | | | | | to their arguments. llvm-svn: 68876
* fix blocks to reject objc interfaces returned by value. Also,Chris Lattner2009-04-111-11/+22
| | | | | | | a block without a prototype should still coerce a return in it to use the declared return type. llvm-svn: 68875
* diagnose attempts to return objc interfaces by-value from C functions.Chris Lattner2009-04-111-1/+9
| | | | llvm-svn: 68873
* Improve the 'cannot pass objc interface by value' diagnostic:Chris Lattner2009-04-112-20/+19
| | | | | | | | | | | | | | | | | | 1) improve localizability by not passing english strings in. 2) improve location for arguments. 3) print the objc type being passed. Before: method-bad-param.m:15:1: error: Objective-C type cannot be passed by value -(void) my_method:(foo) my_param ^ after: method-bad-param.m:15:25: error: Objective-C interface type 'foo' cannot be passed by value -(void) my_method:(foo) my_param ^ llvm-svn: 68872
* change the interface to ActOnMethodDeclaration to pass down argumentChris Lattner2009-04-113-29/+32
| | | | | | | information in a little struct instead of individually. While we're at it, add per-argument loc info and attribute info. llvm-svn: 68871
* Minor refactoring of my last patch.Fariborz Jahanian2009-04-111-2/+2
| | | | llvm-svn: 68870
* sink abstract typedefs like Action::ExprTy from the Action classChris Lattner2009-04-111-3/+4
| | | | | | | | | | | down to the ActionBase class. This eliminates dependencies of (e.g.) DeclSpec.h on Action.h, meaning that action.h can now include these headers and use their types directly in the actions interfaces. This is a refactoring to support a future change, no functionality change. llvm-svn: 68869
* add some #includes for better compatibility with gcc 4.4,Chris Lattner2009-04-111-1/+1
| | | | | | thanks to Tobias Stadler for pointing this out. llvm-svn: 68868
* rename Parser::ParseObjCSelector -> Parser::ParseObjCSelectorPiece,Chris Lattner2009-04-111-7/+7
| | | | | | | since it only parses one identifier out of the selector, not the whole thing. llvm-svn: 68867
* simplify this code to not bother stripping to canonical types, andChris Lattner2009-04-111-15/+12
| | | | | | indent code properly llvm-svn: 68866
* Fixes a ir-gen crash for K&R style blocks.Fariborz Jahanian2009-04-111-5/+16
| | | | llvm-svn: 68865
* Don't mangle variables that are at translation unit scope.Anders Carlsson2009-04-111-1/+2
| | | | llvm-svn: 68853
* Add support for generating reference initialization code.Anders Carlsson2009-04-111-2/+21
| | | | llvm-svn: 68852
* Add analyzer support for objc_atomicCompareAndSwap()Ted Kremenek2009-04-111-2/+3
| | | | llvm-svn: 68849
* Store unique IDs for identifiers in the PCH file. Use some bitmanglingDouglas Gregor2009-04-112-13/+98
| | | | | | | so that we only need to perform the lookup and identifier resolution once per identifier in the PCH file. llvm-svn: 68846
* Implement analyzer support for OSCompareAndSwap. This required pushing "tagged"Ted Kremenek2009-04-115-24/+237
| | | | | | | | | ProgramPoints all the way through to GRCoreEngine. NSString.m now fails with RegionStoreManager because of the void** cast. Disabling use of region store for that test for now. llvm-svn: 68845
OpenPOWER on IntegriCloud