summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* "Teach" RetainCountChecker about dispatch_set_context, which can indirectly ↵Ted Kremenek2012-03-221-0/+8
| | | | | | free its argument later. Fixes <rdar://problem/11059275>. llvm-svn: 153244
* Fix broken CFG when an initializer is a statement expression that starts ↵Ted Kremenek2012-03-221-5/+15
| | | | | | with a while loop (PR 12325). llvm-svn: 153242
* During the instantiation of a class template specialization, thatRichard Smith2012-03-221-5/+5
| | | | | | | | | specialization is known to be incomplete. If we're asked to try to complete it, don't attempt to instantiate it again -- that can lead to stack overflow, and to rejects-valids if the class being incomplete is not an error. llvm-svn: 153236
* Simplify DataRecursiveIntBinOpEvaluator::VisitBinOp() a bit and make sure we ↵Argyrios Kyrtzidis2012-03-221-13/+9
| | | | | | | | don't evaluate RHS if LHS could not be evaluated and keepEvaluatingAfterFailure() is false. llvm-svn: 153235
* [analyzer] Malloc: drop symbols captured by blocks.Anna Zaks2012-03-221-0/+42
| | | | llvm-svn: 153232
* modern objective-c translator: Change declaration ofFariborz Jahanian2012-03-211-11/+9
| | | | | | | all objc_msgSend unctions to void parameters and void return. // rdar://11094890 llvm-svn: 153227
* Change the binary operator data recursive evaluator to not stop at the firstRichard Trieu2012-03-211-16/+14
| | | | | | | | | | | non-constant value encountered. This allows the evaluator to deduce that expressions like (x < 5 || true) is equal to true. Previously, it would visit x and determined that the entire expression is could not evaluated to a constant. This fixes PR12318. llvm-svn: 153226
* Remove unused variable, fix indentation.Benjamin Kramer2012-03-211-7/+5
| | | | llvm-svn: 153220
* For enums with no tag name, display its location in Fariborz Jahanian2012-03-211-3/+3
| | | | | | | the diagnostic instead of displaying ''. // rdar://11082110 llvm-svn: 153219
* fixes the diagnostic issued in // rdar://11069896Fariborz Jahanian2012-03-211-1/+1
| | | | llvm-svn: 153217
* Report the natural alignment of unsigned long long, not the preferred alignment.Chad Rosier2012-03-211-1/+2
| | | | | | rdar://11054144 llvm-svn: 153216
* [analyzer] Malloc: Utter the name of the leaked variable.Anna Zaks2012-03-214-20/+65
| | | | | | | | | | | | | | | Specifically, we use the last store of the leaked symbol in the leak diagnostic. (No support for struct fields since the malloc checker doesn't track those yet.) + Infrastructure to track the regions used in store evaluations. This approach is more precise than iterating the store to obtain the region bound to the symbol, which is used in RetainCount checker. The region corresponds to what is uttered in the code in the last store and we do not rely on the store implementation to support this functionality. llvm-svn: 153212
* [analyser] Factor out FindUniqueBinding from RetainCount checker.Anna Zaks2012-03-212-33/+19
| | | | | | So that others could use it as well. No functionality change. llvm-svn: 153211
* Duplicated code is bad. At least make it consistent.Bob Wilson2012-03-212-71/+40
| | | | | | | | | | The getARMTargetCPU and getLLVMArchSuffixForARM functions exist in both Toolchain.cpp and Tools.cpp. This stuff needs a thorough overhaul. In the meantime, this patch at least makes them consistent. One version had been converted to use StringSwitch, and the other version had new Cortex M-series processors added. llvm-svn: 153202
* Allow void blocks to return witn a void expression in Fariborz Jahanian2012-03-211-2/+7
| | | | | | | c-mode to match behavior with void functions in c. Issue warning with -pedantic. // rdar://11069896 llvm-svn: 153200
* For Darwin, do not let -mcpu override the -arch option. <rdar://11059238>Bob Wilson2012-03-211-5/+9
| | | | | | | | | | | | On Darwin the architecture and the corresponding Mach-O slice is typically specified with -arch. If not, it defaults to the current host architecture. Do not use -mcpu to override the -arch value. This is only an issue when people need to use specialized code for a non-default CPU (hopefully guarded by run-time checks to detect the current processor). The -mcpu option is still used for the -target-cpu option to clang, but this patch causes it to not be used to set the architecture in the target triple. llvm-svn: 153197
* modern objective-c rewriter: remove 'const' fromFariborz Jahanian2012-03-211-34/+30
| | | | | | | pointer field declarations in several meta-data. // rdar://11079898 llvm-svn: 153196
* Undo previous patch as I checked more than I intended.Fariborz Jahanian2012-03-212-37/+36
| | | | llvm-svn: 153193
* modern objective-c rewriter: remove 'const' fromFariborz Jahanian2012-03-212-36/+37
| | | | | | | pointer field declarations in several meta-data. // rdar://11079898 llvm-svn: 153192
* For the annals of subtle but terrible bugs: fix a longstanding bugJohn McCall2012-03-211-5/+5
| | | | | | | | | | | | | | | | | | | | in vtable layout where virtual methods inherited from virtual bases could be assigned the same vcall adjustment slot if they shared a name and parameter signature but differed in their cv-qualification. The code was already trying to handle this case, but unfortunately used the ordinary type qualifiers (which are always empty here) instead of the method qualifiers. This seems like something that the API should discourage, but I don't know how to carry that principle out in this instance. Eliminate this function's need for an ASTContext while we're at it. This bug affects the ABI, and fixing it brings us into accord with the Itanium ABI (and GCC's implementation of it), but, obviously, technically breaks full compatibility with previous releases of Clang. Just letting you know. llvm-svn: 153168
* RewriteModernObjC.cpp: Don't expose temporary std::string with StringRef. ↵NAKAMURA Takumi2012-03-211-1/+1
| | | | | | (StringRef)getName() can be used here. llvm-svn: 153156
* Close the paren.Fariborz Jahanian2012-03-211-2/+2
| | | | | | // rdar://11076938 llvm-svn: 153151
* Update comment.Eric Christopher2012-03-201-2/+1
| | | | llvm-svn: 153149
* modern objective-c translator: insert couple of pragmas for optimization.Fariborz Jahanian2012-03-201-0/+4
| | | | | | // rdar://11079898 llvm-svn: 153145
* modern objective-c translator: add static function to initialize Fariborz Jahanian2012-03-201-3/+28
| | | | | | | the class pointer in the category structure. // rdar://11076938 llvm-svn: 153138
* More careful consideration of C++11 13.3.3.1p4. Fixes PR12257.Sebastian Redl2012-03-201-7/+19
| | | | llvm-svn: 153130
* Fix the other place where C++98 work for initializer lists was necessary.Sebastian Redl2012-03-201-2/+3
| | | | llvm-svn: 153129
* more modern objective-c meta-data stuff.Fariborz Jahanian2012-03-201-3/+17
| | | | llvm-svn: 153127
* Fix a use-after-free in thunk emission. EmitThunk may call RAUW on Init, ↵Benjamin Kramer2012-03-201-1/+1
| | | | | | | | invalidating the pointer. Fixes PR12284. The test case only triggered under asan/valgrind, but it's better than nothing. llvm-svn: 153120
* modern objective-c translator: provide meta-data initializationFariborz Jahanian2012-03-201-17/+71
| | | | | | | via functions for certain pointer initialization fields. // rdar://11076938 llvm-svn: 153117
* Debug info: Tighten up uses of plain MDNode pointers which don't survive ↵Benjamin Kramer2012-03-201-15/+13
| | | | | | | | replaceOperandWith. TrackingVH notices when it gets RAUW'd. Fixes PR12305 and PR12315. llvm-svn: 153115
* modern objective-c translator: couple of minorFariborz Jahanian2012-03-201-3/+3
| | | | | | | changes to how meta-data is declared. // rdar://11076938 llvm-svn: 153098
* objective-c modern translator: Refactor intername ivar names toFariborz Jahanian2012-03-201-21/+23
| | | | | | | one place and use it throughout. Also, change ivar name to avoid name collisions. // rdar://11079366 llvm-svn: 153093
* [avx] Define the _mm256_loadu2_xxx and _mm256_storeu2_xxx intrinsics.Chad Rosier2012-03-201-0/+67
| | | | | | | | | From the Intel Optimization Reference Manual, Section 11.6.2. When data cannot be aligned or alignment is not known, 16-byte memory accesses may provide better performance. rdar://11076953 llvm-svn: 153091
* Add missing bitcast that was breaking Objective-C++ exception typeinfo ↵David Chisnall2012-03-201-1/+2
| | | | | | (GNUstep runtime). llvm-svn: 153090
* Fix crash when querying the CFG reported when using the thread safety analysisTed Kremenek2012-03-191-1/+1
| | | | | | | on code using multi-dimensional arrays. Fix by DeLesley Hutchins, and reported in PR 12271. llvm-svn: 153067
* removed unused code in the modern objc rewriter file.Fariborz Jahanian2012-03-191-68/+0
| | | | llvm-svn: 153052
* modern objective-c translator: fix type of objc_exception_throwFariborz Jahanian2012-03-191-3/+3
| | | | | | declaration and its siblings. llvm-svn: 153043
* Fix a regression where ':' in CPLUS_INCLUDE_PATH and friends would no longer ↵Nico Weber2012-03-191-2/+2
| | | | | | | | separate paths. This regressed in r152583. Also add a test to make sure it doesn't regress again. llvm-svn: 153034
* Add the missing compatibility warning for braced initializers as default ↵Sebastian Redl2012-03-181-2/+3
| | | | | | arguments. llvm-svn: 153026
* [analyzer] Mark a failed-realloc's result as an interesting symbol between ↵Jordy Rose2012-03-181-3/+27
| | | | | | | | | | the realloc call and the null check, so we get nicer path notes. Fixes a regression introduced by the diagnostic pruning added in r152361. This is accomplished by calling markInteresting /during/ path diagnostic generation, and as such relies on deterministic ordering of BugReporterVisitors -- namely, that BugReporterVisitors are run in /reverse/ order from how they are added. (Right now that's a consequence of storing visitors in an ImmutableList, where new items are added to the front.) It's a little hacky, but it works for now. I think this is the best we can do without storing the relation between the old and new symbols, and that would be a hit whether or not there ends up being an error. llvm-svn: 153010
* Turns #import in MS Mode into an error.Aaron Ballman2012-03-181-2/+18
| | | | llvm-svn: 153009
* Use character literals for vexing initialization fixit hints.David Blaikie2012-03-181-0/+8
| | | | | | | | | | | | | | | Instead of suggesting " = 0" for "char c();", suggest " = '\0'", and similarly for other char types (wide, 16, and 32). Add tests for all these, and since this means testing such hints under C++0x, add tests for some untested C++0x hint cases in the existing code, including suggesting nullptr for pointer initialization. This sets up the initialization helper to provide better type fidelity that will be especially helpful for non-assignment cases (such as fixit-correcting NULL usage in function calls (eg: foo(char) + foo(NULL) => foo('\0') instead of the less informative foo(0))) llvm-svn: 153008
* [analyzer] Use a FoldingSet to cache simple RetainSummary instances, rather ↵Jordy Rose2012-03-181-40/+58
| | | | | | | | | | than explicitly keeping DoNothing and StopTracking summaries and nothing else. I tried to test the effects of this change on memory usage and run time, but what I saw on retain-release.m was indistinguishable from noise (debug and release builds). Even so, some caveman profiling showed 101 cache hits that we would have generated new summaries for before (i.e. not default or stop summaries), and the more code we analyze, the more memory we should save. Maybe we should have a standard project for benchmarking the retain count checker's memory and time? llvm-svn: 153007
* Replace a FIXME with a diagnostic when we can't resolve theDouglas Gregor2012-03-181-1/+2
| | | | | | nested-name-specifier for a class template declaration. Fixes PR12291. llvm-svn: 153006
* Diagnose tag and class template declarations with qualifiedDouglas Gregor2012-03-172-27/+47
| | | | | | declarator-ids that occur at class scope. Fixes PR8019. llvm-svn: 153002
* [analyzer] Unify retain-count summary generation for class and instance ↵Jordy Rose2012-03-171-53/+26
| | | | | | methods. No functionality change. llvm-svn: 153001
* Kill cocoa::deriveNamingConvention and cocoa::followsFundamentalRule. They ↵Jordy Rose2012-03-172-41/+0
| | | | | | | | are now just simple wrappers around method families, and method decls can cache method family lookups. Also, no one is using them right now. The one difference between ObjCMethodDecl::getMethodFamily and Selector::getMethodFamily is that the former will do some additional sanity checking, and since CoreFoundation types don't look like Objective-C objects, an otherwise interesting method will get a method family of OMF_None. Future clients that use method families should consider how they want to handle CF types. llvm-svn: 153000
* [analyzer] Remove duplicate work on deriving method behavior. No ↵Jordy Rose2012-03-171-83/+74
| | | | | | | | | | functionality change. The cocoa::deriveNamingConventions helper is just using method families anyway now, and the way RetainSummaryTemplate works means we're allocating an extra summary for every method with a relevant family. Also, fix RetainSummaryTemplate to do the right thing w/r/t annotating an /existing/ summary. This was probably the real cause of <rdar://problem/10824732> and the fix in r152448. llvm-svn: 152998
* modern objective-c rewriter: further improvement inFariborz Jahanian2012-03-171-29/+22
| | | | | | | | writing @synchronized statement; do not call locking expression more than once and support early exits in @synchronized's statement block (such as return). llvm-svn: 152993
OpenPOWER on IntegriCloud