summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/Transforms.h
Commit message (Collapse)AuthorAgeFilesLines
* Update the file headers across all of the LLVM projects in the monorepoChandler Carruth2019-01-191-4/+3
| | | | | | | | | | | | | | | | | to reflect the new license. We understand that people may be surprised that we're moving the header entirely to discuss the new license. We checked this carefully with the Foundation's lawyer and we believe this is the correct approach. Essentially, all code in the project is now made available by the LLVM project under our new license, so you will see that the license headers include that license only. Some of our contributors have contributed code under our old license, and accordingly, we have retained a copy of our old license notice in the top-level files in each project and repository. llvm-svn: 351636
* Remove trailing spaceFangrui Song2018-07-301-1/+1
| | | | | | sed -Ei 's/[[:space:]]+$//' include/**/*.{def,h,td} lib/**/*.{cpp,h} llvm-svn: 338291
* Remove \brief commands from doxygen comments.Adrian Prantl2018-05-091-6/+6
| | | | | | | | | | | | | | | | | | | This is similar to the LLVM change https://reviews.llvm.org/D46290. We've been running doxygen with the autobrief option for a couple of years now. This makes the \brief markers into our comments redundant. Since they are a visual distraction and we don't want to encourage more \brief markers in new code either, this patch removes them all. Patch produced by for i in $(git grep -l '\@brief'); do perl -pi -e 's/\@brief //g' $i & done for i in $(git grep -l '\\brief'); do perl -pi -e 's/\\brief //g' $i & done Differential Revision: https://reviews.llvm.org/D46320 llvm-svn: 331834
* [modules] Stop trying to fake up a linear MacroDirective history.Richard Smith2015-04-291-1/+1
| | | | | | | | | | | | | | Modules builds fundamentally have a non-linear macro history. In the interest of better source fidelity, represent the macro definition information faithfully: we have a linear macro directive history within each module, and at any point we have a unique "latest" local macro directive and a collection of visible imported directives. This also removes the attendent complexity of attempting to create a correct MacroDirective history (which we got wrong in the general case). No functionality change intended. llvm-svn: 236176
* [C++11] Use 'nullptr'.Craig Topper2014-05-071-1/+1
| | | | llvm-svn: 208163
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-141-5/+5
| | | | | | class. llvm-svn: 203893
* ObjectiveC migrator: fixes a bug when in NS_ENUM/NS_OPTIONSFariborz Jahanian2013-10-111-2/+4
| | | | | | | migration, the typedef has annotations. // rdar://15200602 llvm-svn: 192468
* ARCMigrate/Transforms.h: Remove \arg in comment. [-Wdocumentation]NAKAMURA Takumi2013-04-111-1/+1
| | | | llvm-svn: 179261
* [arcmt] Allow removing an -autorelease of a variable initialized in the ↵Argyrios Kyrtzidis2013-01-041-0/+1
| | | | | | | | previous statement. rdar://11074996 llvm-svn: 171485
* [arcmt] Adds brackets in case statements that "contain" initialization of ↵Argyrios Kyrtzidis2013-01-041-0/+5
| | | | | | | | | | retaining variable, thus emitting the "switch case is in protected scope" error. rdar://12952016 llvm-svn: 171484
* Sort all of Clang's files under 'lib', and fix up the broken headersChandler Carruth2012-12-041-1/+1
| | | | | | | | | | | | | uncovered. This required manually correcting all of the incorrect main-module headers I could find, and running the new llvm/utils/sort_includes.py script over the files. I also manually added quite a few missing headers that were uncovered by shuffling the order or moving headers up to be main-module-headers. llvm-svn: 169237
* s/tranform/transform/Benjamin Kramer2012-11-141-1/+1
| | | | llvm-svn: 167929
* [arcmt] At an unbridged cast error, if we're returning a load-of-ivar from a ↵Argyrios Kyrtzidis2012-06-071-2/+10
| | | | | | | | | | +0 method, automatically insert a __bridge cast. radar://11560638 llvm-svn: 158127
* [arcmt] Remove an unused -autorelease, without failing with error, for thisArgyrios Kyrtzidis2012-05-231-0/+2
| | | | | | | | | | | idiom that is used commonly in setters: [backingValue autorelease]; backingValue = [newValue retain]; // in general a +1 assign rdar://9914061 llvm-svn: 157347
* [arcmt]Argyrios Kyrtzidis2012-03-051-1/+5
| | | | | | | | | -Make sure we don't change to '__weak' a __block variable used as output. -Make sure we don't apply __weak twice. Fixes rdar://10520757&10521362 llvm-svn: 152020
* [arcmt] Integrate GC __weak into property attributes even when we don't haveArgyrios Kyrtzidis2011-11-281-0/+4
| | | | | | the implementation. llvm-svn: 145224
* [arcmt] When we already removed a __weak, don't try to change it to ↵Argyrios Kyrtzidis2011-11-081-0/+1
| | | | | | | | __unsafe_unretained later on, or we will end up with a redundant '__unsafe_unretained'. llvm-svn: 144059
* [arcmt] In GC, handle (assign) @properties.Argyrios Kyrtzidis2011-11-071-2/+5
| | | | | | | | | -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-071-1/+3
| | | | llvm-svn: 143978
* [arcmt] In GC, change '__weak' -> '__unsafe_unretained' when appliedArgyrios Kyrtzidis2011-11-071-1/+2
| | | | | | to objects of classes that don't support ARC weak llvm-svn: 143976
* [arcmt] In GC, clear redundant __strong's.Argyrios Kyrtzidis2011-11-061-0/+2
| | | | llvm-svn: 143886
* [arcmt] Collect all the places where GC attributes __strong/__weak occur.Argyrios Kyrtzidis2011-11-061-3/+20
| | | | llvm-svn: 143883
* [arcmt] Refactor PropertiesRewriter to use MigrationContext.Argyrios Kyrtzidis2011-11-061-1/+20
| | | | llvm-svn: 143882
* [arcmt] In GC, error out when there is a call that returns a pointer toArgyrios Kyrtzidis2011-11-041-0/+2
| | | | | | GC managed non-objc object memory. llvm-svn: 143747
* [arcmt] For GC, cleanup and turn -finalize to -dealloc.Argyrios Kyrtzidis2011-11-041-3/+3
| | | | llvm-svn: 143701
* [arcmt] In GC, transform NSMakeCollectable to CFBridgingRelease.Argyrios Kyrtzidis2011-11-041-0/+51
| | | | llvm-svn: 143698
* [arcmt] Fix test/ARCMT/remove-statements.m regression due toArgyrios Kyrtzidis2011-09-011-0/+6
| | | | | | | | Objective-C method buffering(rdar://10056942) Turned out the same issue existed for C++ inline methods. llvm-svn: 138960
* [arcmt] More automatic transformations and safety improvements; rdar://9615812 :Argyrios Kyrtzidis2011-07-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace calling -zone with 'nil'. -zone is obsolete in ARC. - Allow removing retain/release on a static global var. - Fix assertion hit when scanning for name references outside a NSAutoreleasePool scope. - Automatically add bridged casts for results of objc method calls and when calling CFRetain, for example: NSString *s; CFStringRef ref = [s string]; -> CFStringRef ref = (__bridge CFStringRef)([s string]); ref = s.string; -> ref = (__bridge CFStringRef)(s.string); ref = [NSString new]; -> ref = (__bridge_retained CFStringRef)([NSString new]); ref = [s newString]; -> ref = (__bridge_retained CFStringRef)([s newString]); ref = [[NSString alloc] init]; -> ref = (__bridge_retained CFStringRef)([[NSString alloc] init]); ref = [[s string] retain]; -> ref = (__bridge_retained CFStringRef)([s string]); ref = CFRetain(s); -> ref = (__bridge_retained CFTypeRef)(s); ref = [s retain]; -> ref = (__bridge_retained CFStringRef)(s); - Emit migrator error when trying to cast to CF type the result of autorelease/release: for CFStringRef f3() { return (CFStringRef)[[[NSString alloc] init] autorelease]; } emits: t.m:12:10: error: [rewriter] it is not safe to cast to 'CFStringRef' the result of 'autorelease' message; a __bridge cast may result in a pointer to a destroyed object and a __bridge_retained may leak the object return (CFStringRef)[[[NSString alloc] init] autorelease]; ^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ t.m:12:3: note: [rewriter] remove the cast and change return type of function to 'NSString *' to have the object automatically autoreleased return (CFStringRef)[[[NSString alloc] init] autorelease]; ^ - Before changing attributes to weak/unsafe_unretained, check if the backing ivar is set to a +1 object, in which case use 'strong' instead. llvm-svn: 136208
* [arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safeArgyrios Kyrtzidis2011-07-181-1/+3
| | | | | | with __unsafe_unretained parameters. Emit error for strong/weak ones. rdar://9206226 llvm-svn: 135381
* [arcmt] Don't remove retains/releases on a global variable, flag them with ↵Argyrios Kyrtzidis2011-07-141-0/+2
| | | | | | errors. rdar://9402555. llvm-svn: 135213
* [arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', ↵Argyrios Kyrtzidis2011-07-131-1/+1
| | | | | | | | 'retain' -> 'strong', and add 'weak or unsafe_unretained' when 'assign' is missing. rdar://9496219&9602589. llvm-svn: 135065
* [arcmt] Before applying '__weak' check whether the objc class is annotated ↵Argyrios Kyrtzidis2011-07-121-0/+3
| | | | | | | | | | with objc_arc_weak_reference_unavailable or is in a list of classes not supporting 'weak'. rdar://9489367. llvm-svn: 135002
* [arcmt] Fully migrate ObjC++ classes, rdar://9660007.Argyrios Kyrtzidis2011-06-231-19/+2
| | | | llvm-svn: 133763
* [arcmt] Remove rewriteAllocCopyWithZone transformation; not needed anymore.Argyrios Kyrtzidis2011-06-231-1/+0
| | | | llvm-svn: 133762
* [arcmt] Merge 'removeEmptyStatements' and 'removeDeallocMethod' passes to ↵Argyrios Kyrtzidis2011-06-211-2/+2
| | | | | | | | cut down on one compilation pass and increase migration speed. llvm-svn: 133540
* [arcmt] Break apart Transforms.cpp.Argyrios Kyrtzidis2011-06-211-0/+105
llvm-svn: 133539
OpenPOWER on IntegriCloud