summaryrefslogtreecommitdiff
path: root/lib/ARCMigrate/ObjCMT.cpp
Commit message (Collapse)AuthorAge
* Replace llvm::error_code with std::error_code.Rafael Espindola2014-06-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@210780 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Make sure we don't edit the return type to add 'instancetype' if ↵Argyrios Kyrtzidis2014-05-21
| | | | | | | | the return type is already that. rdar://16961577 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@209264 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Use 'nullptr'.Craig Topper2014-05-07
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@208163 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Revert r191796, it's not needed anymore.Argyrios Kyrtzidis2014-04-28
| | | | | | rdar://16223810 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@207391 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Add 'override' keyword to virtual methods that override their base ↵Craig Topper2014-03-14
| | | | | | class. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203893 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCContainerDecl iterators instmeth_begin() and ↵Aaron Ballman2014-03-13
| | | | | | instmeth_end() with iterator_range instance_methods(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203839 91177308-0d34-0410-b5e6-96231b3b80d8
* Renaming the recently-created (r203830) props() range API to properties() ↵Aaron Ballman2014-03-13
| | | | | | for clarity. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203835 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCContainerDecl iterators meth_begin() and meth_end() ↵Aaron Ballman2014-03-13
| | | | | | with iterator_range methods(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203832 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing ObjCContainerDecl iterators prop_begin() and prop_end() ↵Aaron Ballman2014-03-13
| | | | | | with iterator_range props(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203830 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replacing EnumDecl iterators enumerator_begin() and enumerator_end() ↵Aaron Ballman2014-03-08
| | | | | | with iterator_range enumerators(). Updating all of the usages of the iterators with range-based for loops. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203353 91177308-0d34-0410-b5e6-96231b3b80d8
* Replace OwningPtr with std::unique_ptr.Ahmed Charles2014-03-07
| | | | | | This compiles cleanly with lldb/lld/clang-tools-extra/llvm. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203279 91177308-0d34-0410-b5e6-96231b3b80d8
* Change OwningPtr::take() to OwningPtr::release().Ahmed Charles2014-03-07
| | | | | | This is a precursor to moving to std::unique_ptr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@203275 91177308-0d34-0410-b5e6-96231b3b80d8
* [C++11] Replace llvm::tie with std::tie.Benjamin Kramer2014-03-02
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202639 91177308-0d34-0410-b5e6-96231b3b80d8
* Update for llvm api change.Rafael Espindola2014-02-24
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202053 91177308-0d34-0410-b5e6-96231b3b80d8
* Enforce safe usage of DiagnosticsEngine::getCustomDiagID()Alp Toker2014-01-26
| | | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200132 91177308-0d34-0410-b5e6-96231b3b80d8
* Identify two more unsafe uses of getCustomDiagID()Alp Toker2014-01-26
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200126 91177308-0d34-0410-b5e6-96231b3b80d8
* Rename getResultType() on function and method declarations to getReturnType()Alp Toker2014-01-25
| | | | | | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@200082 91177308-0d34-0410-b5e6-96231b3b80d8
* Sort all the #include lines with LLVM's utils/sort_includes.py whichChandler Carruth2014-01-07
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@198686 91177308-0d34-0410-b5e6-96231b3b80d8
* Replacing calls to getAttr with calls to hasAttr for clarity. No functional ↵Aaron Ballman2013-12-19
| | | | | | change intended -- this only replaces Boolean uses of getAttr. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197648 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Fixes a bug when protocolFariborz Jahanian2013-12-17
| | | | | | | conformance is inferred. // rdar://15515206 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197448 91177308-0d34-0410-b5e6-96231b3b80d8
* Re-apply r197076 and r197086; the build was fixed by chapuni in r197114.Hans Wennborg2013-12-12
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197116 91177308-0d34-0410-b5e6-96231b3b80d8
* Revert r197076: "[objcmt] When emitting a remap file, use a json formatHans Wennborg2013-12-12
| | | | | | | | | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197111 91177308-0d34-0410-b5e6-96231b3b80d8
* Objective-C migrator: when inferring 'readonly' property of anFariborz Jahanian2013-12-12
| | | | | | | | Objective-C object conforming to 'NSCopying' protocol, infer a 'copy' property, instead of 'strong'. // rdar://15525937 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197102 91177308-0d34-0410-b5e6-96231b3b80d8
* Remove extra qualification to fix build with g++ after r197076Alp Toker2013-12-11
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197086 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] When emitting a remap file, use a json format with the edit ↵Argyrios Kyrtzidis2013-12-11
| | | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197076 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] When whitelisting the headers we want to modify, allow changing theArgyrios Kyrtzidis2013-12-11
| | | | | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@197075 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Add a modernization option to infer and suggest designated ↵Argyrios Kyrtzidis2013-12-10
| | | | | | | | initializers. rdar://15509284 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196943 91177308-0d34-0410-b5e6-96231b3b80d8
* Fix a tranche of comment, test and doc typosAlp Toker2013-12-05
| | | | git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@196510 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. delegate property must be Fariborz Jahanian2013-11-21
| | | | | | | | inferred as 'assign', not 'assign' and 'strong'. // rdar://15509831 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195368 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. use strong instead of Fariborz Jahanian2013-11-21
| | | | | | | | retain attribute for inferred properties. // rdar://15519923 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195292 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Do not migrate categories withFariborz Jahanian2013-11-19
| | | | | | | 'Deprecated' name suffix. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@195137 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator: This patch sets access propertyFariborz Jahanian2013-11-14
| | | | | | | attributes on 'readonly' properties. // rdar://15460787 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194718 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Introduce "objcmt-white-list-dir-path=" option.Argyrios Kyrtzidis2013-11-14
| | | | | | | 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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194710 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] -objcmt-atomic-property & -objcmt-ns-nonatomic-iosonly are ↵Argyrios Kyrtzidis2013-11-14
| | | | | | | | companion flags. Ignore them when determining if some transformation was enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194709 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] If no objcmt options were specified, default to enable ↵Argyrios Kyrtzidis2013-11-13
| | | | | | literals+subscripting. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194629 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Transfer the objcmt flags from the driver to cc1 invocation andArgyrios Kyrtzidis2013-11-13
| | | | | | instantiate ObjCMigrateASTConsumer with the specific options that were enabled. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194628 91177308-0d34-0410-b5e6-96231b3b80d8
* [objcmt] Use FileIDs directly instead of their hash value.Argyrios Kyrtzidis2013-11-13
| | | | | | No functionality change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194590 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Place use of NS_NONATOMIC_IOSONLYFariborz Jahanian2013-11-13
| | | | | | | | | on inferred property attribute under -objcmt-ns-nonatomic-iosonly option. // rdar://15442742 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194532 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Another alternative toFariborz Jahanian2013-11-12
| | | | | | | | | "atomic" or "nonatomic" for properties is NS_NONATOMIC_IOSONLY. Use it if available. // rdar://15442742 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194503 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Added a dropped check in myFariborz Jahanian2013-11-08
| | | | | | | last patch. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194238 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Fixes an obscure bug whereFariborz Jahanian2013-11-08
| | | | | | | | | NS_RETURNS_INNER_POINTER ends up unintentionally on the @property under -objcmt-migrate-all // rdar://15396636 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194233 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Please annotation of properties with Fariborz Jahanian2013-11-05
| | | | | | | | | NS_RETURNS_INNER_POINTER under -objcmt-returns-innerpointer-property flag (off by default), as older compilers do not support such annotations. // rdar://15396636 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@194100 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. When inferring readwrite property,Fariborz Jahanian2013-11-01
| | | | | | | | | | | 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 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193837 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Change naming hueristic forFariborz Jahanian2013-10-31
| | | | | | | | deprecated categories, fixes a typo reported by Jordan. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193759 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator: annotate all protocols/methods inFariborz Jahanian2013-10-31
| | | | | | | | a category with NSxxxDeprecated name with deprecated annotation. // rdar://15337661 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@193726 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Minor clean up of my last patch.Fariborz Jahanian2013-10-17
| | | | | | | No functional change. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192933 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. In infering NS_ENUM/NS_OPTIONSFariborz Jahanian2013-10-17
| | | | | | | | | macros, prefer the typedef immediately following the enum declaration to the one preceeding it. // rdar://15200915 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192927 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Remove blank linesFariborz Jahanian2013-10-16
| | | | | | | | when inferring property from setter/getter methods. // rdar://15200949 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192853 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. Don't add 'assign' forFariborz Jahanian2013-10-16
| | | | | | | | inferred properties when type is scalar and assumed to be 'assign. // rdar://15231241 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192841 91177308-0d34-0410-b5e6-96231b3b80d8
* ObjectiveC migrator. 'atomic' is the default attribute.Fariborz Jahanian2013-10-16
| | | | | | | | Don't add it to inferred property. // rdar://14988132 git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@192834 91177308-0d34-0410-b5e6-96231b3b80d8