Fariborz Jahanian
b918d7a67b
ObjectibeC migrator. Annotate cf_consumed arguments,
...
as reported by static analyer API with CF_CONSUMED.
llvm-svn: 188922
2013-08-21 19:37:47 +00:00
Fariborz Jahanian
447b15ef22
ObjectiveC migrator: until we have beter understanding of
...
setter/getter implementations, migrate them to
nonatomic properties.
llvm-svn: 188914
2013-08-21 18:49:03 +00:00
Fariborz Jahanian
b834352609
ObjectiveC migrator. make sure to embed audited
...
candidate functions in their CF_IMPLICIT_BRIDGING_ENABLED
pragma before exiting the header file.
llvm-svn: 188846
2013-08-20 23:35:26 +00:00
Fariborz Jahanian
301b52145f
ObjectiveC migrator: make sure audited pragams are
...
dumped for last declarations in the current TU. wip.
llvm-svn: 188838
2013-08-20 22:42:13 +00:00
Fariborz Jahanian
5874e6d384
ObjectiveC migrator: More tweaking of heuristics
...
for an audited cf function to not include those
which are annotated by user.
llvm-svn: 188823
2013-08-20 20:45:28 +00:00
Fariborz Jahanian
9427939f65
ObjectiveC migrator: More tweaking of heuristics
...
for an audited cf function and addition of
a test case.
llvm-svn: 188816
2013-08-20 18:54:39 +00:00
Fariborz Jahanian
d38ad47cfa
ObjectiveC migrator: More work towards
...
insertion of ObjC audit pragmas.
llvm-svn: 188733
2013-08-20 00:07:23 +00:00
Fariborz Jahanian
c6dfd3f8f2
ObjectiveC migrator: Start inserting
...
CF_IMPLICIT_BRIDGING_ENABLE/CF_IMPLICIT_BRIDGING_DISABLED
pair. wip.
llvm-svn: 188714
2013-08-19 22:00:50 +00:00
Fariborz Jahanian
9ef4a26de8
ObjectiveC migrator. Start auditing CF functions
...
for possible use of CF_IMPLICIT_BRIDGING_ENABLE
pragma.
llvm-svn: 188691
2013-08-19 19:13:34 +00:00
Fariborz Jahanian
2ec4d7ba07
ObjectiveC migrator: Add some more routines
...
for future work. No change otherwise.
llvm-svn: 188591
2013-08-16 23:35:05 +00:00
Fariborz Jahanian
84ac1ded83
ObjectiveC migrator. Start annotating CF functions
...
with CF_RETURNS_RETAINED/CF_RETURNS_NOT_RETAINED as
appropriate.
llvm-svn: 188493
2013-08-15 21:44:38 +00:00
Fariborz Jahanian
0b48e7c6bd
Fixes a gross conditional in my last patch.
...
- This line, and those below, will be ignored--
M lib/ARCMigrate/ObjCMT.cpp
llvm-svn: 188473
2013-08-15 18:58:00 +00:00
Fariborz Jahanian
be7bc11f94
ObjectiveC migrator: In deciding NS_OPTION over
...
NS_ENUM, at least one power of 2 enumerator
must be greater than two.
llvm-svn: 188470
2013-08-15 18:46:37 +00:00
Fariborz Jahanian
c13c1b0f0d
ObjectiveC migrator: Fixes a crash and makes couple
...
of harmless changes.
llvm-svn: 188303
2013-08-13 18:01:42 +00:00
Fariborz Jahanian
dfe6ed9660
ObjectiveC migration. Add couple of routine
...
, currently unused, for future cf-annotation work.
llvm-svn: 188224
2013-08-12 23:17:13 +00:00
Fariborz Jahanian
db8bf8313a
unbreak buildbot on Windows.
...
llvm-svn: 188018
2013-08-08 21:51:06 +00:00
Fariborz Jahanian
261fdb7a9a
ObjectiveC migrator: tighten rule about when to
...
migrate to @property with getter name starting with
'is'.
llvm-svn: 188013
2013-08-08 21:20:01 +00:00
Fariborz Jahanian
cf2ff9ba32
ObjectiveC migration: Handle another special case of
...
setter/getter methods which can be migrated to
a @property.
llvm-svn: 188005
2013-08-08 20:51:58 +00:00
Fariborz Jahanian
cf387c6afb
ObjectiveC migration: tweak setting of lifetime attribute
...
on @property migration. Don't set unsafe_unretained
on non-object properties. Set 'retain' on strong
properties. Makecertain properties with specific
names unsafe_unretained as well.
llvm-svn: 187810
2013-08-06 18:06:23 +00:00
Fariborz Jahanian
3bfc35e26a
ObjectiveC migrator. Differentiate 'instancetype'
...
from 'id' result type when deciding on migration
to instancetype.
llvm-svn: 187684
2013-08-02 22:34:18 +00:00
Fariborz Jahanian
9275c688ea
ObjectiveC migrator: Add another family of factory
...
methods which can be migrated to instancetype.
llvm-svn: 187672
2013-08-02 20:54:18 +00:00
Fariborz Jahanian
c4291852a4
ObjectiveC migrator: Fixes public buildbot failures,
...
in my previous patch which was reverted in r187657
llvm-svn: 187661
2013-08-02 18:00:53 +00:00
Fariborz Jahanian
87dc0bc078
revert patch I added in r187655. It still breaks public
...
buildbot.
llvm-svn: 187657
2013-08-02 16:25:41 +00:00
Fariborz Jahanian
11fe914549
ObjectiveC migration. Check-in patch reverted in r187634.
...
Also removed check for "NS" prefix for class name.
llvm-svn: 187655
2013-08-02 16:00:08 +00:00
Rafael Espindola
6cbcc10e84
Revert "ObjectiveC migrator. Migrate to instancetype return type for mehods with certain prefix selector matching their class names' suffix."
...
This reverts commit r187626.
It is breaking the bots.
llvm-svn: 187634
2013-08-02 00:01:14 +00:00
Fariborz Jahanian
8234d40843
ObjectiveC migrator. Migrate to instancetype return type
...
for mehods with certain prefix selector matching their class names'
suffix.
llvm-svn: 187626
2013-08-01 22:29:32 +00:00
Fariborz Jahanian
267bae3ad6
Objective-C migrator: some cleanup.
...
Expose static type of init/alloc/retain with
instance type as well. Ad-hoc cases are coming
next.
llvm-svn: 187068
2013-07-24 19:18:37 +00:00
Fariborz Jahanian
280954a296
ObjectiveC migration: Method candidates for
...
migrating to instancetype can have implicit 'id'
type too.
llvm-svn: 187062
2013-07-24 18:31:42 +00:00
Fariborz Jahanian
631925fe62
ObjectiveC migration: more migration to
...
instancetype of NSDictionary methods.
llvm-svn: 187008
2013-07-23 23:55:55 +00:00
Fariborz Jahanian
670ef26293
ObjectiveC migrator: start migrating to
...
instancetype methods.
llvm-svn: 187004
2013-07-23 23:34:42 +00:00
Fariborz Jahanian
7122135fc3
ObjC migrator: more knobs toward doing
...
instancetype migration.
llvm-svn: 187000
2013-07-23 22:42:28 +00:00
Fariborz Jahanian
9e543afe19
ObjectiveC migration. Better handle migration to conforming
...
protocols by ignoring cases where all protocol properties
and methods are optional.
llvm-svn: 186895
2013-07-22 23:50:04 +00:00
Fariborz Jahanian
d0f6f79f4e
Objective-C migration: Use NS_OPTIONS when enumerators
...
have shift/bitwise operators or are power of 2.
llvm-svn: 186856
2013-07-22 18:53:45 +00:00
Fariborz Jahanian
c1c44f62bc
ObjectiveC migrator: Another use case of enum
...
declaration which can be migrated to NS_ENUM.
llvm-svn: 186716
2013-07-19 20:18:36 +00:00
Fariborz Jahanian
008ef72bee
Fixes an ObjC migrator crash when last decl
...
in file is an enum.
llvm-svn: 186700
2013-07-19 17:44:32 +00:00
Fariborz Jahanian
b0057bb4fc
ObjectiveC migrator: add support to migrate to
...
NS_OPTIONS.
llvm-svn: 186641
2013-07-19 01:05:49 +00:00
Fariborz Jahanian
85e988bbea
ObjectiveC migrator: Remove semicolon after the typedef
...
declaration when converting to NS_ENUM. This required
some code refactoring.
llvm-svn: 186619
2013-07-18 22:17:33 +00:00
Fariborz Jahanian
92463274e6
ObjectiveC migration. migration to NS_ENUM/SN_OPTION
...
- wip.
llvm-svn: 186604
2013-07-18 20:11:45 +00:00
Fariborz Jahanian
cb7b8deecb
ObjectiveC migrator: When adding conforming protocol,
...
only add outer-most conforming protocols as adding
others are redundant.
llvm-svn: 186473
2013-07-17 00:02:22 +00:00
Fariborz Jahanian
2bc3dda186
ObjectiveC migrator. If a class implements a protocol's
...
properties, then class conforms to that protocol.
llvm-svn: 186460
2013-07-16 21:59:42 +00:00
Fariborz Jahanian
5bd5affe2d
ObjC migrator: build conforming interface
...
declaration (not yet used). wip.
llvm-svn: 186369
2013-07-16 00:20:21 +00:00
Fariborz Jahanian
d36150d7ca
ObjC migrator: finding conforming protocol
...
candidates for each class. wip.
llvm-svn: 186349
2013-07-15 21:22:08 +00:00
Fariborz Jahanian
9a3512b11d
Fixes a typo caught by Arthur O'Dwyer
...
llvm-svn: 186249
2013-07-13 17:16:41 +00:00
Fariborz Jahanian
9eabf45fce
ObjC migrator: More knobs for migrating
...
conforming protocols to each class. wip.
llvm-svn: 186231
2013-07-13 00:04:20 +00:00
Fariborz Jahanian
1be015300c
ObjC migrator: early work for migrating implicitly conforming
...
protocols to classes. This is wip.
llvm-svn: 186220
2013-07-12 22:32:19 +00:00
Fariborz Jahanian
d83ef848bd
ObjC migrator: Add -objcmt-migrate-property to do property
...
migration. Also, fixes an old bug where older migration
flags were not being checked for properly.
llvm-svn: 185948
2013-07-09 16:59:14 +00:00
Fariborz Jahanian
7ac20e1031
ObjC migration: Skip over setter/getter with attributes
...
for now.
llvm-svn: 185879
2013-07-08 22:49:25 +00:00
Fariborz Jahanian
bfaabe40e7
[Objective-C migrator] replace candidate user setter/getter with
...
their equivalent property declaration. wip.
llvm-svn: 185873
2013-07-08 21:42:08 +00:00
Fariborz Jahanian
266926d85e
[objc migrator]: More knobs to do migration to
...
use of objc's properties.
llvm-svn: 185724
2013-07-05 20:46:03 +00:00
Fariborz Jahanian
43bbaaca80
[ObjectiveC migrator] relax the rules for setter/getter
...
types when deciding on validity of a property
inclusion. // rdar://14345082
llvm-svn: 185599
2013-07-04 00:24:32 +00:00
Fariborz Jahanian
de66100889
Minor refactoring of my last patch.
...
llvm-svn: 185593
2013-07-03 23:44:11 +00:00
Fariborz Jahanian
a7437f0227
[ObjectiveC Migration]: Provide knobs for
...
migrating setter/getter methods to an eventual
property declaraiton. This is wip.
// rdar://14345082
llvm-svn: 185591
2013-07-03 23:05:00 +00:00
Argyrios Kyrtzidis
6b4f341ecd
[objcmt] Rewrite a NSDictionary dictionaryWithObjects:forKeys: to a dictionary literal
...
if we can see the elements of the arrays.
for example:
NSDictionary *dict = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:@"1", @"2", nil] forKeys:[NSArray arrayWithObjects:@"A", @"B", nil]];
-->
NSDictionary *dict = @{ @"A" : @"1", @"B" : @"2" };
rdar://12428166
llvm-svn: 172679
2013-01-16 23:54:48 +00:00
Dmitri Gribenko
f857950d39
Remove useless 'llvm::' qualifier from names like StringRef and others that are
...
brought into 'clang' namespace by clang/Basic/LLVM.h
llvm-svn: 172323
2013-01-12 19:30:44 +00:00
Chandler Carruth
3a02247dc9
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.
llvm-svn: 169237
2012-12-04 09:13:33 +00:00
Argyrios Kyrtzidis
f3d587ea7c
Refactor recording the preprocessor conditional directive regions out of
...
PreprocessingRecord and into its own class, PPConditionalDirectiveRecord.
Decoupling allows a client to use the functionality of PPConditionalDirectiveRecord
without needing a PreprocessingRecord.
llvm-svn: 169229
2012-12-04 07:27:05 +00:00
Ted Kremenek
cdf814900d
Split library clangRewrite into clangRewriteCore and clangRewriteFrontend.
...
This is similar to how we divide up the StaticAnalyzer libraries to separate
core functionality to what is clearly associated with Frontend actions.
llvm-svn: 163050
2012-09-01 05:09:24 +00:00
Benjamin Kramer
4ab984e74b
Drop the ASTContext.h include from DeclFriend.h and DeclTemplate.h.
...
llvm-svn: 159723
2012-07-04 20:19:54 +00:00
Argyrios Kyrtzidis
b482260748
[objcmt] Warn when modern objc migrator does not convert a NSNumber message because it requires a cast.
...
rdar://11525138
llvm-svn: 157395
2012-05-24 16:48:23 +00:00
David Blaikie
bbafb8a745
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
llvm-svn: 152536
2012-03-11 07:00:24 +00:00
Ted Kremenek
f7639e1b4a
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.
llvm-svn: 152141
2012-03-06 20:06:33 +00:00