summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Fix case where the alignment is overaligned, per Eli's suggestion.Chad Rosier2012-04-171-1/+4
| | | | | | rdar://11220251 llvm-svn: 154893
* Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.Richard Smith2012-04-1712-519/+678
| | | | | | | | | | | | | | | | | | | | | | | | | | | | We have a new flavor of exception specification, EST_Uninstantiated. A function type with this exception specification carries a pointer to a FunctionDecl, and the exception specification for that FunctionDecl is instantiated (if needed) and used in the place of the function type's exception specification. When a function template declaration with a non-trivial exception specification is instantiated, the specialization's exception specification is set to this new 'uninstantiated' kind rather than being instantiated immediately. Expr::CanThrow has migrated onto Sema, so it can instantiate exception specs on-demand. Also, any odr-use of a function triggers the instantiation of its exception specification (the exception specification could be needed by IRGen). In passing, fix two places where a DeclRefExpr was created but the corresponding function was not actually marked odr-used. We used to get away with this, but don't any more. Also fix a bug where instantiating an exception specification which refers to function parameters resulted in a crash. We still have the same bug in default arguments, which I'll be looking into next. This, plus a tiny patch to fix libstdc++'s common_type, is enough for clang to parse (and, in very limited testing, support) all of libstdc++4.7's standard headers. llvm-svn: 154886
* Make sure EmitMoveFromReturnSlot is passing the correct alignment toChad Rosier2012-04-171-1/+1
| | | | | | | EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment). rdar://11220251 llvm-svn: 154883
* Typo.Eric Christopher2012-04-161-1/+1
| | | | llvm-svn: 154880
* Modern objective-c translator:'self' used insideFariborz Jahanian2012-04-161-4/+8
| | | | | | block literal is imported. // rdar://11259664 llvm-svn: 154876
* modern objective-c translator: translation of implicitFariborz Jahanian2012-04-161-15/+12
| | | | | | | cast to/from block pointer types. // rdar://11202764 Also, many more modern translator tests. llvm-svn: 154869
* [analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).Anna Zaks2012-04-161-5/+20
| | | | | | Along with it, fix a couple of other corner cases and add more tests. llvm-svn: 154866
* objective-c modern translator: buildit objc boolFariborz Jahanian2012-04-164-18/+8
| | | | | | | type for rewriter project will be BoolTy. // rdar://11231426. llvm-svn: 154861
* Remove support for -fast-math metadata for the moment.Duncan Sands2012-04-161-4/+0
| | | | llvm-svn: 154851
* Per Richard's comments on r154794, add the checks necessary to handle ↵Eli Friedman2012-04-161-2/+13
| | | | | | constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent. llvm-svn: 154849
* Revert r154749 for now at John McCall's request.Rafael Espindola2012-04-161-19/+19
| | | | llvm-svn: 154846
* Implement the last part of C++ [class.mem]p2, delaying the parsing ofDouglas Gregor2012-04-169-60/+359
| | | | | | | | | exception specifications on member functions until after the closing '}' for the containing class. This allows, for example, a member function to throw an instance of its own class. Fixes PR12564 and a fairly embarassing oversight in our C++98/03 support. llvm-svn: 154844
* Use ordering and the explicit visibility bit instead of modifyingRafael Espindola2012-04-161-44/+36
| | | | | | ConsiderGlobalVisibility. No functionality change. llvm-svn: 154843
* Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands2012-04-161-1/+6
| | | | | | up to this yet. llvm-svn: 154835
* Hexagon V5(Floating Point) support.Sirish Pande2012-04-163-157/+766
| | | | llvm-svn: 154828
* Adjust for LLVM name tweaks requested by Chandler.Duncan Sands2012-04-162-9/+9
| | | | llvm-svn: 154824
* Add another constructor to LVFlags and use it to simplify the code a bit.Rafael Espindola2012-04-161-18/+10
| | | | llvm-svn: 154814
* Implement C++11 [expr.prim.general]p3, which permits the use of 'this'Douglas Gregor2012-04-1614-80/+387
| | | | | | | | | | | | | | | | | | | | | | | in the declaration of a non-static member function after the (optional) cv-qualifier-seq, which in practice means in the exception specification and late-specified return type. The new scheme here used to manage 'this' outside of a member function scope is more general than the Scope-based mechanism previously used for non-static data member initializers and late-parsesd attributes, because it can also handle the cv-qualifiers on the member function. Note, however, that a separate pass is required for static member functions to determine whether 'this' was used, because we might not know that we have a static function until after declaration matching. Finally, this introduces name mangling for 'this' and for the implicit 'this', which is intended to match GCC's mangling. Independent verification for the new mangling test case would be appreciated. Fixes PR10036 and PR12450. llvm-svn: 154799
* Make constant evaluation for pointer comparisons work correctly for some ↵Eli Friedman2012-04-161-6/+18
| | | | | | uncommon cases. <rdar://problem/10962435>. llvm-svn: 154794
* use DEFAULT_SYSROOTSebastian Pop2012-04-163-9/+13
| | | | llvm-svn: 154792
* The result of the Microsoft __uuidof operator must be considered a global ↵Francois Pichet2012-04-161-0/+6
| | | | | | | | | | | | | lvalue during constant expression evaluation. Otherwise we would get this error in C++11 mode (because of a recent change): error: non-type template argument of type 'const _GUID *' is not a constant expression For code like: template <const GUID* g = &__uuidof(struct_with_uuid)> class COM_CLASS { }; llvm-svn: 154790
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-167-79/+93
| | | | llvm-svn: 154789
* Implement the all_lookups_iterator for PCH as a follow-up to r153970. ThisNick Lewycky2012-04-163-69/+77
| | | | | | | | | | | includes a patch from Matthias Kleine with a regression testcase! Adds a new iterator 'data_iterator' to OnDiskHashTable which doesn't try to reconstruct the external_key from the internal_key, which is useful for traits that don't store enough information to do that mapping in their key. Also deletes the 'item_iterator' from OnDiskHashTable as dead code. llvm-svn: 154784
* Change _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use ↵Craig Topper2012-04-151-2/+6
| | | | | | builtin_shufflevector instead of specific builtins. Old builtins will be removed from llvm now that vpermq/vpermpd are supported by shuffle lowering code. llvm-svn: 154777
* Correct indentationDavid Blaikie2012-04-151-22/+22
| | | | llvm-svn: 154774
* Use MDBuilder to help with metadata creation.Duncan Sands2012-04-153-43/+14
| | | | llvm-svn: 154767
* Use forward declarations for ASTDeclContextNameLookupTable and add a missing ↵Benjamin Kramer2012-04-154-11/+10
| | | | | | | | delete. It would be nice to use OwningPtr here, but DeclContextInfo is stored in a DenseMap. llvm-svn: 154763
* Actually, this tree isn't necessarily binary.Benjamin Kramer2012-04-151-2/+2
| | | | llvm-svn: 154762
* Recursively delete rewrite rope nodes when tearing down the tree.Benjamin Kramer2012-04-151-0/+5
| | | | llvm-svn: 154760
* PR12226: don't generate wrong code if a braced string literal is used toRichard Smith2012-04-154-20/+23
| | | | | | | | | initialize an array of unsigned char. Outside C++11 mode, this bug was benign, and just resulted in us emitting a constant which was double the required length, padded with 0s. In C++11, it resulted in us generating an array whose first element was something like i8 ptrtoint ([n x i8]* @str to i8). llvm-svn: 154756
* objective-c modern translator: Make metadataFariborz Jahanian2012-04-141-7/+2
| | | | | | definition for protocols static. // rdar://11248048 llvm-svn: 154753
* Consider visibility attributes last, so that they take precedence.Rafael Espindola2012-04-141-21/+21
| | | | | | I am working on a cleaner fix, but this gets the case in PR12552 passing. llvm-svn: 154749
* Replace manual delete[] with OwningArrayPtr.Benjamin Kramer2012-04-141-6/+4
| | | | llvm-svn: 154748
* Don't leak vtable thunks.Benjamin Kramer2012-04-141-0/+1
| | | | llvm-svn: 154747
* Delete late parsed attributes instead of leaking them.Benjamin Kramer2012-04-141-0/+1
| | | | llvm-svn: 154746
* Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'mDuncan Sands2012-04-141-2/+1
| | | | | | | | | thinking of generalizing it to be able to specify other freedoms beyond accuracy (such as that NaN's don't have to be respected). I'd like the 3.1 release (the first one with this metadata) to have the more generic name already rather than having to auto-upgrade it in 3.2. llvm-svn: 154745
* Parser: Don't manage TemplateAnnotationIds in a delayed cleanup pool.Benjamin Kramer2012-04-143-6/+26
| | | | | | | | | | Instead, make it the allocation function's responsibility to add them to a list and clear it when a top-level decl is finished. This plugs leakage of TemplateAnnotationIds. DelayedCleanupPool is ugly and unused, remove it. llvm-svn: 154743
* ASTUnit: Don't clone the new DiagnosticConsumer, causing it to get leaked.Benjamin Kramer2012-04-141-2/+4
| | | | llvm-svn: 154739
* Directly store TypoResultsMaps in the TypoEditDistanceMap, getting rid of ↵Benjamin Kramer2012-04-141-27/+15
| | | | | | manual deletion. llvm-svn: 154736
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-1417-108/+235
| | | | | | | | | attached. Since we do not support any attributes which appertain to a statement (yet), testing of this is necessarily quite minimal. Patch by Alexander Kornienko! llvm-svn: 154723
* Delete the TypoResultsMap when erasing the pointer to it.Benjamin Kramer2012-04-131-7/+6
| | | | | | | This manual deleting is error-prone, but we can't just put an OwningPtr in a std::map :( llvm-svn: 154707
* Don't enter cleanups for unreachable variables. It's impossible toJohn McCall2012-04-132-0/+6
| | | | | | | | jump into these scopes, and the cleanup-entering code sometimes wants to do some operations first (e.g. a GEP), which can leave us with unparented IR. llvm-svn: 154684
* modern objective-c translator: Fixes translation ofFariborz Jahanian2012-04-131-1/+4
| | | | | | | __typeof which is a regression by reverting r154360. // rdar://11233924 llvm-svn: 154679
* Avoid string thrashing when we can concatenate them in the final buffer.Benjamin Kramer2012-04-131-8/+8
| | | | llvm-svn: 154678
* Serialize and deserialize some missing bits from BlockDecl.John McCall2012-04-132-0/+7
| | | | llvm-svn: 154676
* Remove the unused, unmaintained, incomplete 'Index' library.Douglas Gregor2012-04-1322-1798/+3
| | | | llvm-svn: 154672
* modern objective-c translator: When translatingFariborz Jahanian2012-04-131-37/+23
| | | | | | | | call to 'super' use __rw_objc_super as type of the 'super' meta-data instead of objc_super. // rdar://11239894 llvm-svn: 154670
* Make control flow more explicit for rebuilding property reference ↵Douglas Gregor2012-04-131-7/+7
| | | | | | expressions without their OpaqueValueExprs llvm-svn: 154669
* Remove the -cc1-level option "-pubnames-dump". Such things should stayDouglas Gregor2012-04-133-76/+0
| | | | | | out of the tree and use the tooling infrastructure. llvm-svn: 154668
* super and class property reference expressions don't need to beDouglas Gregor2012-04-131-2/+7
| | | | | | rebuilt. Fixes <rdar://problem/11052352>. llvm-svn: 154667
OpenPOWER on IntegriCloud