summaryrefslogtreecommitdiff
path: root/lib
Commit message (Collapse)AuthorAge
* [analyzer] Malloc: A pointer might escape through CFContainers APIs,Anna Zaks2012-02-29
| | | | | | | | | | | | funopen, setvbuf. Teach the checker and the engine about these APIs to resolve malloc false positives. As I am adding more of these APIs, it is clear that all this should be factored out into a separate callback (for example, region escapes). Malloc, KeyChainAPI and RetainRelease checkers could all use it. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151737 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r151702, "Add support for handling captured variables in lambda debugDaniel Dunbar2012-02-29
| | | | | | info.", which broke some -O0 -g tests. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151730 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -C when linking on Solaris so that the error messages are understandable ↵David Chisnall2012-02-29
| | | | | | by actual humans. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151726 91177308-0d34-0410-b5e6-96231b3b80d8
* Tentatively fix PR12117. The test case from the bug now passes, and all ↵Sebastian Redl2012-02-29
| | | | | | existing tests still pass, but there may still be corner cases. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151716 91177308-0d34-0410-b5e6-96231b3b80d8
* Reapply r151638 and r151641.James Molloy2012-02-29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The bug that was caught by Apple's internal buildbots was valid and also showed another bug in my implementation. These are now fixed, with regression tests added to catch them both (not Darwin-specific). Original log: ==================== Revert r151638 because it causes assertion hit on PCH creation for Cocoa.h Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. ==================== git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151712 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove a recursive visitiation in ExprEngine that is no longer neededErik Verbruggen2012-02-29
| | | | | | | because the CFG is fully linearized. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151711 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Tweak the UnreachableCode checker to not warning about ↵Ted Kremenek2012-02-29
| | | | | | unreachable default blocks. Patch by Cyril Roelandt! git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151709 91177308-0d34-0410-b5e6-96231b3b80d8
* A couple minor bug-fixes for template instantiation for expressions which ↵Eli Friedman2012-02-29
| | | | | | are sometimes potentially evaluated. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151707 91177308-0d34-0410-b5e6-96231b3b80d8
* [driver] Emit an error when trying to use ARC on macosx earlier than 10.6Argyrios Kyrtzidis2012-02-29
| | | | | | rdar://10459258 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151706 91177308-0d34-0410-b5e6-96231b3b80d8
* Add support for handling captured variables in lambda debug info.Eric Christopher2012-02-29
| | | | | | | | | | | | This currently doesn't handle capturing the 'this' pointer for any enclosing class. Steal the lambda-expressions.cpp testcase and debugify it and try to use more variables to proof it against random changes. Part of rdar://10900684 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151702 91177308-0d34-0410-b5e6-96231b3b80d8
* Formatting.Eric Christopher2012-02-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151700 91177308-0d34-0410-b5e6-96231b3b80d8
* Make the odr-use logic work correctly for constant-expressions. PR12006.Eli Friedman2012-02-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151699 91177308-0d34-0410-b5e6-96231b3b80d8
* Sema/ObjC: Override search can generate a large search list, bump the base sizeDaniel Dunbar2012-02-29
| | | | | | | | of the SmallPtrSet way up to avoid commonly reallocating the buffer size. - I didn't see a good argument against it, so I bumped the limit to cover the max size we see during parsing Cocoa.h. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151698 91177308-0d34-0410-b5e6-96231b3b80d8
* ASTWriter: Cache some DenseMaps we use repeatedly.Daniel Dunbar2012-02-29
| | | | | | | | - This reduces our total # of allocations building a PCH for Cocoa.h by almost a whopping 50%. - A SmallPtrMap would be cleaner, but since we don't have one yet... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151697 91177308-0d34-0410-b5e6-96231b3b80d8
* Parse: Change PragmaPackHandler to use the preprocessor allocator.Daniel Dunbar2012-02-29
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151689 91177308-0d34-0410-b5e6-96231b3b80d8
* objective-c modern translator. Fixes misc. bug in writing Fariborz Jahanian2012-02-29
| | | | | | | the ivar offset symbol. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151683 91177308-0d34-0410-b5e6-96231b3b80d8
* Make sure list-initialization of arrays works correctly in explicit type ↵Eli Friedman2012-02-29
| | | | | | conversions. PR12121. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151674 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r151638 because it causes assertion hit on PCH creation for Cocoa.hArgyrios Kyrtzidis2012-02-28
| | | | | | | | | | | | | | | | | | | | Original log: --------------------- Correctly track tags and enum members defined in the prototype of a function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. --------------------- I also reverted r151641 which was enhancement on top of r151638. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151667 91177308-0d34-0410-b5e6-96231b3b80d8
* Single- and zero-element initializer lists to scalars are ↵Sebastian Redl2012-02-28
| | | | | | list-initializations. Fixes PR12118. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151666 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer diagnostics] Refactor filtration for PathDiagnosticConsumers that ↵Ted Kremenek2012-02-28
| | | | | | | | don't support cross-file diagnostics into a common place. Currently enable this filtration for Plist diagnostics as well. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151664 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer diagnostics] start prototyping stripping PathDiagnostics of ↵Ted Kremenek2012-02-28
| | | | | | | | | unnecessary cruft caused by path inlining. This introduces a concept of a "prunable" PathDiagnosticEvent. Currently this is a flag, but we may evolve the concept to make this more dynamically inferred. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151663 91177308-0d34-0410-b5e6-96231b3b80d8
* Modern objective-c translator. rewriting ivars of aggregate type.Fariborz Jahanian2012-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151662 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Leaks should be uniqued by the allocation point in theAnna Zaks2012-02-28
| | | | | | closest function context (RetainCountChecker). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151661 91177308-0d34-0410-b5e6-96231b3b80d8
* Prefer bitcast+GEP over ptrtoint+sub+inttoptr: it's semantically equivalent ↵Eli Friedman2012-02-28
| | | | | | here, and generally nicer to the optimizer. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151659 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Retain release: drop the line number info from the leakAnna Zaks2012-02-28
| | | | | | message. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151657 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Stats: Add the stats about remove dead bindings, correct theAnna Zaks2012-02-28
| | | | | | test. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151656 91177308-0d34-0410-b5e6-96231b3b80d8
* Add -lm by default on Solaris.David Chisnall2012-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151653 91177308-0d34-0410-b5e6-96231b3b80d8
* It turns out -fno-cxa-atexit just produces broken code, so disable it on ↵David Chisnall2012-02-28
| | | | | | Solaris and we'll ship a __cxa_atexit implementation... git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151648 91177308-0d34-0410-b5e6-96231b3b80d8
* Un-break clang based on r151638 - What was meant to be a trivial variable ↵James Molloy2012-02-28
| | | | | | name change went horribly wrong and I forgot to retest afterwards. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151641 91177308-0d34-0410-b5e6-96231b3b80d8
* Correctly track tags and enum members defined in the prototype of a ↵James Molloy2012-02-28
| | | | | | | | | | | | | | | | | function, and ensure they are properly scoped. This fixes code such as: enum e {x, y}; int f(enum {y, x} n) { return 0; } This finally fixes PR5464 and PR5477. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151638 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] When we @synthesize a property with a user-defined ivar name,Argyrios Kyrtzidis2012-02-28
| | | | | | | | | | make sure to record the source location of the ivar name. [libclang] When indexing @synthesized objc methods, report the @implementation as the lexical container. Fixes rdar://10905472 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151635 91177308-0d34-0410-b5e6-96231b3b80d8
* [AST] Associate the getter/setter methods to a property of a objc class ↵Argyrios Kyrtzidis2012-02-28
| | | | | | | | | | extension. [libclang] Index the getter/setter methods of a property of a objc class extension. Fixes rdar://10907597 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151633 91177308-0d34-0410-b5e6-96231b3b80d8
* Some more Solaris fixes. Now successfully building libc++ on Solaris with ↵David Chisnall2012-02-28
| | | | | | clang (and linking clang against it). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151632 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove stray semi-colons.Daniel Dunbar2012-02-28
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151631 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Leaks should be uniqued by the allocation point in theAnna Zaks2012-02-28
| | | | | | closest function context (Keychain API). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151613 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Fix Malloc False Positive (PR 12100)Anna Zaks2012-02-28
| | | | | | | | When allocated buffer is passed to CF/NS..NoCopy functions, the ownership is transfered unless the deallocator argument is set to 'kCFAllocatorNull'. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151608 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement IRGen for the retain-autorelease in the lambda ↵Eli Friedman2012-02-28
| | | | | | conversion-to-block-pointer outside of ARC. Testcases coming up soon. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151603 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] teach analyzer about ObjC literals, thus trimming out a false ↵Ted Kremenek2012-02-28
| | | | | | | | | | positive with the malloc() checker involving comparing literal addresses to nil. Fixes <rdar://problem/10579586> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151602 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-enable the Darwin ARM integrated assembler.Jim Grosbach2012-02-27
| | | | | | All known nightly-test failures are fixed. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151595 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Leaks should be uniqued by the allocation point in theAnna Zaks2012-02-27
| | | | | | | | | closest function context. This prevents us from uniqueing all leaks from the same allocation helper. radar://10932226 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151592 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Don't generate an explicit ExplodedNode for StringLiterals; have ↵Ted Kremenek2012-02-27
| | | | | | the SVal lazily generated from Environment::getSVal(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151589 91177308-0d34-0410-b5e6-96231b3b80d8
* Hack in a loud error for PR12086. Better than a silent miscompile.Sebastian Redl2012-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151586 91177308-0d34-0410-b5e6-96231b3b80d8
* When evaluating integer expressions include a check for sub-expressionsArgyrios Kyrtzidis2012-02-27
| | | | | | | | depth and error if we exceed a max value, to make sure we avoid a stack overflow. This is a hacky temporary fix. rdar://10913206. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151585 91177308-0d34-0410-b5e6-96231b3b80d8
* After numerous requests, have Objective-C 'method declared here' notes ↵Ted Kremenek2012-02-27
| | | | | | mention the actual method. This looks better within an IDE, where text isn't always regurgitated in the presentation of a warning. Fixes radar 10914035. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151579 91177308-0d34-0410-b5e6-96231b3b80d8
* Implement a FIXME for conversion sequence distinction. Should fix PR12092.Sebastian Redl2012-02-27
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151577 91177308-0d34-0410-b5e6-96231b3b80d8
* [analyzer] Add -analyzer-stats, which hooks up LLVM stats tracking.Anna Zaks2012-02-27
| | | | | | As in http://llvm.org/docs/ProgrammersManual.html#Statistic git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151570 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a couple bugs in the way we handle array indexes in array bounds ↵Eli Friedman2012-02-27
| | | | | | checking. Specifically, make sure we don't ignore explicit casts in indexes, and make sure we use unsigned extension/comparisons on indexes. Fixes <rdar://problem/10916006>. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151569 91177308-0d34-0410-b5e6-96231b3b80d8
* Move "clang/Analysis/Support/SaveAndRestore.h" to "llvm/ADT/SaveAndRestore.h"Argyrios Kyrtzidis2012-02-27
| | | | | | | | to make it more widely available. Depends on llvm commit r151564 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151566 91177308-0d34-0410-b5e6-96231b3b80d8
* Convert initializer lists to temporaries in CreateBuiltinBinOp. Allows ↵Sebastian Redl2012-02-27
| | | | | | assignment of init lists to built-in types and resolves PR12088. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151551 91177308-0d34-0410-b5e6-96231b3b80d8
* Add missing code for compound literals of complex type. ↵Eli Friedman2012-02-27
| | | | | | <rdar://problem/10938628> git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151549 91177308-0d34-0410-b5e6-96231b3b80d8