summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* [arcmt] Make arcmt-test accept cc1 options to make it more portable and ↵Argyrios Kyrtzidis2011-06-1635-53/+37
| | | | | | hopefully fix MSVC failures. llvm-svn: 133119
* Give this test a triple; I don't think we want to #define __unsafe_unretainedJohn McCall2011-06-161-1/+1
| | | | | | on all platforms in non-ARC mode. llvm-svn: 133114
* The ARC Migration Tool. All the credit goes to Argyrios and FariborzJohn McCall2011-06-1542-0/+2003
| | | | | | for this. llvm-svn: 133104
* Automatic Reference Counting.John McCall2011-06-1570-20/+5134
| | | | | | | | | | Language-design credit goes to a lot of people, but I particularly want to single out Blaine Garst and Patrick Beard for their contributions. Compiler implementation credit goes to Argyrios, Doug, Fariborz, and myself, in no particular order. llvm-svn: 133103
* Test for r133070.Eli Friedman2011-06-151-0/+4
| | | | llvm-svn: 133079
* Fix a couple more tests with ARM ABI.Eli Friedman2011-06-152-2/+2
| | | | llvm-svn: 133073
* Fix a regression from r132957 involving complex integers. (Fixes failures ↵Eli Friedman2011-06-151-0/+10
| | | | | | on gcc-testsuite bot.) llvm-svn: 133069
* Eliminate a 'default' case in template argument deduction, where weDouglas Gregor2011-06-151-0/+34
| | | | | | | | | | | | | | | | | | were just punting on template argument deduction for a number of type nodes. Most of them, obviously, didn't matter. As a consequence of this, make extended vector types (via the ext_vector_type attribute) actually work properly for several important cases: - If the attribute appears in a type-id (i.e, not attached to a typedef), actually build a proper vector type - Build ExtVectorType whenever the size is constant; previously, we were building DependentSizedExtVectorType when the size was constant but the type was dependent, which makes no sense at all. - Teach template argument deduction to handle ExtVectorType/DependentSizedExtVectorType. llvm-svn: 133060
* When performing substitution of default template template parametersDouglas Gregor2011-06-151-0/+15
| | | | | | | | | | before the template parameters have acquired a proper context (e.g., because the enclosing context has yet to be built), provide empty parameter lists for all outer template parameter scopes to inhibit any substitution for those template parameters. Fixes PR9643 / <rdar://problem/9251019>. llvm-svn: 133055
* [analyzer] Revise CStringChecker's modelling of strcpy() and strcat():Jordy Rose2011-06-151-6/+31
| | | | | | | | | | | | | | | - (bounded copies) Be more conservative about how much is being copied. - (str(n)cat) If we can't compute the exact final length of an append operation, we can still lower-bound it. - (stpcpy) Fix the conjured return value at the end to actually be returned. This requires these supporting changes: - C string metadata symbols are still live even when buried in a SymExpr. - "Hypothetical" C string lengths, to represent a value that /will/ be passed to setCStringLength() if all goes well. (The idea is to allow for temporary constrainable symbols that may end up becoming permanent.) - The 'checkAdditionOverflow' helper makes sure that the two strings being appended in a strcat don't overflow size_t. This should never *actually* happen; the real effect is to keep the final string length from "wrapping around" in the constraint manager. This doesn't actually test the "bounded" operations (strncpy and strncat) because they can leave strings unterminated. Next on the list! llvm-svn: 133046
* Don't add redundant FormatAttr, ConstAttr, or NoThrowAttr attributes,Douglas Gregor2011-06-151-0/+5
| | | | | | | either imlicitly (for builtins) or explicitly (due to multiple specification of the same attributes). Fixes <rdar://problem/9612060>. llvm-svn: 133045
* Build fix attempt.Nico Weber2011-06-151-1/+1
| | | | llvm-svn: 133039
* Properly implement C++0x [stmt.dcl]p3, which requires a scope to beDouglas Gregor2011-06-151-4/+4
| | | | | | | protected in the case where a variable is being initialized by a trivial default constructor but has a non-trivial destructor. llvm-svn: 133037
* Warn on "void f(int a[10]) { sizeof(a); }"Nico Weber2011-06-151-0/+30
| | | | llvm-svn: 133036
* Sema: show shift result in hexadecimalTed Kremenek2011-06-151-1/+1
| | | | | | | | | | | | | | | | | Change the output for -Wshift-overflow and -Wshift-sign-overflow to an unsigned hexadecimal. It makes more sense for looking at bits than a signed decimal does. Also, change the diagnostic's wording from "overrides" to "sets". This uses a new optional argument in APInt::toString() that adds the '0x' prefix to hexademical numbers. This fixes PR 9651. Patch by nobled@dreamwidth.org! llvm-svn: 133033
* Introduce a -cc1-level option to turn off related result typeDouglas Gregor2011-06-141-1/+1
| | | | | | inference, to be used (only) by the Objective-C rewriter. llvm-svn: 133025
* [format strings] correctly suggest correct type for '%@' specifiers. Fixes ↵Ted Kremenek2011-06-141-0/+1
| | | | | | <rdar://problem/9607158>. llvm-svn: 133024
* Bad table discription of fromat-y2k causes Fariborz Jahanian2011-06-141-0/+9
| | | | | | | no-format-y2k turn off -Wformat altogether. // rdar://9504680 llvm-svn: 133015
* Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch ↵Eli Friedman2011-06-1410-50/+54
| | | | | | 2 of 3. llvm-svn: 133011
* revert r133003 and fix the bug properly: the issue was that ## in a tokenChris Lattner2011-06-142-9/+11
| | | | | | | | | | lexer is not a paste operator, it is a normal token. This fixes a conformance issue shown here: http://p99.gforge.inria.fr/c99-conformance/c99-conformance-clang-2.9.html and it defines away the crash from before. llvm-svn: 133005
* Fix a crash on the testcase in PR9981 / rdar://9486765.Chris Lattner2011-06-141-0/+6
| | | | llvm-svn: 133003
* When profiling FunctionProtoTypes, don't canonicalize the expressionDouglas Gregor2011-06-141-0/+53
| | | | | | | | | | in a noexcept exception specification because it isn't part of the canonical type. This ensures that we keep the exact expression written in the noexcept exception specification, rather than accidentally "adopting" a previously-written and canonically "equivalent" function prototype. Fixes PR10087. llvm-svn: 132998
* Warn on memset(ptr, 0, sizeof(ptr)). Diagnostic wording by Jordy Rose.Nico Weber2011-06-141-0/+97
| | | | llvm-svn: 132996
* Hyphenate "argument-dependent".Jay Foad2011-06-143-8/+8
| | | | llvm-svn: 132989
* when compiling in a GNU mode (e.g. gnu99) treat VLAs with a size that can be ↵Chris Lattner2011-06-146-6/+15
| | | | | | | | | | folded to a constant as constant size arrays. This has slightly different semantics in some insane cases, but allows us to accept some constructs that GCC does. Continue to be pedantic in -std=c99 and other modes. This addressed rdar://8733881 - error "variable-sized object may not be initialized"; g++ accepts same code llvm-svn: 132983
* fix rdar://9204520 - Accept int(0.85 * 10) as an initializer in a class memberChris Lattner2011-06-141-0/+13
| | | | | | as an extension. llvm-svn: 132980
* Properly diagnose using abstract and incomplete types in va_argDavid Majnemer2011-06-143-9/+24
| | | | | | | - Move a test from test/SemaTemplate/instantiate-expr-3.cpp, it did not belong there - Incomplete and abstract types are considered hard errors llvm-svn: 132979
* fix rdar://9546171 - -Wshorten-64-to-32 shouldn't warn on vector bitcasts.Chris Lattner2011-06-141-0/+10
| | | | llvm-svn: 132975
* [analyzer] CStringChecker checks functions in the C standard library, not ↵Jordy Rose2011-06-143-10/+10
| | | | | | C++. Its external name is now unix.experimental.CString. llvm-svn: 132958
* The LLVM IR representation of byval arguments has a rather strange property: ↵Eli Friedman2011-06-141-0/+33
| | | | | | | | | | if the alignment of an argument to a call is less than the specified byval alignment for that argument, there is no way to specify the alignment of the implied copy. Therefore, we must ensure that the alignment of the argument is at least the byval alignment. To do this, we have to mess with the alignment of relevant alloca's in some cases, and insert a copy that conceptually shouldn't be necessary in some cases. This patch tries relatively hard to avoid creating an extra copy if it can be avoided (see test3 in the included testcase), but it is not possible to avoid in some cases (like test2 in the included testcase). rdar://9483886 llvm-svn: 132957
* [analyzer] Fix modeling of strnlen to be more conservative. Move tests we ↵Jordy Rose2011-06-142-54/+150
| | | | | | can't properly model (yet?) to string-fail.c. llvm-svn: 132955
* Make __gnu_inline__ functions in gnu99 mode work the same way as inline ↵Eli Friedman2011-06-132-17/+25
| | | | | | | | functions in gnu89 mode in terms of redefinitions. rdar://9559708 . llvm-svn: 132953
* Remote this unreliable test case because it did not do its job.Devang Patel2011-06-131-20/+0
| | | | llvm-svn: 132948
* Whack a bunch of tests in CodeGenCXX to work on ARM (using ARM ABI). Batch ↵Eli Friedman2011-06-138-32/+32
| | | | | | 1 of 3 or so. llvm-svn: 132945
* Eliminate the -f[no]objc-infer-related-result-type flags; there's noDouglas Gregor2011-06-1310-10/+17
| | | | | | reason to allow the user to control these semantics through a flag. llvm-svn: 132919
* Update Indexer test for new 'atomic' keyword.Fariborz Jahanian2011-06-131-2/+14
| | | | llvm-svn: 132918
* Give a diagnostic when using non-POD types in a va_argDavid Majnemer2011-06-131-0/+9
| | | | llvm-svn: 132905
* Improve the diagnostics generated for switch statements missing expressionsDavid Majnemer2011-06-131-0/+14
| | | | | | | - Move the diagnostic to the case statement instead of at the end of the switch - Add a fix-it hint as to how to fix the compilation error llvm-svn: 132903
* Don't assert on initialized typedef declarations in classes:Richard Smith2011-06-121-0/+4
| | | | | | | | | | | | struct { typedef int A = 0; }; According to the C++11 standard, this is not ill-formed, but does not have any ascribed meaning. We can't reasonably accept it, so treat it as ill-formed. Also switch C++ from an incorrect 'fields can only be initialized in constructors' diagnostic for this case to C's 'illegal initializer (only variables can be initialized)' llvm-svn: 132890
* Test for C++11 [class]p6 (trivial classes).Richard Smith2011-06-121-0/+15
| | | | llvm-svn: 132889
* Implement support for C++11 in-class initialization of non-static data members.Richard Smith2011-06-1121-26/+602
| | | | llvm-svn: 132878
* Add code completetion code for the new 'atomic' attributeFariborz Jahanian2011-06-111-0/+1
| | | | | | keyword in objc property decl. llvm-svn: 132877
* Extra test for related result type inferenceDouglas Gregor2011-06-111-0/+1
| | | | llvm-svn: 132874
* Fix order of operands for the warning about incompatible Objective-CDouglas Gregor2011-06-112-3/+3
| | | | | | | pointer assignment in C++. This was a longstanding problem spotted by Jordy Rose. llvm-svn: 132873
* Implement Objective-C Related Result Type semantics.Douglas Gregor2011-06-115-3/+244
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Related result types apply Cocoa conventions to the type of message sends and property accesses to Objective-C methods that are known to always return objects whose type is the same as the type of the receiving class (or a subclass thereof), such as +alloc and -init. This tightens up static type safety for Objective-C, so that we now diagnose mistakes like this: t.m:4:10: warning: incompatible pointer types initializing 'NSSet *' with an expression of type 'NSArray *' [-Wincompatible-pointer-types] NSSet *array = [[NSArray alloc] init]; ^ ~~~~~~~~~~~~~~~~~~~~~~ /System/Library/Frameworks/Foundation.framework/Headers/NSObject.h:72:1: note: instance method 'init' is assumed to return an instance of its receiver type ('NSArray *') - (id)init; ^ It also means that we get decent type inference when writing code in Objective-C++0x: auto array = [[NSMutableArray alloc] initWithObjects:@"one", @"two",nil]; // ^ now infers NSMutableArray* rather than id llvm-svn: 132868
* Restore 'atomic' as an attribute of objcFariborz Jahanian2011-06-111-2/+2
| | | | | | properties. llvm-svn: 132866
* PR10120: Make CodeGenModule::getVTableLinkage use NamedDecl::getLinkage to ↵Eli Friedman2011-06-101-0/+8
| | | | | | | | determine whether the vtable should be externally visible, instead of a rough approximation of it which messes up with templates. While I'm here, zap the other user of isInAnonymousNamespace outside of Decl.cpp. llvm-svn: 132861
* Uncomment this testcase now that we pass it.Alexis Hunt2011-06-101-5/+2
| | | | llvm-svn: 132842
* [analyzer] PR8962 again. Ban ParenExprs (and friends) from block-level ↵Jordy Rose2011-06-101-0/+19
| | | | | | | | expressions (by calling IgnoreParens before adding expressions to blocks). Undo 132769 (LiveVariables' local IgnoreParens), since it's no longer necessary. Also, have Environment stop looking through NoOp casts; it didn't match the behavior of LiveVariables. And once that's gone, the whole cast block of that switch is unnecessary. llvm-svn: 132840
* Made changes to how 'struct'/'class' mismatches are handled in ↵Richard Trieu2011-06-101-2/+158
| | | | | | | | | | | | | | | | | -Wmismatched-tags. - Removed fix-it hints from template instaniations since changes to the templates are rarely helpful. - Changed the caret in template instaniations from the class/struct name to the class/struct keyword, matching the other warnings. - Do not offer fix-it hints when multiple declarations disagree. Warnings are still given. - Once a definition is found, offer a fix-it hint to all previous declarations with wrong tag. - Declarations that disagree with a previous definition will get a fix-it hint to change the declaration. llvm-svn: 132831
OpenPOWER on IntegriCloud