summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Update for llvm commit r134291.Eric Christopher2011-07-024-5/+6
| | | | | | Fixes rdar://9714064 llvm-svn: 134292
* Move the Sema argument to all of the Sema-using helper functions inChandler Carruth2011-07-021-164/+162
| | | | | | | | | SemaDeclAttr to the first argument. This makes them follow the very consistent policy elsewhere in Sema for helper functions. Original patch by Caitlin Sadowski, with some tweaking by me. llvm-svn: 134290
* Rename static helpers to use 'camelCaseNames' per the new styleChandler Carruth2011-07-011-142/+142
| | | | | | | | recommendations before adding more of them. Patch by Caitlin Sadowski. llvm-svn: 134289
* Mechanical rename of 'd' Decl pointer parameters to 'D'. This is moreChandler Carruth2011-07-011-317/+317
| | | | | | | | | | conventional in the rest of Clang's codebase, and closer to the current style recommendations. It also makes the code more internally consistent as FD, VD, etc are used frequently for particular decl variables. Patch by Caitlin Sadowski. llvm-svn: 134288
* -Fix mistake in ASTContext::getInnerObjCOwnership noticed by DougArgyrios Kyrtzidis2011-07-012-4/+1
| | | | | | | | -Remove unnecessary 'return'. -Remove unnecessary 'if' check (llvm_unreachable make sure attrStr will be non-null) -Add a test of transferring ownership to a reference cast type. llvm-svn: 134285
* Add initial *-*-rtems* target, from Joel SherrillDouglas Gregor2011-07-012-1/+77
| | | | llvm-svn: 134283
* Fix the warning that is emitted when an ownership attribute is applied ↵Argyrios Kyrtzidis2011-07-011-0/+5
| | | | | | incorrectly. llvm-svn: 134278
* Use transferARCOwnershipToDeclaratorChunk in inferARCWriteback, no ↵Argyrios Kyrtzidis2011-07-011-9/+6
| | | | | | functionality change. llvm-svn: 134277
* Fix assertion hit in inferARCWriteback.Argyrios Kyrtzidis2011-07-011-2/+3
| | | | llvm-svn: 134276
* [ARC] When casting from a pointer to an objective-c object with known ↵Argyrios Kyrtzidis2011-07-013-43/+73
| | | | | | | | | | | | ownership, if the cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type to the cast type: id x; (NSString**)&x; // Casting as (__strong NSString**). llvm-svn: 134275
* -Remove Sema::ActOnCastOfParenListExpr and move most of its functionality toArgyrios Kyrtzidis2011-07-012-80/+96
| | | | | | | | | newly introduced Sema::BuildVectorLiteral. -Make Sema::ActOnCastExpr handle a vector initializer both when the cast'ed expression is a ParenListExpr and when it is a ParenExpr. -Ultimately make Sema::ActOnParenOrParenListExpr independent of what the cast type was. llvm-svn: 134274
* [ARC] When casting from a pointer to an objective-c object with known ↵Argyrios Kyrtzidis2011-07-014-10/+153
| | | | | | | | | | | | | | ownership, if the cast type has no ownership specified, implicitly "transfer" the ownership of the cast'ed type to the cast type: id x; static_cast<NSString**>(&x); // Casting as (__strong NSString**). This currently only works for C++ named casts, C casts to follow. llvm-svn: 134273
* Break Sema::GetTypeForDeclarator in 2 functions, one for DeclSpec processing ↵Argyrios Kyrtzidis2011-07-011-148/+175
| | | | | | | | and another for the rest. No functionality change. llvm-svn: 134272
* Introduce Declarator::ObjCCatchContext, this will result in correct error ↵Argyrios Kyrtzidis2011-07-012-4/+4
| | | | | | for 'auto' in obj-c catch. llvm-svn: 134271
* Emit guard variables for any weak global that has a run-timeDouglas Gregor2011-07-011-6/+5
| | | | | | | initializer. Previously, we only used guard variables for weak static data members. Fixes <rdar://problem/9692249>. llvm-svn: 134266
* When adding boolean keywords for typo correction, add either "bool" orDouglas Gregor2011-07-011-2/+4
| | | | | | | "_Bool" (depending on dialect), but not both, since they have the same edit distance from "Bool". llvm-svn: 134263
* Don't zero-initialize default-initialized local variables that haveDouglas Gregor2011-07-011-1/+18
| | | | | | | | trivial default constructors. This generated-code regression was caused by r131796, which had simplified the handling of default initialization in Sema. Fixes <rdar://problem/9694300>. llvm-svn: 134260
* For code such as:Richard Trieu2011-07-011-1/+0
| | | | | | | | | | | | | | | | | | | | | | | int f(int x) { if (int foo = f(bar)) {} return 0; } Clang produces the following error messages: paren_imbalance.cc:2:19: error: use of undeclared identifier 'bar' if (int foo = f(bar)) {} ^ paren_imbalance.cc:2:26: error: expected ')' if (int foo = f(bar)) {} ^ paren_imbalance.cc:2:6: note: to match this '(' if (int foo = f(bar)) {} ^ The second error is incorrect. This patch will stop Clang from producing an error on parenthesis imbalance during error recovery when there isn't one. llvm-svn: 134258
* Fix for PR7410. Allow functions in a derived class that improperly overwrite ↵Richard Trieu2011-07-011-1/+1
| | | | | | a virtual function in the base class to be inserted into the derived class function list to prevent extra errors every time the derived class is used. llvm-svn: 134251
* Fix AST representations of alias-declarations which define tag types. Inside ↵Richard Smith2011-07-013-12/+26
| | | | | | classes, the tag types need to have an associated access specifier, and inside function definitions, they need to be included in the declarations of the DeclStmt. These issues manifested as assertions during template instantiation, and also in a WIP constexpr patch. llvm-svn: 134250
* When we create a precompiled preamble, don't copy theDouglas Gregor2011-07-011-6/+9
| | | | | | | | | | | CompilerInvocation on the stack, because other objects (e.g., the CompilerInstance) maintain an intrusive reference-counted pointer to the CompilerInvocation. This doesn't matter in the normal case, because we take back the CompilerInvocation. However, during crash recovery, this leads to us trying to free an object on the stack, and hilarity ensues. Fixes <rdar://problem/9652540>. llvm-svn: 134245
* Just mangle substituted template parameter types as unresolved types.John McCall2011-07-011-10/+3
| | | | | | | This is kindof questionable but seems to do more-or-less the right thing. This is not a particularly friendly part of the ABI. llvm-svn: 134227
* Introduce the notion of instantiation dependence into Clang's AST. ADouglas Gregor2011-07-0114-72/+343
| | | | | | | | | | | | | | | | | | | | | | | | | | type/expression/template argument/etc. is instantiation-dependent if it somehow involves a template parameter, even if it doesn't meet the requirements for the more common kinds of dependence (dependent type, type-dependent expression, value-dependent expression). When we see an instantiation-dependent type, we know we always need to perform substitution into that instantiation-dependent type. This keeps us from short-circuiting evaluation in places where we shouldn't, and lets us properly implement C++0x [temp.type]p2. In theory, this would also allow us to properly mangle instantiation-dependent-but-not-dependent decltype types per the Itanium C++ ABI, but we aren't quite there because we still mangle based on the canonical type in cases like, e.g., template<unsigned> struct A { }; template<typename T> void f(A<sizeof(sizeof(decltype(T() + T())))>) { } template void f<int>(A<sizeof(sizeof(int))>); and therefore get the wrong answer. llvm-svn: 134225
* Change the mangling of enclosing template template parametersJohn McCall2011-07-011-19/+73
| | | | | | | that serve as the base template name of an unresolved-name to be mangled as a substitution. llvm-svn: 134213
* No, actually, we do need to be able to mangle substituted template names.John McCall2011-06-301-3/+10
| | | | llvm-svn: 134195
* Fix off-by-one error in StringLiteral::getLocationOfByte.Hans Wennborg2011-06-301-1/+1
| | | | | | This fixes PR10223. llvm-svn: 134183
* Perform lvalue-to-rvalue conversions on both operands of ->*John McCall2011-06-301-0/+14
| | | | | | and the RHS of .*. Noticed by Enea Zaffanella! llvm-svn: 134170
* Replace an unreachable error path with an assertPeter Collingbourne2011-06-301-4/+1
| | | | | | | (SourceManager::createFileID cannot return an invalid file ID). Also update a comment to reflect this. llvm-svn: 134168
* Add support for weakly imported classes (GNU runtime).David Chisnall2011-06-301-5/+8
| | | | llvm-svn: 134140
* Fixed enum constant evaluation assertions.Abramo Bagnara2011-06-301-6/+13
| | | | llvm-svn: 134139
* Improve the wording of the warning when returning a value fromChandler Carruth2011-06-301-1/+10
| | | | | | | | a constructor or destructor. Patch by Hans Wennborg. llvm-svn: 134138
* Preserve that a TemplateName was arrived at by substitutingJohn McCall2011-06-309-29/+146
| | | | | | | | | | | for a template template parameter. Uses to follow. I've also made the uniquing of SubstTemplateTemplateParmPacks use a ContextualFoldingSet as a minor space efficiency. llvm-svn: 134137
* Fix an obvious typo in an attribute's diagnostics.Chandler Carruth2011-06-301-1/+1
| | | | | | | | | | | Patch by Caitlin Sadowski. Unfortunately, this attribute doesn't seem to have a single test. It is only mentioned in comments in one test, and as a string literal in a copy of some Clang code checked in as a test for the Indexer. =[ It dates from 2009 r74280 as part of OpenCL 1.0. llvm-svn: 134136
* createTargetMachine now takes a CPU string.Evan Cheng2011-06-301-3/+3
| | | | llvm-svn: 134128
* Document and check tighter assumptions about the TemplateName of aJohn McCall2011-06-301-0/+3
| | | | | | TemplateSpecializationType. llvm-svn: 134120
* Introduce a caching mechanism for macro expanded tokens.Argyrios Kyrtzidis2011-06-294-10/+53
| | | | | | | | | | | | | | | Previously macro expanded tokens were added to Preprocessor's bump allocator and never released, even after the TokenLexer that were lexing them was finished, thus they were wasting memory. A very "useful" boost library was causing clang to eat 1 GB just for the expanded macro tokens. Introduce a special cache that works like a stack; a TokenLexer can add the macro expanded tokens in the cache, and when it finishes, the tokens are removed from the end of the cache. Now consumed memory by expanded tokens for that library is ~ 1.5 MB. Part of rdar://9327049. llvm-svn: 134105
* Introduce Preprocessor::getTotalMemory() and use it in CIndex.cpp, no ↵Argyrios Kyrtzidis2011-06-291-0/+4
| | | | | | functionality change. llvm-svn: 134103
* Check for deprecated/unavailable/etc attributes on fields that areDouglas Gregor2011-06-291-0/+15
| | | | | | initialized via initializer lists. Fixes <rdar://problem/9694686>. llvm-svn: 134099
* When redeclaring a local extern in the same scope, make sure that weDouglas Gregor2011-06-291-2/+12
| | | | | | | replace the existing declaration appropriately. Patch by Jordy Rose, fixes PR10013 / <rdar://problem/9584157>. llvm-svn: 134097
* objc-arc: fix a IRGen crash when checking forFariborz Jahanian2011-06-291-1/+2
| | | | | | | accessibility of an initializer which is a compound statement. // rdar://9694706 llvm-svn: 134091
* Use existing -fcatch-undefined-behavior option,Fariborz Jahanian2011-06-293-6/+1
| | | | | | replacing -freset-local-blocks. // rdar://9227352 llvm-svn: 134082
* Use preferred 64-bit alignment for i64 & f64 for Thumb targets. Radar 9695134.Bob Wilson2011-06-291-1/+1
| | | | llvm-svn: 134070
* Add ARC support for the GNUstep runtime.David Chisnall2011-06-291-6/+20
| | | | llvm-svn: 134065
* We don't pass classes with a copy-constructor or destructor byval, so the ↵Eli Friedman2011-06-291-0/+2
| | | | | | | | | | address takes up an integer register (if one is available). Make sure the x86-64 ABI implementation takes that into account properly. The fixed implementation is compatible with the implementation both gcc and llvm-gcc use. rdar://9686430 . (This is the issue that was reported in the thread "[LLVMdev] Segfault calling LLVM libs from a clang-compiled executable".) llvm-svn: 134059
* SubtargetFeature.h has been moved to MC.Evan Cheng2011-06-291-1/+1
| | | | llvm-svn: 134050
* Under a compiler flag, -freset-local-blocks,Fariborz Jahanian2011-06-283-0/+24
| | | | | | | wipe out stack blocks when they go out of scope. // rdar://9227352 llvm-svn: 134045
* Revert r133024, "[format strings] correctly suggest correct type for '%@'Daniel Dunbar2011-06-282-4/+1
| | | | | | | | | specifiers. Fixes <rdar://problem/9607158>." because it causes false positives on some code that uses CF toll free bridging. - I'll let Doug or Ted figure out the right fix here, possibly just to accept any pointer type. llvm-svn: 134041
* Fix non-determinism in selecting between equal-length names which referChandler Carruth2011-06-281-1/+9
| | | | | | | | | | | | | to the same declaration when correcting typos. This is done by essentially sorting the corrections as they're added. Original patch by Kaelyn Uhrain, but modified for style and correctness by accounting for more than just the textual spelling. This still is a bit of a WIP hack to make this deterministic. Kaelyn (and myself) are working on a more principled solution going forward. llvm-svn: 134038
* Fix an invalid use of ::back() on an newly emptied vector. Also tightenChandler Carruth2011-06-281-2/+4
| | | | | | | | | | up several places where we never expect to have NULL pointers to assert early. This fixes a valgrind error within CorrectTypo, but not the non-determinism. llvm-svn: 134032
* Driver/Darwin: -force_load can be specified multiple times.Daniel Dunbar2011-06-281-1/+1
| | | | llvm-svn: 134025
OpenPOWER on IntegriCloud