History log of /external/clang/lib/ARCMigrate/TransProperties.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/TransProperties.cpp
651f13cea278ec967336033dd032faef0e9fc2ec 24-Apr-2014 Stephen Hines <srhines@google.com> Updated to Clang 3.5a.

Change-Id: I8127eb568f674c2e72635b639a3295381fe8af82
/external/clang/lib/ARCMigrate/TransProperties.cpp
d329724745b49f894b768d47275b7c2713106e89 17-Jan-2013 Douglas Gregor <dgregor@apple.com> Rework the traversal of Objective-C categories and extensions to
consider (sub)module visibility.

The bulk of this change replaces myriad hand-rolled loops over the
linked list of Objective-C categories/extensions attached to an
interface declaration with loops using one of the four new category
iterator kinds:

visible_categories_iterator: Iterates over all visible categories
and extensions, hiding any that have their "hidden" bit set. This is
by far the most commonly used iterator.

known_categories_iterator: Iterates over all categories and
extensions, ignoring the "hidden" bit. This tends to be used for
redeclaration-like traversals.

visible_extensions_iterator: Iterates over all visible extensions,
hiding any that have their "hidden" bit set.

known_extensions_iterator: Iterates over all extensions, whether
they are visible to normal name lookup or not.

The effect of this change is that any uses of the visible_ iterators
will respect module-import visibility. See the new tests for examples.

Note that the old accessors for categories and extensions are gone;
there are *Raw() forms for some of them, for those (few) areas of the
compiler that have to manipulate the linked list of categories
directly. This is generally discouraged.

Part two of <rdar://problem/10634711>.




git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@172665 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
135aa60c613bdcc0e8e237b12bf93cab04284419 12-Dec-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [objc] For the ARC error that is emitted when a synthesized property implementation
has inconsistent ownership with the backing ivar, point the error location to the
ivar.

Pointing to the ivar (instead of the @synthesize) is better since this is where a fix is needed.
Also provide the location of @synthesize via a note.

This also fixes the problem where an auto-synthesized property would emit an error without
any location.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@170039 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
55fc873017f10f6f566b182b70f6fc22aefa3464 04-Dec-2012 Chandler Carruth <chandlerc@gmail.com> Sort all of Clang's files under 'lib', and fix up the broken headers
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.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@169237 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.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/TransProperties.cpp
581deb3da481053c4993c7600f97acf7768caac5 06-Jun-2012 David Blaikie <dblaikie@gmail.com> Revert Decl's iterators back to pointer value_type rather than reference value_type

In addition, I've made the pointer and reference typedef 'void' rather than T*
just so they can't get misused. I would've omitted them entirely but
std::distance likes them to be there even if it doesn't use them.

This rolls back r155808 and r155869.

Review by Doug Gregor incorporating feedback from Chandler Carruth.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@158104 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.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/TransProperties.cpp
262bc18e32500558af7cb0afa205b34bd37bafed 30-Apr-2012 David Blaikie <dblaikie@gmail.com> Remove the ref/value inconsistency in filter_decl_iterator.

filter_decl_iterator had a weird mismatch where both op* and op-> returned T*
making it difficult to generalize this filtering behavior into a reusable
library of any kind.

This change errs on the side of value, making op-> return T* and op* return
T&.

(reviewed by Richard Smith)

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@155808 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
0fd4a6869e9a12999af24b8df7a0275a0e6c18be 29-Mar-2012 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Fix a bug where a property in a class extension, that did not exist
in the interface, got its attribute rewritten twice, resulting in
'weakweak' or 'strongstrong'.

rdar://11047179

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153621 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
2f72ec9fc4d3c127b5c77e13346eb640deae396a 21-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> arg migrator: change all "assign" of object properties
to "strong" when migrating from GC. // rdar://10532449


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148607 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
86f960143c73f573919255c4465de71f85793c2e 20-Jan-2012 Fariborz Jahanian <fjahanian@apple.com> arc migrator: replace "retain" attribute with "strong"
which have same semantics in mrr as well as arr.
// rdar://10688312


git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@148559 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
6da4274724f6bd0f24f0fbfd1af076cd14b14710 28-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Integrate GC __weak into property attributes even when we don't have
the implementation.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145224 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
6d7d16d45c1d601483e46a77bd2fa1d199219721 28-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Don't add __weak if there is already a GC __weak and make sure to clear
__weak from a readonly property.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@145210 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
8b08eb34565a644d3345b1bfee3542a8f4a6c300 09-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Take into account that all properties are strong-by-default now and fix the test.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144146 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
af9b5e9f3eede62347835d8dedd44df86cbcc308 08-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Now that readonly properties are strong-by-default, do not add redundant 'strong'.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144136 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
ae7c25dab5ed7c8fc05462c8daf48e7d0945d364 08-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Now that properties are strong by default, avoid adding redundant '(strong)'
property attribute.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@144078 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
b0e1e121b32a9a04b39f1b77b3068bce2f3be05a 07-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] In GC, handle (assign) @properties.

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

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143979 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
bf8455c56cc5e328c31a2b56f5587cd0873ba0ae 07-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Map property decls to their GC attributes.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143978 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
1d5fb8f6e85a5c9c7b9b611be655454159c92f12 06-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Make PropertiesRewriter::getPropertyType return the unqualified type.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143884 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
f38fa73e605587abfa32ab6a39887cdebc0a320a 06-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Collect all the places where GC attributes __strong/__weak occur.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143883 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
b0d5db1b7cac1a0680877c17fe92c6d64cf1c730 06-Nov-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Refactor PropertiesRewriter to use MigrationContext.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@143882 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
44679012052b0d57f26a3aa141004687cb71a551 18-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Rewrite attributes in extensions as well. rdar://9992142

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142407 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
01b2b9bb154d69cc695717876e903329f6f0973c 18-Oct-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] In ARC default for properties is 'strong' so just remove a 'retain' if possible,
instead of changing it to 'strong'. rdar://9984862.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@142304 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
33e56f3273457bfa22c7c50bc46cf5a18216863d 10-Sep-2011 John McCall <rjmccall@apple.com> Rename the ARC cast kinds to start with "ARC".



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@139466 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
94a9016a6b92cfebdb0b7d4dcad930248f1f301a 10-Aug-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] When checking whether properties needs to be strong or not, take into account
that assigning result of -retain means it should be strong. rdar://9931757.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@137252 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.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/TransProperties.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/TransProperties.cpp
968860904a65619899c9f38673c8236a81240d93 13-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Add weak/unsafe_unretained for "@property (readonly)" when we are @synthesizing it.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135067 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
14c4b4405fdbb54445c2d2d6320ed4f9e2326696 13-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] For properties rewrite 'assign' -> 'weak or unsafe_unretained', 'retain' -> 'strong', and add
'weak or unsafe_unretained' when 'assign' is missing. rdar://9496219&9602589.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135065 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
86625b5650cdddc38c0b4cc1eb7fb460478c9d11 13-Jul-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> [arcmt] Before applying '__weak' check whether the objc class is annotated with objc_arc_weak_reference_unavailable
or is in a list of classes not supporting 'weak'.

rdar://9489367.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@135002 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
9f084a3166b684573ba49df28fc5792bc37d92e1 06-Jul-2011 John McCall <rjmccall@apple.com> Change the driver's logic about Objective-C runtimes: abstract out a
structure to hold inferred information, then propagate each invididual
bit down to -cc1. Separate the bits of "supports weak" and "has a native
ARC runtime"; make the latter a CodeGenOption.

The tool chain is still driving this decision, because it's the place that
has the required deployment target information on Darwin, but at least it's
better-factored now.



git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@134453 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.cpp
b8b0313e84700b5c6d597b3be4de41c97b7550f1 24-Jun-2011 Argyrios Kyrtzidis <akyrtzi@gmail.com> Rename objc_lifetime -> objc_ownership, and modify diagnostics to talk about 'ownership', not 'lifetime'.

rdar://9477613.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133779 91177308-0d34-0410-b5e6-96231b3b80d8
/external/clang/lib/ARCMigrate/TransProperties.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/TransProperties.cpp