summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate
Commit message (Collapse)AuthorAgeFilesLines
...
* [arcmt] Integrate GC __weak into property attributes even when we don't haveArgyrios Kyrtzidis2011-11-284-49/+62
| | | | | | the implementation. llvm-svn: 145224
* [arcmt] Don't add __weak if there is already a GC __weak and make sure to clearArgyrios Kyrtzidis2011-11-282-7/+14
| | | | | | __weak from a readonly property. llvm-svn: 145210
* Refine placement of LangOptions object in CompilerInvocation by adding a new ↵Ted Kremenek2011-11-181-1/+0
| | | | | | baseclass CompilerInvocationBase with a custom copy constructor. This ensures that whenever the CompilerInvocation object's copy constructor is used we always clone the LangOptions object. llvm-svn: 144973
* Make 'LangOptions' in CompilerInvocation a heap-allocated, reference counted ↵Ted Kremenek2011-11-171-11/+12
| | | | | | | | | | | | | | | | | object. I discovered that llvm::RefCountedBase<T> has a bug where the reference count is copied in the copy constructor, which means that there were cases when the CompilerInvocation objects created by ASTUnit were actually leaked. When I fixed that bug locally, it showed that a whole bunch of code assumed that the LangOptions object that was part of CompilerInvocation was still alive. By making it heap-allocated and reference counted, we can keep it around after the CompilerInvocation object goes away. As part of this change, change CompilerInvocation:getLangOptions() to return a pointer, acting as another clue that this object may outlive the CompilerInvocation object. This commit doesn't fix the CompilerInvocation leak itself. That will come when I commit the fix to llvm::RefCountedBase<T> to mainline LLVM. llvm-svn: 144930
* [arcmt] Take into account that all properties are strong-by-default now and ↵Argyrios Kyrtzidis2011-11-081-42/+7
| | | | | | fix the test. llvm-svn: 144146
* [arcmt] Now that readonly properties are strong-by-default, do not add ↵Argyrios Kyrtzidis2011-11-081-1/+1
| | | | | | redundant 'strong'. llvm-svn: 144136
* [arcmt] Now that properties are strong by default, avoid adding redundant ↵Argyrios Kyrtzidis2011-11-081-2/+4
| | | | | | | | '(strong)' property attribute. llvm-svn: 144078
* [arcmt] NSViewController does not support weak.Argyrios Kyrtzidis2011-11-081-0/+1
| | | | llvm-svn: 144077
* [arcmt] When we already removed a __weak, don't try to change it to ↵Argyrios Kyrtzidis2011-11-082-2/+6
| | | | | | | | __unsafe_unretained later on, or we will end up with a redundant '__unsafe_unretained'. llvm-svn: 144059
* [arcmt] Fix handling NSMakeCollectable inside an objc method.Argyrios Kyrtzidis2011-11-071-1/+2
| | | | llvm-svn: 143980
* [arcmt] In GC, handle (assign) @properties.Argyrios Kyrtzidis2011-11-074-130/+269
| | | | | | | | | -Move __strong/__weak added to a property type to the property attribute, e.g. "@property (assign) __weak Foo *prop;" --> "@property (weak) Foo *prop;" -Remove (assign) in a property so that it becomes strong-by-default in ARC. llvm-svn: 143979
* [arcmt] Map property decls to their GC attributes.Argyrios Kyrtzidis2011-11-073-3/+12
| | | | llvm-svn: 143978
* [arcmt] In GC, change '__weak' -> '__unsafe_unretained' when appliedArgyrios Kyrtzidis2011-11-073-5/+33
| | | | | | to objects of classes that don't support ARC weak llvm-svn: 143976
* [arcmt] In GC, error for __strong/__weak on non-objc pointers.Argyrios Kyrtzidis2011-11-061-0/+18
| | | | llvm-svn: 143887
* [arcmt] In GC, clear redundant __strong's.Argyrios Kyrtzidis2011-11-062-8/+34
| | | | llvm-svn: 143886
* [arcmt] Make PropertiesRewriter::getPropertyType return the unqualified type.Argyrios Kyrtzidis2011-11-061-4/+3
| | | | llvm-svn: 143884
* [arcmt] Collect all the places where GC attributes __strong/__weak occur.Argyrios Kyrtzidis2011-11-066-6/+224
| | | | llvm-svn: 143883
* [arcmt] Refactor PropertiesRewriter to use MigrationContext.Argyrios Kyrtzidis2011-11-063-4/+35
| | | | llvm-svn: 143882
* Change the AST representation of operations on Objective-CJohn McCall2011-11-063-23/+59
| | | | | | | | | | | | | | | | | | | | | | | | | | | | property references to use a new PseudoObjectExpr expression which pairs a syntactic form of the expression with a set of semantic expressions implementing it. This should significantly reduce the complexity required elsewhere in the compiler to deal with these kinds of expressions (e.g. IR generation's special l-value kind, the static analyzer's Message abstraction), at the lower cost of specifically dealing with the odd AST structure of these expressions. It should also greatly simplify efforts to implement similar language features in the future, most notably Managed C++'s properties and indexed properties. Most of the effort here is in dealing with the various clients of the AST. I've gone ahead and simplified the ObjC rewriter's use of properties; other clients, like IR-gen and the static analyzer, have all the old complexity *and* all the new complexity, at least temporarily. Many thanks to Ted for writing and advising on the necessary changes to the static analyzer. I've xfailed a small diagnostics regression in the static analyzer at Ted's request. llvm-svn: 143867
* [arcmt] Fix an assertion hit in rdar://10336125; a bit too complicated to ↵Argyrios Kyrtzidis2011-11-051-0/+3
| | | | | | reduce. llvm-svn: 143754
* [arcmt] In GC, error out when there is a call that returns a pointer toArgyrios Kyrtzidis2011-11-044-0/+43
| | | | | | GC managed non-objc object memory. llvm-svn: 143747
* [arcmt] For GC, cleanup and turn -finalize to -dealloc.Argyrios Kyrtzidis2011-11-045-20/+54
| | | | llvm-svn: 143701
* [arcmt] In GC, error for use of CFMakeCollectable because it will leak theArgyrios Kyrtzidis2011-11-041-5/+15
| | | | | | object that it receives in ARC. llvm-svn: 143700
* In C++ keep unavailable function calls in the AST, like in C/ObjC.Argyrios Kyrtzidis2011-11-041-0/+1
| | | | | | This allows the migrator to visit and fix them. llvm-svn: 143699
* [arcmt] In GC, transform NSMakeCollectable to CFBridgingRelease.Argyrios Kyrtzidis2011-11-046-8/+181
| | | | llvm-svn: 143698
* Further refine the diagnostic categories for ARC diagnostics. Addresses ↵Ted Kremenek2011-10-202-12/+1
| | | | | | <rdar://problem/10245086>. llvm-svn: 142571
* [arcmt] Rewrite attributes in extensions as well. rdar://9992142Argyrios Kyrtzidis2011-10-181-17/+83
| | | | llvm-svn: 142407
* Revert r142311, -mios-simulator-version-min does not work correctly.Argyrios Kyrtzidis2011-10-181-0/+43
| | | | llvm-svn: 142322
* Remove the hack where we sniff the __IPHONE_OS_VERSION_MIN_REQUIRED define.Argyrios Kyrtzidis2011-10-171-43/+0
| | | | | | We can use -mios-simulator-version-min now. rdar://10218700 llvm-svn: 142311
* [arcmt] In ARC default for properties is 'strong' so just remove a 'retain' ↵Argyrios Kyrtzidis2011-10-171-3/+37
| | | | | | | | if possible, instead of changing it to 'strong'. rdar://9984862. llvm-svn: 142304
* Introduce a pure virtual clone() method to DiagnosticConsumer, so thatDouglas Gregor2011-09-291-1/+7
| | | | | | | | | we have the ability to create a new, distict diagnostic consumer when we go off and build a module. This avoids the currently horribleness where the same diagnostic consumer sees diagnostics for multiple translation units (and multiple SourceManagers!) causing all sorts of havok. llvm-svn: 140743
* When 'bool' is not a built-in type but is defined as a macro, printDouglas Gregor2011-09-271-3/+3
| | | | | | | 'bool' rather than '_Bool' within types, to make things a bit more readable. Fixes <rdar://problem/10063263>. llvm-svn: 140650
* Rename DiagnosticInfo to Diagnostic as per issue 5397David Blaikie2011-09-261-1/+1
| | | | llvm-svn: 140493
* Rename CaptureDiagnosticClient to CaptureDiagnosticConsumer as per issue 5397David Blaikie2011-09-251-4/+4
| | | | llvm-svn: 140482
* Rename DiagnosticClient to DiagnosticConsumer as per issue 5397David Blaikie2011-09-251-9/+9
| | | | llvm-svn: 140479
* Rename Diagnostic to DiagnosticsEngine as per issue 5397David Blaikie2011-09-255-32/+32
| | | | llvm-svn: 140478
* Rename SourceLocation::getFileLocWithOffset -> getLocWithOffset.Argyrios Kyrtzidis2011-09-193-3/+3
| | | | | | It already works (and is useful with) macro locs as well. llvm-svn: 140057
* [arcmt] Use __bridge_retained when passing an objc object to a CF parameterArgyrios Kyrtzidis2011-09-141-0/+28
| | | | | | annotated with cf_consumed attribute. llvm-svn: 139709
* Rename the ARC cast kinds to start with "ARC".John McCall2011-09-102-3/+3
| | | | llvm-svn: 139466
* Give conversions of block pointers to ObjC pointers a different cast kindJohn McCall2011-09-091-1/+1
| | | | | | | | than conversions of C pointers to ObjC pointers. In order to ensure that we've caught every case, add asserts to CastExpr that strictly determine which cast kind is used for which kind of bit cast. llvm-svn: 139352
* [arcmt] Fix test/ARCMT/remove-statements.m regression due toArgyrios Kyrtzidis2011-09-013-32/+73
| | | | | | | | Objective-C method buffering(rdar://10056942) Turned out the same issue existed for C++ inline methods. llvm-svn: 138960
* Twinify.Benjamin Kramer2011-08-271-21/+15
| | | | llvm-svn: 138689
* Try to unbreak the build on systems where uint64_t isn't something that ↵Douglas Gregor2011-08-261-1/+1
| | | | | | StringRef::getAsInteger can handle as its second argument llvm-svn: 138680
* [arcmt] Add a test case for r138671 and improve the loop.Argyrios Kyrtzidis2011-08-261-4/+1
| | | | llvm-svn: 138674
* [arcmt] Fix horrible bug where migrating files if there is a space in the pathsArgyrios Kyrtzidis2011-08-261-12/+15
| | | | | | of the migrated files. rdar://10022801 llvm-svn: 138671
* For the MacroExpands preprocessor callback, also pass the SourceRangeArgyrios Kyrtzidis2011-08-181-1/+2
| | | | | | of expansion (for function macros it includes the right paren). llvm-svn: 137909
* Fix "Uninitialized" warnings on g++-4.4.NAKAMURA Takumi2011-08-141-1/+1
| | | | | | In fact, they are false warnings but it seems g++-4.4 might be unable to know they must be false. llvm-svn: 137568
* [arcmt] When checking whether properties needs to be strong or not, take ↵Argyrios Kyrtzidis2011-08-101-0/+5
| | | | | | | | into account that assigning result of -retain means it should be strong. rdar://9931757. llvm-svn: 137252
* Make helper functions static.Benjamin Kramer2011-08-021-4/+5
| | | | llvm-svn: 136679
* [arcmt] Revert r135382, there's a different approach in r135764. rdar://9821111.Argyrios Kyrtzidis2011-07-271-35/+0
| | | | llvm-svn: 136209
OpenPOWER on IntegriCloud