summaryrefslogtreecommitdiffstats
path: root/clang/lib/ARCMigrate/TransAPIUses.cpp
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
* Port getLocStart -> getBeginLocStephen Kelly2018-08-091-1/+1
| | | | | | | | | | Reviewers: teemperor! Subscribers: jholewinski, whisperity, jfb, cfe-commits Differential Revision: https://reviews.llvm.org/D50350 llvm-svn: 339385
* [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
* ARCMigrate: Introduce proper diagnostics for TransformActionsAlp Toker2014-01-261-9/+7
| | | | | | | | | | | | | | | This starts to switch ARCMT to use proper diagnostic messages. The old use was based on incorrect example code from the documentation. The logic of the previous report() functions has been retained to support any external consumers that might be intercepting diagnostic messages through the old interface. Note that the change in test/Misc/warning-flags.c isn't a new warning without a flag, rather one that was previously invisible to the test. Adding a flag might be a good idea though. llvm-svn: 200124
* Point diagnostics that complain about a use of a selector in an objc ↵Argyrios Kyrtzidis2013-05-011-2/+2
| | | | | | | | | | | | message, to the selector location. Previously it would point to the left bracket or the receiver, which can be particularly problematic if the receiver is a block literal and we end up point the diagnostic far away for the selector that is complaining about. rdar://13620447 llvm-svn: 180833
* 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