summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
* Make __is_convertible_to handle abstract types correctly. PR13591.Eli Friedman2012-08-142-1/+18
| | | | llvm-svn: 161828
* Fix undefined behavior (and wrong code, as far as I can tell) in NEON builtinRichard Smith2012-08-141-2/+2
| | | | | | | | | tablegen code, found by -fcatch-undefined-behavior. I would appreciate if someone more familiar with the NEON code could point me in the direction of how to write a test for this. We appear to have essentially no test coverage whatsoever for these builtins. llvm-svn: 161827
* [analyzer] Teach live variable analyzes that super uses self pointer.Anna Zaks2012-08-141-0/+8
| | | | llvm-svn: 161822
* [analyzer] Disable autorelease pool tracking.Anna Zaks2012-08-141-2/+21
| | | | | | | | | The autorelease pool has not been implemented completely: we were adding the autoreleased symbols to the state, but never looking at them. Until we have a complete implementation, remove the overhead and comment out the unused code. llvm-svn: 161821
* [analyzer] Refactor RetainReleaseChecker to go through a function callAnna Zaks2012-08-141-40/+53
| | | | | | | | | | | to set/get/remove the RefBinding. No functional change here. Having these setter and getter methods will make it much easier when replacing the underlining representation of RefBindings (I just went through the exercise). It makes the code more readable as well. llvm-svn: 161820
* [analyzer] Add getStackFrame() to CheckerContext and ExplodedNode.Anna Zaks2012-08-141-1/+1
| | | | llvm-svn: 161819
* [analyzer] Look up DynamicTypeInfo by region instead of symbol.Jordan Rose2012-08-131-18/+14
| | | | | | | | This allows us to store type info for non-symbolic regions. No functionality change. llvm-svn: 161811
* [analyzer] Reduce code duplication: make CXXDestructorCall a CXXInstanceCall.Jordan Rose2012-08-133-46/+18
| | | | | | | | | | | | | | | | | While there is now some duplication between SimpleCall and the CXXInstanceCall sub-hierarchy, this is much better than copy-and-pasting the devirtualization logic shared by both instance methods and destructors. An unfortunate side effect is that there is no longer a single CallEvent type that corresponds to "calls written as CallExprs". For the most part this is a good thing, but the checker callback eval::Call still takes a CallExpr rather than a CallEvent (since we're not sure if we want to allow checkers to evaluate other kinds of calls). A mistake here will be caught by a cast<> in CheckerManager::runCheckersForEvalCall. No functionality change. llvm-svn: 161809
* [analyzer] Be more careful when downcasting for devirtualization.Jordan Rose2012-08-131-12/+9
| | | | | | | | | Virtual base regions are never layered, so simply stripping them off won't necessarily get you to the correct casted class. Instead, what we want is the same logic for evaluating dynamic_cast: strip off base regions if possible, but add new base regions if necessary. llvm-svn: 161808
* [analyzer] Handle dynamic_casts that turn out to be upcasts.Jordan Rose2012-08-131-13/+11
| | | | | | | | | | | This can occur with multiple inheritance, which jumps from one parent to the other, and with virtual inheritance, since virtual base regions always wrap the actual object and can't be nested within other base regions. This also exposed some incorrect logic for multiple inheritance: even if B is known not to derive from C, D might still derive from both of them. llvm-svn: 161798
* [analyzer] Don't strip CXXBaseObjectRegions when checking dynamic_casts.Jordan Rose2012-08-134-21/+53
| | | | | | | | | | | | | | | ...and /do/ strip CXXBaseObjectRegions when casting to a virtual base class. This allows us to enforce the invariant that a CXXBaseObjectRegion can always provide an offset for its base region if its base region has a known class type, by only allowing virtual bases and direct non-virtual bases to form CXXBaseObjectRegions. This does mean some slight problems for our modeling of dynamic_cast, which needs to be resolved by finding a path from the current region to the class we're trying to cast to. llvm-svn: 161797
* [ms-inline asm] Add a helpful assert.Chad Rosier2012-08-131-0/+1
| | | | llvm-svn: 161796
* [ms-inline asm] Address a potential buffer overflow.Chad Rosier2012-08-131-5/+1
| | | | llvm-svn: 161793
* PR13570: When an unresolved overloaded call appeared in a dependent context, weRichard Smith2012-08-131-0/+1
| | | | | | | forgot to set it as being instantiation-dependent as well as being type- and value-dependent. llvm-svn: 161791
* ARM: enable struct byval for AAPCS-VFP.Manman Ren2012-08-131-7/+4
| | | | | | rdar://9877866 llvm-svn: 161790
* c: small refactoring of checking for __attribute__(const))Fariborz Jahanian2012-08-131-8/+1
| | | | | | per Richard's comment. llvm-svn: 161786
* [ms-inline asm] Have patchMSAsmStrings() return a vector or AsmStrings.Chad Rosier2012-08-131-62/+79
| | | | | | | | | | | | | | | | | | | | | | | | | The AsmParser expects a single asm instruction, but valid ms-style inline asm statements may contain multiple instructions. This happens with asm blocks __asm { mov ebx, eax mov ecx, ebx } or when multiple asm statements are adjacent to one another __asm mov ebx, eax __asm mov ecx, ebx and __asm mov ebx, eax __asm mov ecx, ebx Currently, asm blocks are not properly handled. llvm-svn: 161780
* Factor out computation of whether a typeid's expression is potentiallyRichard Smith2012-08-136-27/+27
| | | | | | evaluated into a CXXTypeid member function. No functionality change. llvm-svn: 161779
* c: make __has_attribute(const) work for constFariborz Jahanian2012-08-131-0/+7
| | | | | | function attribute. // rdar://10253857 llvm-svn: 161767
* When looking for the comment associated with a declaration, adjust theDouglas Gregor2012-08-131-0/+11
| | | | | | | | 'templated' declaration for a function or class template to refer to the function or class template itself, to which the documentation will be attached. Fixes PR13593. llvm-svn: 161762
* When the header file search resolves a quoted include to a file in theDouglas Gregor2012-08-131-5/+13
| | | | | | | | | | | current directory, propagate the framework and in-index-header-map from the including header's information down to the included header's information. Fixes <rdar://problem/11261291>. As with everything header-map related, we can't really test this in isolation within Clang, so it's tested elsewhere. llvm-svn: 161759
* Added some preprocessor memory usage stats to -cc1 -print-statsAlexander Kornienko2012-08-131-0/+14
| | | | llvm-svn: 161752
* This is always going to be true so the cast isn't necessary.Eric Christopher2012-08-131-5/+3
| | | | llvm-svn: 161744
* Attaching comments to declarations: find comment attached to any redeclarationDmitri Gribenko2012-08-113-45/+89
| | | | | | | | Not only look for the comment near the declaration itself, but also walk the redeclaration chain: the previous declaration might have had a documentation comment. llvm-svn: 161722
* Removed an unused function I added a while back.Fariborz Jahanian2012-08-101-21/+0
| | | | llvm-svn: 161714
* [analyzer] Strip CXXBaseObjectRegions when devirtualizing method calls.Jordan Rose2012-08-101-1/+25
| | | | | | | | | This was causing a crash when we tried to re-apply a base object region to itself. It probably also caused incorrect offset calculations in RegionStore. PR13569 / <rdar://problem/12076683> llvm-svn: 161710
* [analyzer] Try to devirtualize even if the static callee has no definition.Jordan Rose2012-08-101-2/+2
| | | | | | | This mostly affects pure virtual methods, but would also affect parent methods defined inline in the header when analyzing the child's source file. llvm-svn: 161709
* [analyzer] Add clang_analyzer_checkInlined for debugging purposes.Jordan Rose2012-08-101-38/+75
| | | | | | | | | | | | | | | | | | | | | | | | | | | This check is also accessible through the debug.ExprInspection checker. Like clang_analyzer_eval, you can use it to test the analyzer engine's current state; the argument should be true or false to indicate whether or not you expect the function to be inlined. When used in the positive case (clang_analyzer_checkInlined(true)), the analyzer prints the message "TRUE" if the function is ever inlined. However, clang_analyzer_checkInlined(false) should never print a message; this asserts that there should be no paths on which the current function is inlined, but then there are no paths on which to print a message! (If the assertion is violated, the message "FALSE" will be printed.) This asymmetry comes from the fact that the only other chance to print a message is when the function is analyzed as a top-level function. However, when we do that, we can't be sure it isn't also inlined elsewhere (such as in a recursive function, or if we want to analyze in both general or specialized cases). Rather than have all checkInlined calls have an appended, meaningless "FALSE" or "TOP-LEVEL" case, there is just no message printed. void clang_analyzer_checkInlined(int); For debugging purposes only! llvm-svn: 161708
* [ms-inline asm] Avoid extra allocations by making this an array of StringRefs.Chad Rosier2012-08-101-2/+2
| | | | llvm-svn: 161703
* Add comments for turning on byvalManman Ren2012-08-101-0/+2
| | | | llvm-svn: 161702
* [ms-inline asm] PatchMSAsmString() doesn't correctly patch non-simple asmChad Rosier2012-08-101-0/+9
| | | | | | | statements. Therefore, we can't pass the PatchedAsmString to the AsmParser and expect things to work. llvm-svn: 161701
* Don't emit an invoke whose normal destination is a landingpad. Fixes testEli Friedman2012-08-101-19/+2
| | | | | | regression on test/CodeGenObjC/2008-10-3-EhValue.m on non-Darwin targets. llvm-svn: 161700
* objective-C++: dalyed parsing of ctors with memberFariborz Jahanian2012-08-102-8/+19
| | | | | | | initializer list defined inside an objc class implementation. wip llvm-svn: 161699
* [ms-inline asm] Fix a memory leak introduced in r161686.Chad Rosier2012-08-102-5/+10
| | | | llvm-svn: 161698
* ARM: enable struct byval for AAPCS.Manman Ren2012-08-101-3/+1
| | | | | | | rdar://9877866 PR://13350 llvm-svn: 161694
* objective-C++: delay parsing of ctor with try blockFariborz Jahanian2012-08-101-0/+10
| | | | | | | with member initializer list defined inside an objc implementation block. wip. llvm-svn: 161692
* Thread-safety-analysis: adds existential quantification over lockDeLesley Hutchins2012-08-101-14/+61
| | | | | | | expressions. The syntax &MyClass::mutex is interpreted as a pattern that matches m->mutex for any object m of type MyClass. llvm-svn: 161691
* Thread safety analysis: refactor to support more sophisticated handlingDeLesley Hutchins2012-08-101-170/+404
| | | | | | of expressions, and better error messages. llvm-svn: 161690
* [ms-inline asm] Add clobbers to AST representation.Chad Rosier2012-08-102-4/+10
| | | | llvm-svn: 161686
* Frontend: define _LP64 in a target-independent wayDylan Noblesmith2012-08-102-6/+7
| | | | | | | | | | | | | | Instead of adding it to each individual subclass in Targets.cpp, simply check the appropriate target values. Where before it was only on x86_64 and ppc64, it's now also defined on mips64 and nvptx64. Also add a bunch of negative tests to ensure it is *not* defined on any other architectures while we're here. llvm-svn: 161685
* [analyzer] Track if a region can be a subclass in the dynamic type info.Anna Zaks2012-08-102-5/+14
| | | | | | | When object is allocated with alloc or init, we assume it cannot be a subclass (currently used only for bifurcation purposes). llvm-svn: 161682
* [analyzer] Optimize dynamic dispatch bifurcation by detecting the casesAnna Zaks2012-08-101-2/+59
| | | | | | | | | | | | | | | | when we don't need to split. In some cases we know that a method cannot have a different implementation in a subclass: - the class is declared in the main file (private) - all the method declarations (including the ones coming from super classes) are in the main file. This can be improved further, but might be enough for the heuristic. (When we are too aggressive splitting the state, efficiency suffers. When we fail to split the state coverage might suffer.) llvm-svn: 161681
* Refactor thread safety analysis to use a different data structureDeLesley Hutchins2012-08-101-117/+213
| | | | | | to track locksets. This is in preparation for further changes. llvm-svn: 161680
* [ms-inline asm] Use asserts as these calls are now guarded by identical checks.Chad Rosier2012-08-101-9/+5
| | | | llvm-svn: 161676
* objective-C++: delayed parsing of member function withFariborz Jahanian2012-08-102-5/+17
| | | | | | | function-try-block occuring in objc's implementation block. wip. llvm-svn: 161675
* Whitespace.Chad Rosier2012-08-101-31/+31
| | | | llvm-svn: 161673
* objective-C++: Delayed parsing of most commonFariborz Jahanian2012-08-102-15/+21
| | | | | | | member functions defined inside an objc class implementation. wip. llvm-svn: 161667
* Add missing cctype includes.Joerg Sonnenberger2012-08-108-0/+9
| | | | llvm-svn: 161660
* Decrementing std::string::end is not portable, use array access instead.Joerg Sonnenberger2012-08-101-1/+1
| | | | llvm-svn: 161659
* Fix a couple of pedantic gcc warnings.Benjamin Kramer2012-08-101-1/+1
| | | | llvm-svn: 161656
OpenPOWER on IntegriCloud