summaryrefslogtreecommitdiffstats
path: root/test
Commit message (Collapse)AuthorAgeFilesLines
* objective-c modern translation. Correct rewriting ofFariborz Jahanian2012-04-171-0/+45
| | | | | | | | | block meta-data of block literals declared inside of extern "C" functions. // rdar://1131490 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154939 91177308-0d34-0410-b5e6-96231b3b80d8
* Emulate a MSVC bug where the creation of pointer-to-member to protected ↵Francois Pichet2012-04-171-1/+26
| | | | | | | | | member of base class is allowed but only from a static function. This fixes a regression when parsing MFC code with clang. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154924 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert vperm2f128 and vperm2i128 intrinsics back to using llvm intrinsics. ↵Craig Topper2012-04-173-4/+7
| | | | | | Unfortunately, these instructions have behavior that can't be modeled with shuffle vector. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154906 91177308-0d34-0410-b5e6-96231b3b80d8
* Attempt to fix test.Eli Friedman2012-04-171-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154897 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement DR1330 in C++11 mode, to support libstdc++4.7 which uses it.Richard Smith2012-04-174-2/+137
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154886 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure EmitMoveFromReturnSlot is passing the correct alignment toChad Rosier2012-04-171-0/+8
| | | | | | | | EmitFinalDestCopy (and thus pass EmitAggregateCopy the correct alignment). rdar://11220251 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154883 91177308-0d34-0410-b5e6-96231b3b80d8
* Modern objective-c translator:'self' used insideFariborz Jahanian2012-04-161-0/+3
| | | | | | | block literal is imported. // rdar://11259664 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154876 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Make sure that when we have multiple @class references in the ↵Argyrios Kyrtzidis2012-04-161-0/+7
| | | | | | | | | | | | | | | same line, that later ones do not override the previous ones. If we have: @class Foo, Bar; source ranges for both start at '@', so 'Bar' will end up overriding 'Foo' even though the cursor location was at 'Foo'. rdar://11257578 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154873 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator: translation of implicitFariborz Jahanian2012-04-1614-8/+35
| | | | | | | | cast to/from block pointer types. // rdar://11202764 Also, many more modern translator tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154869 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Fix a false alarm in SelfInitChecker (radar://11235991).Anna Zaks2012-04-161-4/+57
| | | | | | Along with it, fix a couple of other corner cases and add more tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154866 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Fixup for a test case.Anna Zaks2012-04-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154864 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c modern translator: buildit objc boolFariborz Jahanian2012-04-166-16/+16
| | | | | | | | type for rewriter project will be BoolTy. // rdar://11231426. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154861 91177308-0d34-0410-b5e6-96231b3b80d8
* [libclang] Spelling range for a objc category should the category name ↵Argyrios Kyrtzidis2012-04-161-0/+10
| | | | | | | | range, not the class one. rdar://11249386 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154853 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove support for -fast-math metadata for the moment.Duncan Sands2012-04-161-8/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154851 91177308-0d34-0410-b5e6-96231b3b80d8
* Per Richard's comments on r154794, add the checks necessary to handle ↵Eli Friedman2012-04-161-0/+6
| | | | | | constant-folding relational comparisons safely in case the user is using -fwrapv or equivalent. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154849 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r154749 for now at John McCall's request.Rafael Espindola2012-04-161-12/+0
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154846 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the last part of C++ [class.mem]p2, delaying the parsing ofDouglas Gregor2012-04-165-10/+41
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154844 91177308-0d34-0410-b5e6-96231b3b80d8
* Generate fpmath metadata when -ffast-math. Note that no optimizations are hookedDuncan Sands2012-04-161-0/+8
| | | | | | | up to this yet. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154835 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement C++11 [expr.prim.general]p3, which permits the use of 'this'Douglas Gregor2012-04-163-1/+111
| | | | | | | | | | | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154799 91177308-0d34-0410-b5e6-96231b3b80d8
* Make constant evaluation for pointer comparisons work correctly for some ↵Eli Friedman2012-04-162-0/+11
| | | | | | uncommon cases. <rdar://problem/10962435>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154794 91177308-0d34-0410-b5e6-96231b3b80d8
* The result of the Microsoft __uuidof operator must be considered a global ↵Francois Pichet2012-04-161-2/+2
| | | | | | | | | | | | | | 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 { }; git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154790 91177308-0d34-0410-b5e6-96231b3b80d8
* Propagate alignment on lvalues through EmitLValueForField. PR12395.Eli Friedman2012-04-161-1/+9
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154789 91177308-0d34-0410-b5e6-96231b3b80d8
* Add 'env' in hopes of making this test pass on Windows.Nick Lewycky2012-04-161-1/+1
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154785 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the all_lookups_iterator for PCH as a follow-up to r153970. ThisNick Lewycky2012-04-163-0/+21
| | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154784 91177308-0d34-0410-b5e6-96231b3b80d8
* Change _mm256_permute4x64_epi64 and _mm256_permute4x64_pd to use ↵Craig Topper2012-04-151-2/+2
| | | | | | builtin_shufflevector instead of specific builtins. Old builtins will be removed from llvm now that vpermq/vpermpd are supported by shuffle lowering code. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154777 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix tests that weren't actually verifying anything.David Blaikie2012-04-156-9/+9
| | | | | | | | | | | | | | Passing -verify to clang without -cc1 or -Xclang silently passes (with a printed warning, but lit doesn't care about that). This change adds -cc1 or, as is necessary in one case, -Xclang to fix this so that these tests are actually verifying as intended. I'd like to change the driver so this kind of mistake could not be made, but I'm not entirely sure how. Further, since the driver only warns about unknown flags in general, we could have similar bugs with a misspellings of arguments that would be nice to find. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154776 91177308-0d34-0410-b5e6-96231b3b80d8
* Use MDBuilder to help with metadata creation.Duncan Sands2012-04-152-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154767 91177308-0d34-0410-b5e6-96231b3b80d8
* %clang -cc1 -> %clang_cc1Seth Cantrell2012-04-152-2/+2
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154757 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12226: don't generate wrong code if a braced string literal is used toRichard Smith2012-04-153-0/+9
| | | | | | | | | | 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). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154756 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c modern translator: Make metadataFariborz Jahanian2012-04-141-0/+14
| | | | | | | | definition for protocols static. // rdar://11248048 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154753 91177308-0d34-0410-b5e6-96231b3b80d8
* Consider visibility attributes last, so that they take precedence.Rafael Espindola2012-04-141-0/+12
| | | | | | I am working on a cleaner fix, but this gets the case in PR12552 passing. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154749 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename "fpaccuracy" metadata to the more generic "fpmath". That's because I'mDuncan Sands2012-04-141-3/+3
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154745 91177308-0d34-0410-b5e6-96231b3b80d8
* Add an AttributedStmt type to represent a statement with C++11 attributesRichard Smith2012-04-142-3/+59
| | | | | | | | | | 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! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154723 91177308-0d34-0410-b5e6-96231b3b80d8
* Don't enter cleanups for unreachable variables. It's impossible toJohn McCall2012-04-131-0/+10
| | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154684 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator: Fixes translation ofFariborz Jahanian2012-04-132-0/+47
| | | | | | | | __typeof which is a regression by reverting r154360. // rdar://11233924 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154679 91177308-0d34-0410-b5e6-96231b3b80d8
* modern objective-c translator: When translatingFariborz Jahanian2012-04-131-0/+23
| | | | | | | | | call to 'super' use __rw_objc_super as type of the 'super' meta-data instead of objc_super. // rdar://11239894 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154670 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove the -cc1-level option "-pubnames-dump". Such things should stayDouglas Gregor2012-04-131-19/+0
| | | | | | | out of the tree and use the tooling infrastructure. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154668 91177308-0d34-0410-b5e6-96231b3b80d8
* super and class property reference expressions don't need to beDouglas Gregor2012-04-131-0/+15
| | | | | | | | rebuilt. Fixes <rdar://problem/11052352>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154667 91177308-0d34-0410-b5e6-96231b3b80d8
* First set of tests for ARM homogenous aggregates. C only. C++ will follow.Anton Korobeynikov2012-04-131-0/+158
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154666 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement __atomic_fetch_nand and __atomic_nand_fetch to complete our set ofRichard Smith2012-04-131-0/+15
| | | | | | | GNU __atomic builtins. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154659 91177308-0d34-0410-b5e6-96231b3b80d8
* PR12500: Improve the wording of the diagnostic for a redefinition of a nameRichard Smith2012-04-134-8/+8
| | | | | | | in the wrong namespace scope. Patch by Jonathan Sauer! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154656 91177308-0d34-0410-b5e6-96231b3b80d8
* Support -Wc++98-compat-pedantic as requested:Seth Cantrell2012-04-131-0/+4
| | | | | | http://lists.cs.uiuc.edu/pipermail/cfe-commits/Week-of-Mon-20120409/056126.html git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154655 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a trivial oversight with apple-kext static local destructorsJohn McCall2012-04-131-0/+22
| | | | | | and add a test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154653 91177308-0d34-0410-b5e6-96231b3b80d8
* When we're flagging a protected scope to prevent jumps into theJohn McCall2012-04-132-0/+23
| | | | | | | | shadow of a block expression with non-trivial destructed cleanups, we should flag that in the enclosing function, not in the block that we're about to pop. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154646 91177308-0d34-0410-b5e6-96231b3b80d8
* C++11 no longer requires files to end with a newlineSeth Cantrell2012-04-132-2/+6
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154643 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement the missing pieces needed to support libstdc++4.7's <atomic>:Richard Smith2012-04-132-13/+127
| | | | | | | | | | | | | | | | | | | | | | | | | __atomic_test_and_set, __atomic_clear, plus a pile of undocumented __GCC_* predefined macros. Implement library fallback for __atomic_is_lock_free and __c11_atomic_is_lock_free, and implement __atomic_always_lock_free. Contrary to their documentation, GCC's __atomic_fetch_add family don't multiply the operand by sizeof(T) when operating on a pointer type. libstdc++ relies on this quirk. Remove this handling for all but the __c11_atomic_fetch_add and __c11_atomic_fetch_sub builtins. Contrary to their documentation, __atomic_test_and_set and __atomic_clear take a first argument of type 'volatile void *', not 'void *' or 'bool *', and __atomic_is_lock_free and __atomic_always_lock_free have an argument of type 'const volatile void *', not 'void *'. With this change, libstdc++4.7's <atomic> passes libc++'s atomic test suite, except for a couple of libstdc++ bugs and some cases where libc++'s test suite tests for properties which implementations have latitude to vary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154640 91177308-0d34-0410-b5e6-96231b3b80d8
* Warn on 64-to-32 for source value of x bits where 64 >= x > 32.David Blaikie2012-04-121-0/+4
| | | | | | | | | The codepath already only works for source bits > target bits, it's just that it was testing for the source expr bits to be exactly 64. This meant simple cases (int i = x_long / 2) were missed & ended up under the general -Wconversion warning, which a user might not have enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154626 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] PCH deserialization optimization.Anna Zaks2012-04-122-0/+37
| | | | | | | | | | | | | | | | We should not deserialize unused declarations from the PCH file. Achieve this by storing the top level declarations during parsing (HandleTopLevelDecl ASTConsumer callback) and analyzing/building a call graph only for those. Tested the patch on a sample ObjC file that uses PCH. With the patch, the analyzes is 17.5% faster and clang consumes 40% less memory. Got about 10% overall build/analyzes time decrease on a large Objective C project. A bit of CallGraph refactoring/cleanup as well.. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154625 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Test case for r154451 (redefining system functions).Anna Zaks2012-04-121-0/+17
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154624 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c literals: Issue warning and ignoreFariborz Jahanian2012-04-121-0/+7
| | | | | | | | when BOOL is not of an intergal type when boolean literals are used. // rdar://11231426 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@154619 91177308-0d34-0410-b5e6-96231b3b80d8