diff options
author | Fariborz Jahanian <fjahanian@apple.com> | 2013-08-02 22:34:18 +0000 |
---|---|---|
committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-08-02 22:34:18 +0000 |
commit | 3bfc35e26a814196dd774abacf9fce80a5abf3ff (patch) | |
tree | fdfd63579d9d577eaabead941012f7d776243669 | |
parent | 35947af01255e37bb5fd988df4b0fa316f1e5ed5 (diff) | |
download | bcm5719-llvm-3bfc35e26a814196dd774abacf9fce80a5abf3ff.tar.gz bcm5719-llvm-3bfc35e26a814196dd774abacf9fce80a5abf3ff.zip |
ObjectiveC migrator. Differentiate 'instancetype'
from 'id' result type when deciding on migration
to instancetype.
llvm-svn: 187684
-rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 706a4ec1065..c8fc312e6a2 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -628,7 +628,9 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx, ObjCContainerDecl *CDecl, ObjCMethodDecl *OM, ObjCInstanceTypeFamily OIT_Family) { - if (OM->isInstanceMethod() || !OM->getResultType()->isObjCIdType()) + if (OM->isInstanceMethod() || + OM->getResultType() == Ctx.getObjCInstanceType() || + !OM->getResultType()->isObjCIdType()) return; // Candidate factory methods are + (id) NaMeXXX : ... which belong to a class |