summaryrefslogtreecommitdiffstats
path: root/clang/test
Commit message (Collapse)AuthorAgeFilesLines
* objective-c: Any use of @synthesize or @dynamic lexically after a method (or ↵Fariborz Jahanian2011-07-229-22/+24
| | | | | | | | | | C function) implementation will be rejected with a compilation error in ARC mode, and a compiler warning otherwise. This may cause breakage in non-arc (and arc) tests which don't expect warning/error. Feel free to fix the tests, or reverse the patch, if I am unavailable. // rdar://9818354 - WIP llvm-svn: 135740
* Add a missing test for the limits on wcharAlexis Hunt2011-07-211-0/+15
| | | | llvm-svn: 135708
* Fix diagnostic when loading a PCH which has different enabled/disabled state ↵Argyrios Kyrtzidis2011-07-211-2/+10
| | | | | | of -fobjc-arc. rdar://9818341 llvm-svn: 135707
* Add FixIt hint for missing 'id' type.Fariborz Jahanian2011-07-211-0/+24
| | | | | | // rdar://9615045 llvm-svn: 135685
* objc - Diagnose missing method return type specifier underFariborz Jahanian2011-07-211-0/+11
| | | | | | a warning flag. // rdar://9615045 llvm-svn: 135681
* Fix a test in warn-sign-conversion.cpp. Removed a part of a directory path ↵Richard Trieu2011-07-211-1/+1
| | | | | | so that the directory seperator, which may change on different platforms, is no longer part of the string checked for. llvm-svn: 135665
* Remove warning for conditional operands of differend signedness from ↵Richard Trieu2011-07-215-90/+121
| | | | | | -Wsign-compare. Cases that previously warn on this will have a different warning emitted from -Wsign-conversion. llvm-svn: 135664
* New libclang API to expose container type for code completion, fromDouglas Gregor2011-07-213-0/+28
| | | | | | Connor Wakamo! llvm-svn: 135651
* Addressing code review comments for commit 135509 - Add FixItHints in case a ↵Anna Zaks2011-07-211-2/+19
| | | | | | C++ function call is missing * or & operators on llvm-svn: 135643
* Removes a comment.Fariborz Jahanian2011-07-201-1/+0
| | | | llvm-svn: 135640
* objc-arc: Fixes a crash @throw'ing an objc message.Fariborz Jahanian2011-07-201-0/+16
| | | | | | // pr10411 llvm-svn: 135638
* Fix -Wuninitialized regression involving functions invalidating parameters ↵Ted Kremenek2011-07-201-0/+10
| | | | | | passed by reference. llvm-svn: 135610
* Whitespace.Chad Rosier2011-07-201-3/+0
| | | | llvm-svn: 135605
* If -ccc-host-triple i386-pc-win32-macho or -ccc-host-triple Chad Rosier2011-07-201-0/+20
| | | | | | | | x86_64-pc-win32-macho is used in conjunction with -no-integrated-as go ahead and use the Darwin system assembler. rdar://9785470 llvm-svn: 135604
* arc-objc++: Issue an arc specific diagnostic when overload resolutionFariborz Jahanian2011-07-201-0/+19
| | | | | | | fails because of lifetime differences of parameter and argument type. // rdar://9790531 llvm-svn: 135593
* test/CMakeLists.txt: Re-indent.NAKAMURA Takumi2011-07-201-4/+4
| | | | llvm-svn: 135591
* fix rdar://9780211 - Clang crashes with an assertion failure building ↵Chris Lattner2011-07-201-0/+15
| | | | | | | | | | | | | | | | | | | | | | | | | WKView.mm from WebKit This is something of a hack, the problem is as follows: 1. we instantiate both copied of RetainPtr with the two different argument types (an id and protocol-qualified id). 2. We refer to the ctor of one of the instantiations when introducing global "x", this causes us to emit an llvm::Function for a prototype whose "this" has type "RetainPtr<id<bork> >*". 3. We refer to the ctor of the other instantiation when introducing global "y", however, because it *mangles to the same name as the other ctor* we just use a bitcasted version of the llvm::Function we previously emitted. 4. We emit deferred declarations, causing us to emit the body of the ctor, however the body we emit is for RetainPtr<id>, which expects its 'this' to have an IR type of "RetainPtr<id>*". Because of the mangling collision, we don't have this case, and explode. This is really some sort of weird AST invariant violation or something, but hey a bitcast makes the pain go away. llvm-svn: 135572
* fix PR10395 - array decay can produce an interesting type whenChris Lattner2011-07-201-1/+7
| | | | | | | decaying an array of incomplete type (which has type [0 x i8]*) to a normal pointer (which has incompletetype*). llvm-svn: 135565
* PR10392: "#pragma GCC visibility" must not expand macros in itsJoerg Sonnenberger2011-07-201-0/+19
| | | | | | arguments. llvm-svn: 135552
* Replace r134583's fix for PR10290 with one which also works for ↵Richard Smith2011-07-201-0/+7
| | | | | | non-value-dependent cases. llvm-svn: 135543
* Fix false negative in -Wuninitialized involving a () wrapping an ↵Ted Kremenek2011-07-191-2/+2
| | | | | | lvalue-to-rvalue conversion in a DeclStmt. llvm-svn: 135525
* Fix assertion failure in UninitializedValues.cpp where an lvalue to rvalue ↵Ted Kremenek2011-07-191-0/+5
| | | | | | conversion is wrapped in a parenthesis. llvm-svn: 135519
* [analysis] Add checks for double-locking and lock order reversal bugs forJordy Rose2011-07-191-0/+137
| | | | | | pthread and XNU locks. Patch by Rui Paulo! llvm-svn: 135515
* Add FixItHints in case a C++ function call is missing * or & operators on ↵Anna Zaks2011-07-191-0/+87
| | | | | | one/several of it's parameters (addresses http://llvm.org/PR5941). llvm-svn: 135509
* [arcmt] Add some additional driver flags to optionally emit or save the ↵Argyrios Kyrtzidis2011-07-192-0/+62
| | | | | | | | | | | pre-migration ARC errors. -arcmt-migrate-emit-errors : Emits the pre-migration ARC errors but it doesn't affect anything else -arcmt-migrate-report-output : Writes out the pre-migration ARC errors to the provided plist file rdar://9791454 llvm-svn: 135491
* Revamp the SourceManager to separate the representation of parsedDouglas Gregor2011-07-193-1/+22
| | | | | | | | | | | | | | | | | | | | | | | | | | | source locations from source locations loaded from an AST/PCH file. Previously, loading an AST/PCH file involved carefully pre-allocating space at the beginning of the source manager for the source locations and FileIDs that correspond to the prefix, and then appending the source locations/FileIDs used for parsing the remaining translation unit. This design forced us into loading PCH files early, as a prefix, whic has become a rather significant limitation. This patch splits the SourceManager space into two parts: for source location "addresses", the lower values (growing upward) are used to describe parsed code, while upper values (growing downward) are used for source locations loaded from AST/PCH files. Similarly, positive FileIDs are used to describe parsed code while negative FileIDs are used to file/macro locations loaded from AST/PCH files. As a result, we can load PCH/AST files even during parsing, making various improvemnts in the future possible, e.g., teaching #include <foo.h> to look for and load <foo.h.gch> if it happens to be already available. This patch was originally written by Sebastian Redl, then brought forward to the modern age by Jonathan Turner, and finally polished/finished by me to be committed. llvm-svn: 135484
* Reduce -Wuninitialized time by 22% (on sqlite) by removing the recursive AST ↵Ted Kremenek2011-07-192-8/+8
| | | | | | | | | | | | | | | crawl. This is accomplished by forcing the needed expressions for -Wuninitialized to always be CFGElements in the CFG. This allows us to remove a fair amount of the code for -Wuninitialized. Some fallout: - AnalysisBasedWarnings.cpp now specifically toggles the CFGBuilder to create a CFG that is suitable for -Wuninitialized. This is a layering violation, since the logic for -Wuninitialized is in libAnalysis. This can be fixed with the proper refactoring. - Some of the source locations for -Wunreachable-code warnings have shifted. While not ideal, this is okay because that analysis already needs some serious reworking. llvm-svn: 135480
* Check column number also.Devang Patel2011-07-181-1/+1
| | | | llvm-svn: 135437
* Remember to add a has_feature macro for __underlying_type now that it isAlexis Hunt2011-07-181-0/+5
| | | | | | correctly impelmented llvm-svn: 135401
* [arcmt] When a NSData's 'bytes' family of methods are used on a local var,Argyrios Kyrtzidis2011-07-182-0/+64
| | | | | | | | | add __attribute__((objc_precise_lifetime)) to make sure that the object (and its data) will not get released before the var goes out-of-scope. rdar://9206226 llvm-svn: 135382
* [arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safeArgyrios Kyrtzidis2011-07-181-0/+43
| | | | | | with __unsafe_unretained parameters. Emit error for strong/weak ones. rdar://9206226 llvm-svn: 135381
* Don't crash when codegen'ing an empty redecl of a function in C99 mode, whenNick Lewycky2011-07-181-0/+6
| | | | | | neither was inline. Fixes bug introduced in r135377. llvm-svn: 135380
* In C99, emit an inline function when encountering an extern redeclaration.Nick Lewycky2011-07-181-0/+7
| | | | | | Fixes PR10233! llvm-svn: 135377
* Revert r135217, which wasn't the correct fix for PR10358. With thisChandler Carruth2011-07-161-4/+19
| | | | | | | | | | | patch, we actually move the state-machine for the value set backwards one step. This can pretty easily lead to infinite loops where we continually try to propagate a bit, succeed for one iteration, but then back up because we find an uninitialized use. A reduced test case from PR10379 is included. llvm-svn: 135359
* [analyzer] Per discussions with the Cocoa team, extend CF naming conventions ↵Ted Kremenek2011-07-161-0/+53
| | | | | | to extend to camel case functions instead of just title case functions. Fixes <rdar://problem/9732321>. llvm-svn: 135350
* [arcmt] It's not safe to remove the -release on "[[someivar delegate] ↵Argyrios Kyrtzidis2011-07-151-1/+8
| | | | | | | | | | | | | | | | | | release];" since it's very likely that, after migration, the object that was passed to 'setDelegate:' will not be properly retained, e.g: -whatever { id x = [[MyDoHicky alloc] init]; [someivar setDelegate: x]; // x won't get retained in ARC. } -dealloc { [[someivar delegate] release]; // give migration error here. } rdar://8858009 llvm-svn: 135327
* This handles the missing cases of opencl vector literals.Tanya Lattner2011-07-152-0/+35
| | | | | | Test cases provided by Anton Lokhmot. llvm-svn: 135322
* Update retain-release.m to match updated warnings from r135310Jordy Rose2011-07-151-3/+3
| | | | llvm-svn: 135317
* Add tests for CFRefReport's path notes, and fix a few typos and non-standard ↵Jordy Rose2011-07-152-0/+197
| | | | | | terminology ('+0 retain counts') caught by the tests. llvm-svn: 135310
* [arcmt] Rewrite to "foo = nil;" not "foo = 0;", as suggested by Jordy.Argyrios Kyrtzidis2011-07-152-1/+5
| | | | llvm-svn: 135309
* [arcmt] For:Argyrios Kyrtzidis2011-07-152-4/+14
| | | | | | | | | | | | | | | id x = ... @try { ... } @finally { [x release]; } Migrator will drop the release. It's better to change it to "x = 0" in a @finally to avoid leak when exception is thrown. rdar://9398256 llvm-svn: 135301
* Don't refer to check.deps unless LLVM_INCLUDE_TESTS is enabledDouglas Gregor2011-07-151-2/+2
| | | | llvm-svn: 135300
* [analyzer] GNU __null is a pointer-sized integer, not a pointer. Fixes PR10372.Jordy Rose2011-07-151-0/+8
| | | | llvm-svn: 135294
* When creating a property in a class extension, make sure to check itsDouglas Gregor2011-07-151-0/+11
| | | | | | attributes. Fixes <rdar://problem/9561076>. llvm-svn: 135273
* Restore the C-style cast hack for enum template arguments,John McCall2011-07-151-0/+12
| | | | | | | | which is required given the current setup for template argument deduction substitution validation, and add a test case to make sure we don't break it in the future. llvm-svn: 135262
* Enhance the IR type lowering code to be much smarter about recursively loweringChris Lattner2011-07-151-1/+9
| | | | | | | | | | | | | | | | | | | | | | | | | types. Fore xample, we used to lower: struct bar { int a; }; struct foo { void (*FP)(struct bar); } G; to: %struct.foo = type { {}* } since the function pointer would cause recursive translation of bar and we didn't know if that would get us into trouble. We are now smart enough to know that it is fine, so we get this type instead: %struct.foo = type { void (i32)* } Codegen still needs to be prepared for uncooperative types at any place, which is why I let the maximally uncooperative code sit around for awhile to help shake out the bugs. llvm-svn: 135244
* Remove warnings of constant operands of logical operators from template ↵Richard Trieu2011-07-151-0/+22
| | | | | | | | | | | | | | instantiations. Upon instantiation of template, value-dependent parameters are replaced by equivalent literals, so code like: template<unsigned int A, unsigned int B> struct S { int foo() { int x = A && B; } } will not warn on A && B on every instantiation. This will still warn on other cases inside templates, which will be caught on checking the template definition. llvm-svn: 135222
* Fix false negative reported in PR 10358 by using 'Unknown' in ↵Ted Kremenek2011-07-141-4/+4
| | | | | | -Wuninitialized to avoid cascading warnings. Patch by Kaelyn Uhrain. llvm-svn: 135217
* [arcmt] Don't remove retains/releases on a global variable, flag them with ↵Argyrios Kyrtzidis2011-07-141-0/+6
| | | | | | errors. rdar://9402555. llvm-svn: 135213
* Revert 135177 to fix PR10363.Rafael Espindola2011-07-143-41/+71
| | | | | | | | Revert "For C++11, do more checking of initializer lists up-front, enabling some subset of the final functionality. C just leaves the function early. C++98 runs through the same code path, but has no changed functionality either." This reverts commit ac420c5053d6aa41d59f782caad9e46e5baaf2c2. llvm-svn: 135210
OpenPOWER on IntegriCloud