summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/TransAPIUses.cpp
Commit message (Collapse)AuthorAgeFilesLines
* s/tranform/transform/Benjamin Kramer2012-11-141-1/+1
| | | | llvm-svn: 167929
* Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.Benjamin Kramer2012-07-041-0/+1
| | | | llvm-svn: 159723
* [arcmt] Revert r135382, there's a different approach in r135764. rdar://9821111.Argyrios Kyrtzidis2011-07-271-35/+0
| | | | llvm-svn: 136209
* [arcmt] More automatic transformations and safety improvements; rdar://9615812 :Argyrios Kyrtzidis2011-07-271-1/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - 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
* remove unneeded llvm:: namespace qualifiers on some core types now that ↵Chris Lattner2011-07-231-1/+0
| | | | | | | | LLVM.h imports them into the clang namespace. llvm-svn: 135852
* [arcmt] When a NSData's 'bytes' family of methods are used on a local var,Argyrios Kyrtzidis2011-07-181-0/+34
| | | | | | | | | add __attribute__((objc_precise_lifetime)) to make sure that the object (and its data) will not get released before the var goes out-of-scope. rdar://9206226 llvm-svn: 135382
* [arcmt] NSInvocation's [get/set]ReturnValue and [get/set]Argument are only safeArgyrios Kyrtzidis2011-07-181-0/+89
with __unsafe_unretained parameters. Emit error for strong/weak ones. rdar://9206226 llvm-svn: 135381
OpenPOWER on IntegriCloud