summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement parsing of nested-name-specifiers that involve template-ids, e.g.,Douglas Gregor2009-02-2510-145/+361
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Pull COdeGenFunction::CreateStaticBlockVarDecl (just for creating theDaniel Dunbar2009-02-254-65/+92
| | | | | | | | global variable) out of GenerateStaticBlockVarDecl. - No intended functionality change. - Prep for some mild cleanups and PR3662. llvm-svn: 65466
* add c++ search path for GCC 4.2, PR3668, patch by Pawel Worach!Chris Lattner2009-02-251-1/+3
| | | | llvm-svn: 65462
* Use CheckAssignmentConstraints for checking the cleanup attr function. Fixes ↵Anders Carlsson2009-02-251-1/+1
| | | | | | PR3656. llvm-svn: 65461
* C99 DR #316 implies that the function parameter types that are knownDouglas Gregor2009-02-254-4/+27
| | | | | | | | | | 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
* Minor cleanup for IntToBlockPointer so it applies to all callers of Eli Friedman2009-02-251-5/+1
| | | | | | | Sema::CheckAssignmentConstraints; not really visible, but the right thing to do. llvm-svn: 65428
* retain/release checker: Implement basic tracking of autorelease stack. Next ↵Ted Kremenek2009-02-251-6/+26
| | | | | | thing is to wire up pools with their contents. llvm-svn: 65425
* Fix comments.Devang Patel2009-02-251-3/+3
| | | | llvm-svn: 65423
* Enable debug info emission for objc methods.Devang Patel2009-02-251-0/+3
| | | | llvm-svn: 65422
* Minor refactoring.Fariborz Jahanian2009-02-241-3/+2
| | | | llvm-svn: 65414
* patch for two things.Fariborz Jahanian2009-02-242-5/+8
| | | | | | | make sure objc2's nonfragile abi is enacted for Leopard too. add -fobjc-gc-only flag to the image_info symbol. llvm-svn: 65413
* Fix broken logic from my last commit. Branches only occur at basic blocks ↵Ted Kremenek2009-02-241-1/+1
| | | | | | that end with terminators. llvm-svn: 65410
* Fix diagnostic regression where the leak diagnostic could appear earlier in ↵Ted Kremenek2009-02-241-1/+11
| | | | | | the path than the branches taken. llvm-svn: 65407
* If Loc is invalid (e.g. "self" in Objective-C) then use MainFileID's compile ↵Devang Patel2009-02-241-1/+4
| | | | | | unit. llvm-svn: 65403
* handle @encode interactions with array initializers.Chris Lattner2009-02-241-17/+21
| | | | llvm-svn: 65401
* rename CheckStringLiteralInit to CheckStringInit and pass in the Chris Lattner2009-02-241-19/+26
| | | | | | string size as an argument. llvm-svn: 65400
* make SemaRef be a reference to sema, not a pointer.Chris Lattner2009-02-241-78/+78
| | | | llvm-svn: 65399
* move InitListChecker to be private to SemaInit.cppChris Lattner2009-02-242-5/+3
| | | | llvm-svn: 65398
* Make CheckSingleInitializer a static function in SemaInit.cppChris Lattner2009-02-242-15/+13
| | | | llvm-svn: 65397
* make CheckStringLiteralInit a static function in SemaInit.cppChris Lattner2009-02-242-19/+19
| | | | llvm-svn: 65396
* change IsStringLiteralInit into a static function in SemaInit.cppChris Lattner2009-02-242-8/+8
| | | | llvm-svn: 65395
* move some initialization checking code from SemaDecl.cppChris Lattner2009-02-242-144/+156
| | | | | | to SemaInit.cpp, no functionality change. llvm-svn: 65394
* first wave of fixes for @encode sema support. This is part of PR3648.Chris Lattner2009-02-2410-47/+93
| | | | | | | The big difference here is that (like string literal) @encode has array type, not pointer type. llvm-svn: 65391
* some minor cleanups, handle ObjCEncodeExpr in a couple places.Chris Lattner2009-02-241-6/+6
| | | | llvm-svn: 65389
* Set flag for -fobjc-gc in IMAGE_INFO variable.Fariborz Jahanian2009-02-241-1/+5
| | | | llvm-svn: 65387
* When we're declaring an object or function with linkage, teach nameDouglas Gregor2009-02-244-25/+71
| | | | | | | lookup to skip over names without linkage. This finishes <rdar://problem/6127293>. llvm-svn: 65386
* Extend the implicit declaration and checking against out-of-scopeDouglas Gregor2009-02-242-104/+163
| | | | | | | | | | | | | external declarations to also support external variable declarations. Unified the code for these two cases into two new subroutines. Note that we fail to diagnose cases like the one Neil pointed out, where a visible non-external declaration hides an external declaration by the same name. That will require some reshuffling of name lookup. llvm-svn: 65385
* retain/release checker:Ted Kremenek2009-02-241-70/+38
| | | | | | | | | | | | - For autorelease pool tracking, keep information about the stack of pools separate from their contents. Also, keep track of the number of times an autorelease pool will send the "release" message to an object when the pool is destroyed. - Update CFRefCount::Update to return a new state instead of a reference count binding. This will allow us to implement more complicated semantics with autorelease pools. llvm-svn: 65384
* Fix IRgen of constant expressions referring to external/staticDaniel Dunbar2009-02-241-5/+8
| | | | | | | variables. - PR3657. llvm-svn: 65381
* Some initial Obj-C zero cost EH support.Daniel Dunbar2009-02-241-5/+134
| | | | | | | | | - Only handles cases with @try with no @catch blocks, and there are a number of problems with the implementation. Nevertheless, this is good enough to handled @synchronized correctly, and some other basic uses. llvm-svn: 65378
* Add a note about an IRgen optimization opportunity.Daniel Dunbar2009-02-241-1/+7
| | | | llvm-svn: 65376
* Fix PR3635 by handling ## magicallyChris Lattner2009-02-241-0/+5
| | | | llvm-svn: 65374
* In C, when we see a function declaration within a local scope, exportDouglas Gregor2009-02-242-1/+76
| | | | | | | | | | that declaration to global scope so that it can be found from other scopes. This allows us to diagnose redeclaration errors for external declarations across scopes. We also warn when name lookup finds such an out-of-scope declaration. This is part of <rdar://problem/6127293>; we'll also need to do the same thing for variables. llvm-svn: 65373
* Prevent accidental copying of CodeGenFunction and CodeGenModule.Anders Carlsson2009-02-242-0/+5
| | | | llvm-svn: 65372
* Pass the CodeGenModule object to GenerateBlockFunction, instead of *this ↵Anders Carlsson2009-02-241-6/+1
| | | | | | | | (which will call the copy constructor). Also, since we're creating a new CodeGenFunction object for each block function, we don't need to clear the BreakContinueStack. llvm-svn: 65371
* Ensure that we can't break or continue out of a block.Mike Stump2009-02-241-0/+5
| | | | llvm-svn: 65370
* Fix <rdar://problem/6611677>: Add basic transfer function support in the staticTed Kremenek2009-02-242-3/+18
| | | | | | | | | analyzer for array subscript expressions involving bases that are vectors. This solution is probably a hack: it gets the lvalue of the vector instead of an rvalue like all other types. This should be reviewed (big FIXME in GRExprEngine). llvm-svn: 65366
* Fix two @synchronized bugs found by inspection: the expression to sychronize ↵Daniel Dunbar2009-02-241-40/+32
| | | | | | | | | on should only be evaluated once, and it is evaluated outside the cleanup scope. Also, lift SyncEnter and SyncExit up in nervous anticipation of x86-64 zero cost EH. llvm-svn: 65362
* Improve merging of function declarations. Specifically:Douglas Gregor2009-02-244-27/+124
| | | | | | | | | | | | | | | | - 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
* Move PTHStatCache within the anonymous namespace.Ted Kremenek2009-02-231-1/+1
| | | | llvm-svn: 65348
* Tidy up 'ExecutionContinues' to distinguish between jumping to the end of a ↵Ted Kremenek2009-02-231-17/+14
| | | | | | 'method' or 'funciton'. llvm-svn: 65346
* Tidy up the path diagnostic generation logic in BugReporter and remove a ↵Ted Kremenek2009-02-231-50/+53
| | | | | | case where an "Execution continues..." diagnostic could result in an empty message bubble. llvm-svn: 65342
* fix rdar://6611778, a redefinition of an interface was causing anChris Lattner2009-02-232-6/+14
| | | | | | | | assertion when the ivars and method list was reset into the existing interface. To fix this, mark decls as invalid when they are redefined, and don't insert ivars/methods into invalid decls. llvm-svn: 65340
* We should not generate __weak write barrier on indirect referenceFariborz Jahanian2009-02-232-3/+14
| | | | | | | of a pointer to object; This patch does this odd behavior according to gcc. llvm-svn: 65334
* - Generate error for protocol qualifiers on 'Class'.Steve Naroff2009-02-231-2/+6
| | | | | | - Generate error for protocol qualifiers on non-ObjC types. llvm-svn: 65333
* Revert http://llvm.org/viewvc/llvm-project?view=rev&revision=65244.Steve Naroff2009-02-235-58/+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
* Add more boilerplate logic to more accurately reason about autorelease pools.Ted Kremenek2009-02-231-4/+52
| | | | | | | This doesn't change the current functionality, but better codifies the autorelease pool stack itself. llvm-svn: 65328
* Add low level support for generating invoke instead of calls.Daniel Dunbar2009-02-233-16/+46
| | | | | | - No functionality change. llvm-svn: 65325
* Fix 80 col. violations.Ted Kremenek2009-02-231-2/+4
| | | | llvm-svn: 65322
OpenPOWER on IntegriCloud