History log of /external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
6bcf27bb9a4b5c3f79cb44c0e4654a6d7619ad89 29-May-2014 Stephen Hines <srhines@google.com> Update Clang for 3.5 rebase (r209713).

Change-Id: I8c9133b0f8f776dc915f270b60f94962e771bc83
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
f4d02398936c0fdc9fe981348519fbc323f24ad0 01-May-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> Point diagnostics that complain about a use of a selector in an objc 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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@180833 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
20bcd4ead46e3764a5d1279845f8ed351f4d3984 04-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Allow removing an -autorelease of a variable initialized in the previous statement.

rdar://11074996

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171485 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
af1c08f216cf1ed541d9f502f6c8944d5fd4320c 04-Jan-2013 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Don't error if an autoreleased variable is returned after the -autorelease.

rdar://12952025

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@171482 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
9852f58f50b4fc20914fbce5b4454135a42343f4 01-Dec-2012 Benjamin Kramer <benny.kra@googlemail.com> Don't include Type.h in DeclarationName.h.

Recursively prune some includes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169094 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
accaf19bc1129c0273ec50dba52318e60bc29103 14-Nov-2012 Benjamin Kramer <benny.kra@googlemail.com> s/tranform/transform/

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@167929 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
471c8b49982d1132f30b0b0da27fef94fd6e4f67 04-Jul-2012 Benjamin Kramer <benny.kra@googlemail.com> Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@159723 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
76a5245d7fb558625453ebe2281ee0bc9c93c245 07-Jun-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] At an unbridged cast error, if we're returning a load-of-ivar from a +0 method,
automatically insert a __bridge cast.

radar://11560638

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158127 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
1b8fbd3601e009803565e74d2ec54abecb5cbf73 23-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Remove an unused -autorelease, without failing with error, for this
idiom that is used commonly in setters:

[backingValue autorelease];
backingValue = [newValue retain]; // in general a +1 assign

rdar://9914061

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157347 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
5a42a0292ad4d11ccf0ae9d06f6c15c3c811adfd 21-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Revert r156999 "Remove the "it is not safe to remove an unused 'autorelease' message" ARC
migration error".

Per feedback from John this is useful to have in general.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@157198 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
b6a1b10a8d9e0405b7a0d12273623c7f4d23f7d9 17-May-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Remove the "it is not safe to remove an unused 'autorelease' message" ARC
migration error.

This is more trouble that it is worth; autoreleasing a value without holding on it
is a valid use-case, we should not "punish" correct code for the minority of
broken/fragile programs that depend on the behavior of -autorelease.

rdar://9914061

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@156999 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
4e4d08403ca5cfd4d558fa2936215d3a4e5a528d 11-Mar-2012 David Blaikie <dblaikie@gmail.com> Unify naming of LangOptions variable/get function across the Clang stack (Lex to AST).

The member variable is always "LangOpts" and the member function is always "getLangOpts".

Reviewed by Chris Lattner

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152536 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
30660a898545416f0fea2d717f16f75640001e38 06-Mar-2012 Ted Kremenek <kremenek@apple.com> Add new code migrator support for migrating existing Objective-C code to use
the new Objective-C NSArray/NSDictionary/NSNumber literal syntax.

This introduces a new library, libEdit, which provides a new way to support
migration of code that improves on the original ARC migrator. We now believe
that most of its functionality can be refactored into the existing libraries,
and thus this new library may shortly disappear.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@152141 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
6f42b62b6194f53bcbc349f5d17388e1936535d7 05-Feb-2012 Dylan Noblesmith <nobled@dreamwidth.org> Basic: import OwningPtr<> into clang namespace

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@149798 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
4b9c2d235fb9449e249d74f48ecfec601650de93 06-Nov-2011 John McCall <rjmccall@apple.com> Change the AST representation of operations on Objective-C
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.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143867 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
e7ef8556f4ee3012a0479308c993af0fbee448df 04-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] For GC, cleanup and turn -finalize to -dealloc.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143701 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
18fd0c6915b45c4daafe18e3cd324c13306f913f 27-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] More automatic transformations and safety improvements; rdar://9615812 :

- 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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@136208 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
5f9e272e632e951b1efe824cd16acb4d96077930 23-Jul-2011 Chris Lattner <sabre@nondot.org> remove unneeded llvm:: namespace qualifiers on some core types now that LLVM.h imports
them into the clang namespace.


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135852 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
82a921a1a4811f2d6411bcafcb2b7d59a4dd9080 16-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] It's not safe to remove the -release on "[[someivar delegate] release];" since it's very likely
that, after migration, the object that was passed to 'setDelegate:' will not be properly retained, e.g:

-whatever {
id x = [[MyDoHicky alloc] init];
[someivar setDelegate: x]; // x won't get retained in ARC.
}
-dealloc {
[[someivar delegate] release]; // give migration error here.
}

rdar://8858009

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135327 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
1aa60ff0ad1fb5bcb3042670dfdd7d5a8359d922 16-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Rewrite to "foo = nil;" not "foo = 0;", as suggested by Jordy.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135309 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
f55a869ba4c651943715d13d9b9c50a2e752a6ac 15-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] For:

id x = ...
@try {
...
} @finally {
[x release];
}

Migrator will drop the release. It's better to change it to "x = 0" in a @finally to avoid leak when exception is thrown.

rdar://9398256

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135301 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
2c18ca0575b60082f2a9f4563b4071071960d37c 15-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Don't remove retains/releases on a global variable, flag them with errors. rdar://9402555.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135213 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
2cd5366ff52b4592776ee4db27012d16fb995c62 15-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Allow -retain of an __unsafe_unretained receiver if the result gets used.
Keep the error if the result is unused. rdar://9552694.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135209 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
e0e40768cc8c4b2a9093dac3d777e0d362cb7a88 14-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Emit an error for unused -autorelease messages.

An unused autorelease is badness. If we remove it the receiver
will likely die immediately while previously it was kept alive
by the autorelease pool. This is bad practice in general, so leave it
and emit an error to force the user to restructure his code.

rdar://9599884

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135193 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
7e5e5f4cc36fe50f46ad76dca7a266434c94f475 07-Jul-2011 John McCall <rjmccall@apple.com> In ARC, reclaim all return values of retainable type, not just those
where we have an immediate need of a retained value.

As an exception, don't do this when the call is made as the immediate
operand of a __bridge retain. This is more in the way of a workaround
than an actual guarantee, so it's acceptable to be brittle here.

rdar://problem/9504800



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134605 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
b1094a0621c3bf91141f7cd9684ca80b357ae61e 23-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Fully migrate ObjC++ classes, rdar://9660007.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133763 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp
7196d06c2fb020a91a26e727be1871110b4a0dc9 21-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Break apart Transforms.cpp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133539 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransRetainReleaseDealloc.cpp