Commit Graph

317 Commits

Author SHA1 Message Date
Fariborz Jahanian bed1be926d ObjectiveC migrator. Another alternative to
"atomic" or "nonatomic" for properties is
NS_NONATOMIC_IOSONLY. Use it if available.
// rdar://15442742

llvm-svn: 194503
2013-11-12 19:25:50 +00:00
Fariborz Jahanian 22626e7b49 ObjectiveC migrator. Added a dropped check in my
last patch.

llvm-svn: 194238
2013-11-08 02:00:22 +00:00
Fariborz Jahanian ec7cea925e ObjectiveC migrator. Fixes an obscure bug where
NS_RETURNS_INNER_POINTER ends up unintentionally 
on the @property under -objcmt-migrate-all 
// rdar://15396636

llvm-svn: 194233
2013-11-08 01:15:17 +00:00
Fariborz Jahanian 23417073ee ObjectiveC migrator. Please annotation of properties with
NS_RETURNS_INNER_POINTER under -objcmt-returns-innerpointer-property
flag (off by default), as older compilers do not support such annotations.
// rdar://15396636

llvm-svn: 194100
2013-11-05 22:28:30 +00:00
Fariborz Jahanian 071b98edec ObjectiveC migrator. When inferring readwrite property,
do not remove the setter if its availability differs
from availability of the getter (which is now turned into
a property). Otherwise, synthesized setter will
inherit availability of the property (which is incorrect).
// rdar://15300059

llvm-svn: 193837
2013-11-01 00:26:48 +00:00
Fariborz Jahanian d41dbadacd ObjectiveC migrator. Change naming hueristic for
deprecated categories, fixes a typo reported by
Jordan.

llvm-svn: 193759
2013-10-31 16:10:44 +00:00
Fariborz Jahanian 9d2ffea486 ObjectiveC migrator: annotate all protocols/methods in
a category with NSxxxDeprecated name with deprecated
annotation. // rdar://15337661

llvm-svn: 193726
2013-10-31 00:06:58 +00:00
Fariborz Jahanian 403425bba8 ObjectiveC migrator. Minor clean up of my last patch.
No functional change.

llvm-svn: 192933
2013-10-17 23:13:13 +00:00
Fariborz Jahanian de79e81686 ObjectiveC migrator. In infering NS_ENUM/NS_OPTIONS
macros, prefer the typedef immediately following the
enum declaration to the one preceeding it.
// rdar://15200915

llvm-svn: 192927
2013-10-17 22:23:32 +00:00
Fariborz Jahanian 1b6678767d ObjectiveC migrator. Remove blank lines
when inferring property from setter/getter
methods. // rdar://15200949

llvm-svn: 192853
2013-10-16 22:35:19 +00:00
Fariborz Jahanian 78bff0505e ObjectiveC migrator. Don't add 'assign' for
inferred properties when type is scalar and
assumed to be 'assign. // rdar://15231241

llvm-svn: 192841
2013-10-16 20:44:26 +00:00
Fariborz Jahanian 4a8865b145 ObjectiveC migrator. 'atomic' is the default attribute.
Don't add it to inferred property. // rdar://14988132

llvm-svn: 192834
2013-10-16 19:48:23 +00:00
Fariborz Jahanian 33304e3087 ObjectiveC migrator. Use 'assign' for 'delegate'
properties. // rdar://15231860

llvm-svn: 192826
2013-10-16 18:52:17 +00:00
Fariborz Jahanian 059e05eeef ObjectiveC migrator: Support for more possibility of
migration to NS_ENUM/NS_OPTIONS macros; when
typedef'ed to NSInteger/NSUInteger preceeds well
before of the enum declaration. // rdar://15201056

llvm-svn: 192645
2013-10-15 00:00:28 +00:00
Fariborz Jahanian 11dd4b1b56 ObjectiveC migrator. also support migration to
NS_ENUM/NS_OPTIONS macros when typedef declaration
precedes enum declaration. // rdar://15200915 

llvm-svn: 192506
2013-10-11 21:34:56 +00:00
Fariborz Jahanian 1d27ffd697 ObjectiveC migrator: fixes a bug when in NS_ENUM/NS_OPTIONS
migration, the typedef has annotations.
// rdar://15200602

llvm-svn: 192468
2013-10-11 17:35:22 +00:00
Fariborz Jahanian 9218f5178d ObjectiveC migrator. When migrating to NS_ENUM/NS_OPTIONS,
don't leave a blank line behind replacing the typedef
decl. // rdar://15200949

llvm-svn: 192407
2013-10-10 23:57:58 +00:00
Fariborz Jahanian 7c87b43d28 ObjectiveC migrator: For 'default' and 'shared' family of
methods, infer their self's type as their result type.
// rdar://15145218

llvm-svn: 192377
2013-10-10 18:23:13 +00:00
Fariborz Jahanian 20a1124ce5 ObjectiveC migrator. Introduce a new objcmt-atomic-property option
and use it to infer all properties as 'atomic'.
// rdar://14988132

llvm-svn: 192317
2013-10-09 19:06:08 +00:00
Fariborz Jahanian de557f84dd ObjectiveC migrator. Introduce a new print policy for
suppression of strong lifetime qualifiers when
inferring property. // rdar://15082812

llvm-svn: 192305
2013-10-09 17:37:28 +00:00
Fariborz Jahanian 3c593d63a1 ObjectiveC migrator: Add support for inferring
properties of function pointer type.
// rdar://15082812

llvm-svn: 192237
2013-10-08 21:32:16 +00:00
Fariborz Jahanian 02461d0218 ObjectiveC migration. Add support for inferring
properties of block pointer types. Also, remove
strong lifetime attribute from property type
in this migration. This is wip.
// rdar://15082818

llvm-svn: 192226
2013-10-08 20:14:24 +00:00
Fariborz Jahanian 8c45e283f2 ObjectiveC migrator: Add individual options and
enable them for distinct feature migration.
// rdar://15003157

llvm-svn: 191863
2013-10-02 22:49:59 +00:00
Fariborz Jahanian c121386170 ObjectiveC migrator. Starting distiguising different
migrations under their own option. 
wip and // rdar://15003157

llvm-svn: 191855
2013-10-02 21:32:39 +00:00
Fariborz Jahanian 182486c9d9 Objective-C migrator. Simplify migrator option
processing in preparation for adding several more
options. // rdar://15003157

llvm-svn: 191842
2013-10-02 17:08:12 +00:00
Fariborz Jahanian 8f5225b3a7 ObjectiveC migrator: When doing migration, migrator must suggest
migration of headers which have become system headers by user having put
the .system_framework in the sdk directory.
// rdar://15066802

llvm-svn: 191796
2013-10-01 21:16:29 +00:00
Fariborz Jahanian 5d783df5f7 ObjectiveC migrator. Infer property from getters only
if property name is a valid identifier in the underlying
language. // rdar://15044184

llvm-svn: 191584
2013-09-27 22:55:54 +00:00
Fariborz Jahanian 7c1a445c9e ObjectiveC migrator: Donlt annotate NS_RETURNS_INNER_POINTER
on class methods, as it makes no sense. // rdar://15069200

llvm-svn: 191468
2013-09-26 22:43:41 +00:00
Fariborz Jahanian 73466cafc1 ObjectiveC migrator: function pointer is not an
inner pointer for annotation to
objc_returns_inner_pointer purposes.
// rdar://15044991

llvm-svn: 191465
2013-09-26 21:43:47 +00:00
Fariborz Jahanian 7391a7b5aa ObjectiveC migrator. Don't suggest @property for
methods which look like getters but belong to
known family of methods. // rdar://15044058

llvm-svn: 191347
2013-09-25 00:17:07 +00:00
Fariborz Jahanian 7797c0d0f7 ObjectiveC migrator: provide space between the property
keyword and the rest on suggested property. // rdar://15069044

llvm-svn: 191335
2013-09-24 21:27:58 +00:00
Fariborz Jahanian 10b7435ceb ObjectiveC migrator: iDOn't mangle names when
NS_RETURNS_INNER_POINTER annotation is suggested on
a property. // rdar://15044991

llvm-svn: 191332
2013-09-24 20:20:52 +00:00
Fariborz Jahanian 1a73b8f7d2 Remove extra space.
llvm-svn: 191246
2013-09-23 23:48:04 +00:00
Fariborz Jahanian c71eb6adc3 ObjectiveC migrator. When migrating to property declaration
use Cocoa's naming convention for properties of ObjC
object type. // rdar://15045005

llvm-svn: 191240
2013-09-23 23:18:46 +00:00
Fariborz Jahanian 02bdb16524 ObjectiveC migrator: Infer NS_OPTIONS when if there is at
least one hex enumerator, all others are also
hex enumerator (0 enumerator is excepted). 
// rdar://15044304

llvm-svn: 191222
2013-09-23 20:27:06 +00:00
Fariborz Jahanian 1c900bcf26 ObjectiveC migrator: For consistency, also infer
'instancetype' for known family of methods
with related result type; such as 'init'
methods. // rdar://14987948

llvm-svn: 190956
2013-09-18 20:35:47 +00:00
Fariborz Jahanian 2ba62a7206 ObjectiveC migrator: Infer property in the presense
of methods annotated with attributes. 
// rdar://14987909

llvm-svn: 190947
2013-09-18 17:22:25 +00:00
Fariborz Jahanian e47a14addc ObjectiveC migrator: placing another check for
'deprecated' container before doing the 'instancetype'
inference.

llvm-svn: 190943
2013-09-18 15:43:52 +00:00
Fariborz Jahanian 6e1798e36a ObjectiveC migrator. infer NS_OPTIONS correctly in the
presense of parenthesized enumerator initializers.

llvm-svn: 190901
2013-09-17 23:32:51 +00:00
Fariborz Jahanian f6c6505eaa ObjectiveC migrator: Don't infer property from
'deprected' setters either. // rdar://14989365

llvm-svn: 190894
2013-09-17 22:41:25 +00:00
Fariborz Jahanian 75226d5c0d ObjectiveC migrator. Ignore migrating 'deprecated'
entities. // rdar://14989365

llvm-svn: 190890
2013-09-17 21:56:04 +00:00
Fariborz Jahanian 4c3d9c5e24 ObjectiveC migrator: Don't infer a property from isXXX method
of retainable object (readonly or otherwise).

llvm-svn: 190881
2013-09-17 19:38:55 +00:00
Argyrios Kyrtzidis 85230d50f2 [arcmt] Don't try to handle files that are already ARC'ified, this is not possible currently.
rdar://14461559

llvm-svn: 190880
2013-09-17 19:14:29 +00:00
Fariborz Jahanian 92f7242a56 ObjectiveC migrator. Infer property in categories
declared as getter with or without setter method.
// rdar://15010020

llvm-svn: 190878
2013-09-17 19:00:30 +00:00
Cameron Esfahani 556d91e2c3 Clean up some Triple usage in clang.
llvm-svn: 190737
2013-09-14 01:09:11 +00:00
Fariborz Jahanian 47502c11f5 ObjectiveC migration. NS_RETURNS_NOT_RETAINED is the default for
unknown methods which return Cocoa objects. No need to annotate
such methods.

llvm-svn: 190555
2013-09-11 22:46:09 +00:00
Fariborz Jahanian 34fea36340 ObjectiveC migrator. Modify inferred property name
such that it does not lower case the staring property
name if getter name (after "get" prefix) starts with 
two upper case letters.

llvm-svn: 190539
2013-09-11 18:27:16 +00:00
Fariborz Jahanian ca39960f31 ObjectiveC migrator. methods which look like a getter and
start with "get" are inferreed as a readonly properties.

llvm-svn: 190532
2013-09-11 17:05:15 +00:00
Fariborz Jahanian c02bfb9a85 ObjectiveC migrator: rename inferred isXXX property,
with a suitable 'getter' attribute.

llvm-svn: 190420
2013-09-10 18:39:32 +00:00
Fariborz Jahanian 9d5fffb425 ObjectiveC migrator. Do not infer NS_RETURNS_INNER_POINTER
annotation on methods which return typedef of pointer to 
an incomplete struct type.

llvm-svn: 190372
2013-09-09 23:56:14 +00:00