summaryrefslogtreecommitdiffstats
path: root/clang/lib/AST
Commit message (Collapse)AuthorAgeFilesLines
* Use RecordFirst/RecordLast range checks in DeclContextDouglas Gregor2009-02-261-1/+1
| | | | llvm-svn: 65489
* Perform additional semantic checking of class templateDouglas Gregor2009-02-251-0/+8
| | | | | | | | | | | | specializations. In particular: - Make sure class template specializations have a "template<>" header, and complain if they don't. - Make sure class template specializations are declared/defined within a valid context. (e.g., you can't declare a specialization std::vector<MyType> in the global namespace). llvm-svn: 65476
* Implement parsing of nested-name-specifiers that involve template-ids, e.g.,Douglas Gregor2009-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | std::vector<int>::allocator_type When we parse a template-id that names a type, it will become either a template-id annotation (which is a parsed representation of a template-id that has not yet been through semantic analysis) or a typename annotation (where semantic analysis has resolved the template-id to an actual type), depending on the context. We only produce a type in contexts where we know that we only need type information, e.g., in a type specifier. Otherwise, we create a template-id annotation that can later be "upgraded" by transforming it into a typename annotation when the parser needs a type. This occurs, for example, when we've parsed "std::vector<int>" above and then see the '::' after it. However, it means that when writing something like this: template<> class Outer::Inner<int> { ... }; We have two tokens to represent Outer::Inner<int>: one token for the nested name specifier Outer::, and one template-id annotation token for Inner<int>, which will be passed to semantic analysis to define the class template specialization. Most of the churn in the template tests in this patch come from an improvement in our error recovery from ill-formed template-ids. llvm-svn: 65467
* C99 DR #316 implies that the function parameter types that are knownDouglas Gregor2009-02-251-2/+6
| | | | | | | | | | only from a function definition (that does not have a prototype) are only used to determine the compatible with other declarations of that same function. In particular, when referencing the function we pretend as if it does not have a prototype. Implement this behavior, which fixes PR3626. llvm-svn: 65460
* first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner2009-02-242-1/+4
| | | | | | | The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
* When we're declaring an object or function with linkage, teach nameDouglas Gregor2009-02-241-0/+9
| | | | | | | lookup to skip over names without linkage. This finishes <rdar://problem/6127293>. llvm-svn: 65386
* Improve merging of function declarations. Specifically:Douglas Gregor2009-02-241-0/+5
| | | | | | | | | | | | | | | | - When we are declaring a function in local scope, we can merge with a visible declaration from an outer scope if that declaration refers to an entity with linkage. This behavior now works in C++ and properly ignores entities without linkage. - Diagnose the use of "static" on a function declaration in local scope. - Diagnose the declaration of a static function after a non-static declaration of the same function. - Propagate the storage specifier to a function declaration from a prior declaration (PR3425) - Don't name-mangle "main" llvm-svn: 65360
* We should not generate __weak write barrier on indirect referenceFariborz Jahanian2009-02-231-0/+2
| | | | | | | of a pointer to object; This patch does this odd behavior according to gcc. llvm-svn: 65334
* Revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.Steve Naroff2009-02-233-53/+2
| | | | | | Remove support for "Class<P>". Will be making this an error. llvm-svn: 65332
* Add copy assignment operator, caught by doug.Chris Lattner2009-02-231-0/+9
| | | | llvm-svn: 65331
* A few small improvements to Evaluate for stuff I noted in FIXMEs.Eli Friedman2009-02-231-17/+88
| | | | llvm-svn: 65305
* Contains the following (related to problems found while investigting ↵Steve Naroff2009-02-222-9/+36
| | | | | | | | | | <rdar://problem/6497631> Message lookup is sometimes different than gcc's). - Implement instance/class overloading in ObjCContainerDecl (removing a FIXME). This involved hacking NamedDecl::declarationReplaces(), which took awhile to figure out (didn't realize replace was the default). - Changed Sema::ActOnInstanceMessage() to remove redundant warnings when dealing with protocols. For now, I've omitted the "protocol" term in the diagnostic. It simplifies the code flow and wan't always 100% accurate (e.g. "Foo<Prot>" looks in the class interface, not just the protocol). - Changed several test cases to jive with the above changes. llvm-svn: 65292
* More objc gc work. Match gcc's treatment of ivar accessFariborz Jahanian2009-02-221-0/+27
| | | | | | | true a local pointer to objective-c object in generating write barriers. llvm-svn: 65290
* A bit of Evaluate cleanup. Also, a full audit of what's missing that Eli Friedman2009-02-221-22/+33
| | | | | | someone would reasonably expect Evaluate to handle for C/ObjC. llvm-svn: 65284
* Enhance Evaluate to handle ObjC qualified id and class types; as far as Eli Friedman2009-02-222-4/+10
| | | | | | | | I know, these follow the exact same rules as pointers, so I just made them use the same codepath. Someone more familiar with ObjC should double-check this, though. llvm-svn: 65261
* Fix for PR3433: map __alignof__ to preferred alignment. (This was Eli Friedman2009-02-221-1/+1
| | | | | | partially done in r65258.) llvm-svn: 65260
* Improvements to ASTContext::getDeclAlignInBytes; fixes the testcase in Eli Friedman2009-02-222-31/+20
| | | | | | | | | PR3254 and part of PR3433. The isICE changes are necessary to keep the computed results consistent with Evaluate. llvm-svn: 65258
* Correctly encode incomplete and variable length arrays. Fixes PR3639.Anders Carlsson2009-02-221-8/+19
| | | | llvm-svn: 65255
* More work to integrate newly added ObjCQualifiedClassType into the type system.Steve Naroff2009-02-212-2/+3
| | | | | | This is necessary 'plumbing' to fix <rdar://problem/6497631> Message lookup is sometimes different than gcc's. llvm-svn: 65248
* Add support for GCC ObjC extension "Class<protocol>". Sigh.Steve Naroff2009-02-212-0/+50
| | | | | | | | Found while researching <rdar://problem/6497631> Message lookup is sometimes different than gcc's. Will never be seen in user code. Needed to pass dejagnu testsuite. llvm-svn: 65244
* Fixed an ICE in meta-data generation of __weak/__strong ivars.Fariborz Jahanian2009-02-211-1/+2
| | | | llvm-svn: 65235
* Evaluation of unary deref could call integer evaluator on non-integralDaniel Dunbar2009-02-211-0/+7
| | | | | | | expr; hilarity ensued. - PR3640. llvm-svn: 65234
* Fix build on windows.Cedric Venet2009-02-211-1/+2
| | | | | | Should clang have a config.h or should we use the config.h of llvm or using the preprocessor is OK? I did a quick fix here, but having a guideline on how to handle non portable function would be great (or ask ted to stop breaking the windows build :)). llvm-svn: 65233
* This fixes <rdar://problem/6497650> More type mismatches issues with clang.Steve Naroff2009-02-211-2/+16
| | | | | | | | | | Move two key ObjC typechecks from Sema::CheckPointerTypesForAssignment() to ASTContext::mergeTypes(). This allows us to take advantage of the recursion in ASTContext::mergeTypes(), removing some bogus warnings. This test case I've added includes an example where we still warn (and GCC doesn't). Need to talk with folks and decide what to do. At this point, the major bogosities should be fixed. llvm-svn: 65231
* allocate and dellocate objc decl list through AST Context instead ofChris Lattner2009-02-201-2/+3
| | | | | | | | | with new/delete. With disable-free, this reduces the number of 4/8 byte mallocs from 4793/1541 to 865/456 and also drops other sizes as well. This is a very small perf win, nothing major. llvm-svn: 65171
* add plumbing to get ASTContext& down to allocation/deallocation points in ↵Chris Lattner2009-02-201-19/+29
| | | | | | | | ObjCList, but don't start using it yet. Renamed some methods to be more consistent. llvm-svn: 65168
* newly factored, we can now move the set and destroy methods out of line.Chris Lattner2009-02-201-0/+20
| | | | llvm-svn: 65166
* rename ObjCList::clear() -> ObjCList::Destroy(). Require that destroy is calledChris Lattner2009-02-201-6/+6
| | | | | | before the dtor. llvm-svn: 65156
* rearrange the contents of DeclObjC to be by-class. Fix some 80 column issuesChris Lattner2009-02-201-328/+367
| | | | | | and other non-semantic changes. llvm-svn: 65155
* destroy should forward to base class.Chris Lattner2009-02-201-0/+1
| | | | llvm-svn: 65151
* move the @implementation ivar list to being an ObjCList, which preventsChris Lattner2009-02-201-12/+6
| | | | | | it from being leaked, among other things. llvm-svn: 65150
* remove some more methods from objc decls, using the iteratorChris Lattner2009-02-201-6/+7
| | | | | | interfaces more consistently. llvm-svn: 65138
* Handle constant int -> ptr casts of lvalue results.Daniel Dunbar2009-02-201-8/+17
| | | | | | - PR3463 (again). llvm-svn: 65133
* remove some slow O(n) methods.Chris Lattner2009-02-201-19/+0
| | | | llvm-svn: 65132
* Change ObjCForwardProtocolDecl to use an ObjCList.Chris Lattner2009-02-201-11/+6
| | | | llvm-svn: 65131
* move the interace list of @class to use ObjCList.Chris Lattner2009-02-201-16/+3
| | | | llvm-svn: 65129
* remove a dead list.Chris Lattner2009-02-201-2/+1
| | | | llvm-svn: 65127
* switch ObjCMethodDecl's parameter list from being explicitly managed to an ↵Chris Lattner2009-02-201-14/+1
| | | | | | ObjCList. llvm-svn: 65114
* switch the interface ivar list from being explicitly managed to using ObjCList.Chris Lattner2009-02-201-17/+2
| | | | llvm-svn: 65113
* move more objc destruction out of dtors into Destroy.Chris Lattner2009-02-201-11/+42
| | | | llvm-svn: 65112
* move some objc decl destruction out of dtors into Destroy method.Chris Lattner2009-02-201-6/+9
| | | | llvm-svn: 65111
* A few small tweaks to isConstantInitializer. (No test because this Eli Friedman2009-02-201-3/+9
| | | | | | isn't getting used by Sema or CodeGen at the moment...) llvm-svn: 65107
* Add support for * (unary dereference) operator to ExprConstant.Eli Friedman2009-02-201-0/+9
| | | | llvm-svn: 65105
* optimize the 'StoredDeclsMap' for the common case where there is Chris Lattner2009-02-201-44/+121
| | | | | | | | | | exactly one decl with a specific name in a specific context. This avoids a bunch of malloc traffic and shrinks StoredDeclsMap to hold one pointer instead of 3 words (for a std::vector). This speeds up -fsyntax-only on cocoa.h with PTH by ~7.3%. llvm-svn: 65103
* ExprConstant handling for a couple more cases of pointer-to-int casts Eli Friedman2009-02-201-3/+18
| | | | | | from the testsuite. llvm-svn: 65098
* make the redeclaration case faster for the common instance of a redeclarationChris Lattner2009-02-201-8/+19
| | | | | | | | where there is exactly one existing declaration. This is common. this speeds up clang about 3% on cocoa.h for me 0.165 -> 0.160s llvm-svn: 65096
* 80 colsChris Lattner2009-02-201-1/+2
| | | | llvm-svn: 65095
* slight code simplifications.Chris Lattner2009-02-201-15/+12
| | | | llvm-svn: 65094
* pretty printing vector types should print the element type, not just the ↵Chris Lattner2009-02-191-0/+1
| | | | | | attribute. llvm-svn: 65078
* More objc's gc ir-gen stuff.Fariborz Jahanian2009-02-191-3/+8
| | | | llvm-svn: 65077
OpenPOWER on IntegriCloud