summaryrefslogtreecommitdiffstats
path: root/clang/lib
Commit message (Collapse)AuthorAgeFilesLines
...
* Implement "optimization" for lambda-to-block conversion which inlines the ↵Eli Friedman2012-03-017-90/+149
| | | | | | | | generated block literal for lambdas which are immediately converted to block pointer type. This simplifies the AST, avoids an unnecessary copy of the lambda and makes it much easier to avoid copying the result onto the heap. Note that this transformation has a substantial semantic effect outside of ARC: it gives the converted lambda lifetime semantics similar to a block literal. With ARC, the effect is much less obvious because the lifetime of blocks is already managed. llvm-svn: 151797
* Reject 'a = {0} = {0}' rather than parsing it as '(a = {0}) = {0}'. AlsoRichard Smith2012-03-011-12/+28
| | | | | | | improve the diagnostics for some attempts to use initializer lists in expressions. llvm-svn: 151794
* Fix regression from llvm-gcc where we should NOT emit a warning about ↵Ted Kremenek2012-03-011-1/+8
| | | | | | __attribute__((NSObject)) on a property declaration. This is needed to have retain properties for non-object pointers. Fixes <rdar://problem/10930507>. llvm-svn: 151786
* [analyzer] Diagnostics - do not try to cleanup the path with macros, itAnna Zaks2012-03-011-3/+0
| | | | | | | will be done by the general cleanup later on. A Patch by Ted. llvm-svn: 151784
* Tighten type-checking a bit to make it clearer how BuildCXXMemberCallExpr is ↵Eli Friedman2012-03-011-2/+3
| | | | | | used. llvm-svn: 151783
* Move suport for redefining operator keywords from -fms-extensions to ↵Nico Weber2012-03-011-1/+1
| | | | | | -fms-compatibility. llvm-svn: 151776
* Change if...else if...else if... to a switch.Ted Kremenek2012-03-011-19/+26
| | | | llvm-svn: 151775
* [analyzer] when scanning FIDs in a PathDiagnostic, correctly recurse calls ↵Ted Kremenek2012-02-292-24/+60
| | | | | | and macros. llvm-svn: 151774
* Allow operator keywords to be #defined in ms-ext mode.Nico Weber2012-02-291-1/+8
| | | | | | | | | | | | | | Fixes PR10606. I'm not sure if this is the best way to go about it, but I locally enabled this code path without the msext conditional, and all tests pass, except for test/Preprocessor/cxx_oper_keyword.cpp which explicitly checks that operator keywords can't be redefined. I also parsed chromium/win with a clang with and without this patch. It introduced no new errors, but removes 43 existing errors. llvm-svn: 151768
* objective-c: provide fixit hint when atomic property does notFariborz Jahanian2012-02-296-13/+55
| | | | | | | have matching user defined setter/getter and a warning is issued. In this case, a fixit note is displayed. // rdar://10267155 llvm-svn: 151766
* Fix a couple -Wuninitialized warnings from gcc. Reported by David Greene.Eli Friedman2012-02-292-2/+3
| | | | llvm-svn: 151754
* Serialization: Switch over to using the native SmallVector based BitstreamWriterDaniel Dunbar2012-02-292-2/+2
| | | | | | ctor. llvm-svn: 151752
* Allocate TargetLibraryInfo for the CodeGen passes. Otherwise, it's instantiatedChad Rosier2012-02-291-0/+6
| | | | | | | | | by the BAA pass, which uses the default TargetLibraryInfo constructor. Unfortunately, the default TargetLibraryInfo constructor assumes all library calls are available and thus ignores -fno-builtin. rdar://10947759 llvm-svn: 151745
* [analyzer] Malloc: A pointer might escape through CFContainers APIs,Anna Zaks2012-02-292-4/+44
| | | | | | | | | | | | 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. llvm-svn: 151737
* Revert r151702, "Add support for handling captured variables in lambda debugDaniel Dunbar2012-02-291-61/+30
| | | | | | info.", which broke some -O0 -g tests. llvm-svn: 151730
* Add -C when linking on Solaris so that the error messages are understandable ↵David Chisnall2012-02-291-0/+3
| | | | | | by actual humans. llvm-svn: 151726
* Tentatively fix PR12117. The test case from the bug now passes, and all ↵Sebastian Redl2012-02-291-8/+11
| | | | | | existing tests still pass, but there may still be corner cases. llvm-svn: 151716
* Reapply r151638 and r151641.James Molloy2012-02-297-3/+103
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ==================== llvm-svn: 151712
* Remove a recursive visitiation in ExprEngine that is no longer neededErik Verbruggen2012-02-291-9/+3
| | | | | | because the CFG is fully linearized. llvm-svn: 151711
* [analyzer] Tweak the UnreachableCode checker to not warning about ↵Ted Kremenek2012-02-291-0/+8
| | | | | | unreachable default blocks. Patch by Cyril Roelandt! llvm-svn: 151709
* A couple minor bug-fixes for template instantiation for expressions which ↵Eli Friedman2012-02-292-12/+15
| | | | | | are sometimes potentially evaluated. llvm-svn: 151707
* [driver] Emit an error when trying to use ARC on macosx earlier than 10.6Argyrios Kyrtzidis2012-02-293-0/+9
| | | | | | rdar://10459258 llvm-svn: 151706
* Add support for handling captured variables in lambda debug info.Eric Christopher2012-02-291-30/+61
| | | | | | | | | | | | 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 llvm-svn: 151702
* Formatting.Eric Christopher2012-02-291-1/+1
| | | | llvm-svn: 151700
* Make the odr-use logic work correctly for constant-expressions. PR12006.Eli Friedman2012-02-293-1/+21
| | | | llvm-svn: 151699
* Sema/ObjC: Override search can generate a large search list, bump the base sizeDaniel Dunbar2012-02-291-3/+4
| | | | | | | | 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. llvm-svn: 151698
* ASTWriter: Cache some DenseMaps we use repeatedly.Daniel Dunbar2012-02-291-5/+4
| | | | | | | | - 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... llvm-svn: 151697
* Parse: Change PragmaPackHandler to use the preprocessor allocator.Daniel Dunbar2012-02-291-7/+16
| | | | llvm-svn: 151689
* objective-c modern translator. Fixes misc. bug in writing Fariborz Jahanian2012-02-291-2/+2
| | | | | | the ivar offset symbol. llvm-svn: 151683
* Make sure list-initialization of arrays works correctly in explicit type ↵Eli Friedman2012-02-292-15/+19
| | | | | | conversions. PR12121. llvm-svn: 151674
* Revert r151638 because it causes assertion hit on PCH creation for Cocoa.hArgyrios Kyrtzidis2012-02-287-98/+3
| | | | | | | | | | | | | | | | | | | | 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. llvm-svn: 151667
* Single- and zero-element initializer lists to scalars are ↵Sebastian Redl2012-02-281-0/+1
| | | | | | list-initializations. Fixes PR12118. llvm-svn: 151666
* [analyzer diagnostics] Refactor filtration for PathDiagnosticConsumers that ↵Ted Kremenek2012-02-282-37/+45
| | | | | | | | don't support cross-file diagnostics into a common place. Currently enable this filtration for Plist diagnostics as well. llvm-svn: 151664
* [analyzer diagnostics] start prototyping stripping PathDiagnostics of ↵Ted Kremenek2012-02-282-0/+61
| | | | | | | | | 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. llvm-svn: 151663
* Modern objective-c translator. rewriting ivars of aggregate type.Fariborz Jahanian2012-02-281-15/+78
| | | | llvm-svn: 151662
* [analyzer] Leaks should be uniqued by the allocation point in theAnna Zaks2012-02-281-4/+16
| | | | | | closest function context (RetainCountChecker). llvm-svn: 151661
* Prefer bitcast+GEP over ptrtoint+sub+inttoptr: it's semantically equivalent ↵Eli Friedman2012-02-281-3/+3
| | | | | | here, and generally nicer to the optimizer. llvm-svn: 151659
* [analyzer] Retain release: drop the line number info from the leakAnna Zaks2012-02-281-3/+2
| | | | | | message. llvm-svn: 151657
* [analyzer] Stats: Add the stats about remove dead bindings, correct theAnna Zaks2012-02-281-0/+11
| | | | | | test. llvm-svn: 151656
* Add -lm by default on Solaris.David Chisnall2012-02-281-0/+1
| | | | llvm-svn: 151653
* It turns out -fno-cxa-atexit just produces broken code, so disable it on ↵David Chisnall2012-02-281-1/+1
| | | | | | Solaris and we'll ship a __cxa_atexit implementation... llvm-svn: 151648
* Un-break clang based on r151638 - What was meant to be a trivial variable ↵James Molloy2012-02-281-1/+1
| | | | | | name change went horribly wrong and I forgot to retest afterwards. llvm-svn: 151641
* Correctly track tags and enum members defined in the prototype of a ↵James Molloy2012-02-287-3/+98
| | | | | | | | | | | | | | | 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. llvm-svn: 151638
* [AST] When we @synthesize a property with a user-defined ivar name,Argyrios Kyrtzidis2012-02-281-5/+5
| | | | | | | | | | 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 llvm-svn: 151635
* [AST] Associate the getter/setter methods to a property of a objc class ↵Argyrios Kyrtzidis2012-02-281-4/+8
| | | | | | | | | | extension. [libclang] Index the getter/setter methods of a property of a objc class extension. Fixes rdar://10907597 llvm-svn: 151633
* Some more Solaris fixes. Now successfully building libc++ on Solaris with ↵David Chisnall2012-02-283-13/+21
| | | | | | clang (and linking clang against it). llvm-svn: 151632
* Remove stray semi-colons.Daniel Dunbar2012-02-281-2/+2
| | | | llvm-svn: 151631
* [analyzer] Leaks should be uniqued by the allocation point in theAnna Zaks2012-02-281-5/+12
| | | | | | closest function context (Keychain API). llvm-svn: 151613
* [analyzer] Fix Malloc False Positive (PR 12100)Anna Zaks2012-02-282-8/+29
| | | | | | | | When allocated buffer is passed to CF/NS..NoCopy functions, the ownership is transfered unless the deallocator argument is set to 'kCFAllocatorNull'. llvm-svn: 151608
* Implement IRGen for the retain-autorelease in the lambda ↵Eli Friedman2012-02-283-2/+27
| | | | | | conversion-to-block-pointer outside of ARC. Testcases coming up soon. llvm-svn: 151603
OpenPOWER on IntegriCloud