summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
...
* When binding a reference to an Automatic Reference Counting temporary,Douglas Gregor2011-06-221-0/+30
| | | | | | | | | retain/release the temporary object appropriately. Previously, we would only perform the retain/release operations when the reference would extend the lifetime of the temporary, but this does the wrong thing across calls. llvm-svn: 133620
* Only do config-time substitution of LLVM_BUILD_MODE inAndrew Trick2011-06-221-1/+6
| | | | | | test/lit.site.cfg, not Unit/test/lit.site.cfg. llvm-svn: 133609
* Emit @finally blocks completely lazily instead of forcing theirJohn McCall2011-06-221-1/+15
| | | | | | | | | | | | | existence by always threading an edge from the catchall. Not doing this was previously causing a crash in the very extreme case where neither the normal cleanup nor the EH catchall was actually reachable: we would delete the catchall entry block, which would cause us to delete the entry block of the finally cleanup as well because the cleanup logic would merge the blocks, which in turn triggered an assert because later blocks in the finally would still be using values from the entry. Laziness turns out to be the most elegant solution to the problem. llvm-svn: 133601
* It is possible to request the nonfragile ABI with -fobjc-abi-version=2;John McCall2011-06-221-0/+2
| | | | | | | respect that when deciding whether -objc-exceptions implies the -fexceptions -cc1 option. llvm-svn: 133590
* Fix PR10168: don't warn for unused non-dependent variables in both the ↵Richard Smith2011-06-212-3/+28
| | | | | | template definition and each instantiation. llvm-svn: 133580
* First part of PR9968: the __range variable in a dependent C++11 for-range ↵Richard Smith2011-06-211-0/+22
| | | | | | statement is implicitly used by that statement. llvm-svn: 133572
* Fix the mangling of dependent-scope decl ref expressions so that theyJohn McCall2011-06-212-7/+7
| | | | | | use the unresolved-name production correctly. llvm-svn: 133554
* Driver/Darwin: Fixup version check for -object_path_lto support.Daniel Dunbar2011-06-211-1/+1
| | | | llvm-svn: 133548
* Driver/Darwin: When invoking the linker, automatically pass -object_path_lto soDaniel Dunbar2011-06-211-0/+8
| | | | | | | | | that the linker has a place to put the temporary object file and can leave it around (for the driver to clean up). This is important so that the object file references in the debug info are preserved for possible use by dsymutil. - <rdar://problem/8294279> executable has no debug symbols when compiled with LTO llvm-svn: 133543
* objc-arc: Add support for unbridged cast of Fariborz Jahanian2011-06-211-0/+10
| | | | | | | | __builtin___CFStringMakeConstantString and CF typed function calls with explicit cf_returns_retained/cf_returns_not_retained attributes. // rdar://9544832 llvm-svn: 133535
* objc-arc: CodeGen part of unbridged cast of CF types.Fariborz Jahanian2011-06-211-0/+27
| | | | | | // rdar://9474349 llvm-svn: 133525
* Fix a crash when a pointer-to-member function is called in the conditionChandler Carruth2011-06-211-0/+14
| | | | | | | expression of '?:'. Add a test case for this pattern, and also test the code that led to the crash in a "working" case as well. llvm-svn: 133523
* Introduce a new AST node describing reference binding to temporaries.Douglas Gregor2011-06-211-0/+28
| | | | | | | | | | | | | | | | | | | | | | | | | MaterializeTemporaryExpr captures a reference binding to a temporary value, making explicit that the temporary value (a prvalue) needs to be materialized into memory so that its address can be used. The intended AST invariant here is that a reference will always bind to a glvalue, and MaterializeTemporaryExpr will be used to convert prvalues into glvalues for that binding to happen. For example, given const int& r = 1.0; The initializer of "r" will be a MaterializeTemporaryExpr whose subexpression is an implicit conversion from the double literal "1.0" to an integer value. IR generation benefits most from this new node, since it was previously guessing (badly) when to materialize temporaries for the purposes of reference binding. There are likely more refactoring and cleanups we could perform there, but the introduction of MaterializeTemporaryExpr fixes PR9565, a case where IR generation would effectively bind a const reference directly to a bitfield in a struct. Addresses <rdar://problem/9552231>. llvm-svn: 133521
* Also fix the warning about using "clang" instead of %clang.Nick Lewycky2011-06-211-1/+1
| | | | llvm-svn: 133492
* Remove the leading hyphen so that grep doesn't parse it as one long option :)Nick Lewycky2011-06-211-1/+1
| | | | llvm-svn: 133491
* Driver/Darwin: Honor -Xarch_FOO when the arch matches either the toolchain orDaniel Dunbar2011-06-211-0/+6
| | | | | | | the architecture being bound. - Fixes things like -Xarch_armv7. llvm-svn: 133490
* Add support for -Wa,--noexecstack when building from a non-assembly file. ForNick Lewycky2011-06-211-0/+1
| | | | | | | an assembly file it worked correctly, while for a .c file it would given an error about how --noexecstack is not a supported argument to -Wa. llvm-svn: 133489
* Canonicalize register names properly.Eric Christopher2011-06-211-0/+9
| | | | | | Fixes rdar://9425559 llvm-svn: 133486
* Move additional register names to their own lookup, separate fromEric Christopher2011-06-211-2/+1
| | | | | | | | register aliases. Fixes unnecessary renames of clobbers. Fixes part of rdar://9425559 llvm-svn: 133485
* [arcmt] Always add '__bridge' cast when 'self' is cast to a C pointer. ↵Argyrios Kyrtzidis2011-06-202-4/+16
| | | | | | rdar://9644061 llvm-svn: 133480
* [analyzer] Finish size argument checking for strncat (and strncpy).Jordy Rose2011-06-201-4/+61
| | | | llvm-svn: 133472
* objc-arc: allow explicit unbridged casts if the source of the cast is aFariborz Jahanian2011-06-201-0/+18
| | | | | | | message sent to an objc method (or property access) // rdar://9474349 llvm-svn: 133469
* Warn for un-parenthesized '&' inside '|' (a & b | c), rdar://9553326.Argyrios Kyrtzidis2011-06-201-0/+6
| | | | | | Patch by Henry Mason with tweaks by me. llvm-svn: 133453
* llvm-gcc treats a tentative definition with a previousFariborz Jahanian2011-06-201-0/+26
| | | | | | | | | (or follow up) extern declaration with weak_import as an actual definition. make clang follows this behavior. // rdar://9538608 llvm-gcc treats an extern declaration with weak_import llvm-svn: 133450
* Define __cplusplus to 201103L when in (non-GNU) C++0x mode.Douglas Gregor2011-06-201-1/+1
| | | | llvm-svn: 133437
* Use an explicitly 64-bit triple flag to ensure we can easily verify theChandler Carruth2011-06-201-1/+1
| | | | | | | | | | types printed in various diagnostics. We could omit checking for the types, but that can mask errors where the wrong type is streamed into the diagnostic. There was at least one of these caught by this test already. llvm-svn: 133429
* Fix a problem with the diagnostics of invalid arithmetic with functionChandler Carruth2011-06-202-2/+3
| | | | | | | | pointers I found while working on the NULL arithmetic warning. We here always assuming the LHS was the pointer, instead of using the selected pointer expression. llvm-svn: 133428
* Move away from the poor "abstraction" I added to Type. John arguedChandler Carruth2011-06-201-8/+20
| | | | | | | | | | | | | | effectively that this abstraction simply doesn't exist. That is highlighted by the fact that by using it we were papering over a more serious error in this warning: the fact that we warned for *invalid* constructs involving member pointers and block pointers. I've fixed the obvious issues with the warning here, but this is confirming an original suspicion that this warning's implementation is flawed. I'm looking into how we can implement this more reasonably. WIP on that front. llvm-svn: 133425
* Update to match mainline ConstantStruct::get API change. Also, use Chris Lattner2011-06-205-11/+11
| | | | | | | | | | | ConvertType on InitListExprs as they are being converted. This is needed for a forthcoming patch, and improves the IR generated anyway (see additional type names in testcases). This patch also converts a bunch of std::vector's in CGObjCMac to use C arrays. There are a ton more that should be converted as well. llvm-svn: 133413
* [analyzer] Re-enable checking for strncpy, along with a new validation of ↵Jordy Rose2011-06-201-0/+99
| | | | | | the size argument. strncat is not yet up-to-date, but I'm leaving it enabled for now (there shouldn't be any false positives, at least...) llvm-svn: 133408
* [analyzer] Eliminate "byte string function" from CStringChecker's ↵Jordy Rose2011-06-202-46/+46
| | | | | | diagnostics, and make it easier to provide custom messages for overflow checking, in preparation for re-enabling strncpy checking. llvm-svn: 133406
* Add test cases for false positives on -Wnull-arithmetic from RichardChandler Carruth2011-06-192-3/+22
| | | | | | | | | | | | | Trieu, and fix them by checking for array and function types as well as pointer types. I've added a predicate method on Type to bundle together the logic we're using here: isPointerLikeType(). I'd welcome better names for this predicate, this is the best I came up with. It's implemented as a switch to be a touch lighter weight than all the chained isa<...> casts that would result otherwise. llvm-svn: 133383
* Handle decltype keyword in Parser::isDeclarationSpecifier.Francois Pichet2011-06-191-0/+5
| | | | | | Fixes PR10154. Found by parsing MFC 2010 code with clang. llvm-svn: 133380
* Accept no-return stripping conversions for pointer type arguments afterChandler Carruth2011-06-181-1/+15
| | | | | | | | | | | | | | | | | | | deducing template parameter types. Recently Clang began enforcing the more strict checking that the argument type and the deduced function parameter type (after substitution) match, but that only consideres qualification conversions. One problem with this patch is that we check noreturn conversions and qualification conversions independently. If a valid conversion would require *both*, perhaps interleaved with each other, it will be rejected. If this actually occurs (I'm not yet sure it does) and is in fact a problem (I'm not yet sure it is), there is a FIXME to implement more intelligent conversion checking. However, this step at least allows Clang to resume accepting valid code we're seeing in the wild. llvm-svn: 133327
* [arcmt] Fix the ARC migrator. -arcmt-modify requires running before the ↵Argyrios Kyrtzidis2011-06-187-5/+134
| | | | | | | | initialization of SourceManager because it is going to modify the input file. llvm-svn: 133323
* Fix regression with @encode string. rdar://9624314.Argyrios Kyrtzidis2011-06-171-0/+14
| | | | llvm-svn: 133312
* Objective-C++ ARC: eliminate the utterly unjustified loophole thatDouglas Gregor2011-06-171-0/+10
| | | | | | | | | | | silently dropped ownership qualifiers that were being applied to ownership-qualified, substituted type that was *not* a substituted template type parameter. We now provide a diagnostic in such cases, and recover by dropping the added qualifiers. Document this behavior in the ARC specification. llvm-svn: 133309
* Objective-C++ ARC: do not mangle __unsafe_unretained lifetimeDouglas Gregor2011-06-171-2/+2
| | | | | | | | | | qualifiers, so that an __unsafe_unretained-qualified type T in ARC code will have the same mangling as T in non-ARC code, improving ABI interoperability. This works now because we infer or require a lifetime qualifier everywhere one can appear in an external interface. Another part of <rdar://problem/9595486>. llvm-svn: 133306
* Objective-ARC++: infer template type arguments ofDouglas Gregor2011-06-171-7/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | ownership-unqualified retainable object type as __strong. This allows us to write, e.g., std::vector<id> and we'll infer that the vector's element types have __strong ownership semantics, which is far nicer than requiring: std::vector<__strong id> Note that we allow one to override the ownership qualifier of a substituted template type parameter, e.g., given template<typename T> struct X { typedef __weak T type; }; X<id> is treated the same as X<__strong id>. At instantiation type, the __weak in "__weak T" overrides the (inferred or specified) __strong on the template argument type, so that we can still provide metaprogramming transformations. This is part of <rdar://problem/9595486>. llvm-svn: 133303
* Only accept __bridge_retain in system headers, as Doug suggested.John McCall2011-06-173-1/+13
| | | | llvm-svn: 133300
* As a hopefully temporary workaround for a header mistake, treatJohn McCall2011-06-171-1/+4
| | | | | | __bridge_retain as a synonym for __bridge_retained. llvm-svn: 133295
* Put the new warning from revision 133196 on NULL arithmetic behind the flag ↵Richard Trieu2011-06-172-2/+2
| | | | | | -Wnull-arthimetic and set to DefaultIgnore. A few edge cases need to be worked out before this can be set to default. llvm-svn: 133287
* Don't emit 'unavailable' errors inside an unavailable function. rdar://9623855.Argyrios Kyrtzidis2011-06-171-0/+10
| | | | llvm-svn: 133264
* Loosen up the IR matching slightlyDouglas Gregor2011-06-171-1/+1
| | | | llvm-svn: 133263
* Remove another variable.Eric Christopher2011-06-171-1/+1
| | | | llvm-svn: 133262
* When emitting a compound literal of POD type, continue to emit aDouglas Gregor2011-06-171-2/+23
| | | | | | | | | | | | | | | | | separate aggregate temporary and then memcpy it over to the destination. This fixes a regression I introduced with r133235, where the compound literal on the RHS of an assignment makes use of the structure on the LHS of the assignment. I'm deeply suspicious of AggExprEmitter::VisitBinAssign()'s optimization where it emits the RHS of an aggregate assignment directly into the LHS lvalue without checking whether there is any aliasing between the LHS/RHS. However, I'm not in a position to revisit this now. Big thanks to Eli for finding the regression! llvm-svn: 133261
* Perform an acquire memory barrier on the fast path of a thread-safeJohn McCall2011-06-171-0/+3
| | | | | | static initializer check, as required by the Itanium ABI. llvm-svn: 133250
* Objective-C fast enumeration loop variables are not retained in ARC, butJohn McCall2011-06-172-19/+64
| | | | | | | | | | | | they should still be officially __strong for the purposes of errors, block capture, etc. Make a new bit on variables, isARCPseudoStrong(), and set this for 'self' and these enumeration-loop variables. Change the code that was looking for the old patterns to look for this bit, and change IR generation to find this bit and treat the resulting variable as __unsafe_unretained for the purposes of init/destroy in the two places it can come up. llvm-svn: 133243
* Clean up test to avoid using standard headers and remove an unneededEric Christopher2011-06-171-6/+2
| | | | | | #define. llvm-svn: 133241
* Extend the deduced/actual argument type checking of C++Douglas Gregor2011-06-171-2/+1
| | | | | | | [temp.deduct.call]p4 to the deduction performed for 'auto', finishing the fix for PR9233. llvm-svn: 133239
OpenPOWER on IntegriCloud