Argyrios Kyrtzidis
c02a0dbe41
[objcmt] Make sure we don't edit the return type to add 'instancetype' if the return type is already that.
...
rdar://16961577
llvm-svn: 209264
2014-05-21 00:24:20 +00:00
Craig Topper
8ae1203992
[C++11] Use 'nullptr'.
...
llvm-svn: 208163
2014-05-07 06:21:57 +00:00
Argyrios Kyrtzidis
7dd3133433
[objcmt] Revert r191796, it's not needed anymore.
...
rdar://16223810
llvm-svn: 207391
2014-04-28 02:38:51 +00:00
Craig Topper
b45acb8a16
[C++11] Add 'override' keyword to virtual methods that override their base class.
...
llvm-svn: 203893
2014-03-14 06:02:07 +00:00
Aaron Ballman
f26acce6f7
[C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203839
2014-03-13 19:50:17 +00:00
Aaron Ballman
d174edffa0
Renaming the recently-created (r203830) props() range API to properties() for clarity.
...
llvm-svn: 203835
2014-03-13 19:11:50 +00:00
Aaron Ballman
aff18c0446
[C++11] Replacing ObjCContainerDecl iterators meth_begin() and meth_end() with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203832
2014-03-13 19:03:34 +00:00
Aaron Ballman
dc4bea4676
[C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() with iterator_range props(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203830
2014-03-13 18:47:37 +00:00
Aaron Ballman
23a6dcb365
[C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops.
...
llvm-svn: 203353
2014-03-08 18:45:14 +00:00
Ahmed Charles
b89843299a
Replace OwningPtr with std::unique_ptr.
...
This compiles cleanly with lldb/lld/clang-tools-extra/llvm.
llvm-svn: 203279
2014-03-07 20:03:18 +00:00
Ahmed Charles
9a16beb8bc
Change OwningPtr::take() to OwningPtr::release().
...
This is a precursor to moving to std::unique_ptr.
llvm-svn: 203275
2014-03-07 19:33:25 +00:00
Benjamin Kramer
867ea1d426
[C++11] Replace llvm::tie with std::tie.
...
llvm-svn: 202639
2014-03-02 13:01:17 +00:00
Rafael Espindola
4fbd373815
Update for llvm api change.
...
llvm-svn: 202053
2014-02-24 18:20:21 +00:00
Alp Toker
29cb66ba2f
Enforce safe usage of DiagnosticsEngine::getCustomDiagID()
...
Replace the last incorrect uses and templatize the function to require a
compile-time constant string preventing further misuse.
The diagnostic formatter expects well-formed input and has undefined behaviour
with arbitrary input or crafted user strings in source files. Accepting user
input would also have caused unbounded generation of new diagnostic IDs which
can be problematic in long-running sessions or language bindings.
This completes the work to fix several incorrect callers that passed user
input or raw messages to the diagnostics engine where a constant format string
was expected.
llvm-svn: 200132
2014-01-26 06:17:37 +00:00
Alp Toker
046cda538c
Identify two more unsafe uses of getCustomDiagID()
...
llvm-svn: 200126
2014-01-26 05:08:49 +00:00
Alp Toker
314cc81b8c
Rename getResultType() on function and method declarations to getReturnType()
...
A return type is the declared or deduced part of the function type specified in
the declaration.
A result type is the (potentially adjusted) type of the value of an expression
that calls the function.
Rule of thumb:
* Declarations have return types and parameters.
* Expressions have result types and arguments.
llvm-svn: 200082
2014-01-25 16:55:45 +00:00
Chandler Carruth
5553d0d4ca
Sort all the #include lines with LLVM's utils/sort_includes.py which
...
encodes the canonical rules for LLVM's style. I noticed this had drifted
quite a bit when cleaning up LLVM, so wanted to clean up Clang as well.
llvm-svn: 198686
2014-01-07 11:51:46 +00:00
Aaron Ballman
9ead1243a5
Replacing calls to getAttr with calls to hasAttr for clarity. No functional change intended -- this only replaces Boolean uses of getAttr.
...
llvm-svn: 197648
2013-12-19 02:39:40 +00:00
Fariborz Jahanian
769c04ea35
ObjectiveC migrator. Fixes a bug when protocol
...
conformance is inferred. // rdar://15515206
llvm-svn: 197448
2013-12-17 01:01:33 +00:00
Hans Wennborg
bf6dda5116
Re-apply r197076 and r197086; the build was fixed by chapuni in r197114.
...
llvm-svn: 197116
2013-12-12 02:24:20 +00:00
Hans Wennborg
69a458f690
Revert r197076: "[objcmt] When emitting a remap file, use a json format
...
with the edit entries, instead of applying the changes"
(And also revert the follow-up r197086.)
This seems to have broken Linux builds, which were failing with the following:
/build/buildbot/osu8/clang-x86_64-linux-selfhost-rel/llvm.obj/Release+Asserts/lib/libclang.so:
error: undefined reference to
'clang::ento::objc_retain::CallEffects::getEffect(clang::ObjCMethodDecl const*)'
/build/buildbot/osu8/clang-x86_64-linux-selfhost-rel/llvm.obj/Release+Asserts/lib/libclang.so:
error: undefined reference to
'clang::ento::objc_retain::CallEffects::getEffect(clang::FunctionDecl const*)'
collect2: error: ld returned 1 exit status
llvm-svn: 197111
2013-12-12 02:12:17 +00:00
Fariborz Jahanian
49e69ee557
Objective-C migrator: when inferring 'readonly' property of an
...
Objective-C object conforming to 'NSCopying' protocol, infer
a 'copy' property, instead of 'strong'. // rdar://15525937
llvm-svn: 197102
2013-12-12 01:02:00 +00:00
Alp Toker
7afe9908d2
Remove extra qualification to fix build with g++ after r197076
...
llvm-svn: 197086
2013-12-11 22:50:04 +00:00
Argyrios Kyrtzidis
712e18a0c1
[objcmt] When emitting a remap file, use a json format with the edit entries, instead of applying the changes
...
to a temp file directly.
This allows to combine the edits when they can be different based on whether you saw
the implementation or not, e.g. with the designated initializer migration.
llvm-svn: 197076
2013-12-11 21:39:06 +00:00
Argyrios Kyrtzidis
3f72934bba
[objcmt] When whitelisting the headers we want to modify, allow changing the
...
the ObjC implementation declarations, just don't change implementations for
classes that are not in the whitelisted headers.
For example, if we change a method to return 'instancetype' we should also
update the method definition in the implementation.
llvm-svn: 197075
2013-12-11 21:39:00 +00:00
Argyrios Kyrtzidis
4f2ecc6177
[objcmt] Add a modernization option to infer and suggest designated initializers.
...
rdar://15509284
llvm-svn: 196943
2013-12-10 18:36:49 +00:00
Alp Toker
f6a24ce40f
Fix a tranche of comment, test and doc typos
...
llvm-svn: 196510
2013-12-05 16:25:25 +00:00
Fariborz Jahanian
d9aef7883d
ObjectiveC migrator. delegate property must be
...
inferred as 'assign', not 'assign' and 'strong'.
// rdar://15509831
llvm-svn: 195368
2013-11-21 17:49:34 +00:00
Fariborz Jahanian
54c8eaad90
ObjectiveC migrator. use strong instead of
...
retain attribute for inferred properties.
// rdar://15519923
llvm-svn: 195292
2013-11-21 00:58:17 +00:00
Fariborz Jahanian
48a44d4621
ObjectiveC migrator. Do not migrate categories with
...
'Deprecated' name suffix.
llvm-svn: 195137
2013-11-19 18:17:31 +00:00
Fariborz Jahanian
da267d0551
ObjectiveC migrator: This patch sets access property
...
attributes on 'readonly' properties. // rdar://15460787
llvm-svn: 194718
2013-11-14 18:28:58 +00:00
Argyrios Kyrtzidis
61f2032d3b
[objcmt] Introduce "objcmt-white-list-dir-path=" option.
...
This options accepts a path to a directory, collects the filenames of the files
it contains, and the migrator will only modify files with the same filename.
llvm-svn: 194710
2013-11-14 16:33:29 +00:00
Argyrios Kyrtzidis
c47c63b2dd
[objcmt] -objcmt-atomic-property & -objcmt-ns-nonatomic-iosonly are companion flags.
...
Ignore them when determining if some transformation was enabled.
llvm-svn: 194709
2013-11-14 16:33:20 +00:00
Argyrios Kyrtzidis
ee02a8a926
[objcmt] If no objcmt options were specified, default to enable literals+subscripting.
...
llvm-svn: 194629
2013-11-13 23:38:22 +00:00
Argyrios Kyrtzidis
55ecf99285
[objcmt] Transfer the objcmt flags from the driver to cc1 invocation and
...
instantiate ObjCMigrateASTConsumer with the specific options that were enabled.
llvm-svn: 194628
2013-11-13 23:38:20 +00:00
Argyrios Kyrtzidis
3e8547a5ca
[objcmt] Use FileIDs directly instead of their hash value.
...
No functionality change.
llvm-svn: 194590
2013-11-13 18:20:31 +00:00
Fariborz Jahanian
2e793d6124
ObjectiveC migrator. Place use of NS_NONATOMIC_IOSONLY
...
on inferred property attribute under
-objcmt-ns-nonatomic-iosonly option.
// rdar://15442742
llvm-svn: 194532
2013-11-13 00:08:36 +00:00
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