diff options
| author | Fariborz Jahanian <fjahanian@apple.com> | 2013-08-12 23:17:13 +0000 |
|---|---|---|
| committer | Fariborz Jahanian <fjahanian@apple.com> | 2013-08-12 23:17:13 +0000 |
| commit | dfe6ed96607eace64ca50c49b9bc7befbeffa8a9 (patch) | |
| tree | 0f5c2b6e995fb1ef0c985e58ac7313a54e77f114 | |
| parent | 8c789099b957afe9a6b0a7f5790284de67594866 (diff) | |
| download | bcm5719-llvm-dfe6ed96607eace64ca50c49b9bc7befbeffa8a9.tar.gz bcm5719-llvm-dfe6ed96607eace64ca50c49b9bc7befbeffa8a9.zip | |
ObjectiveC migration. Add couple of routine
, currently unused, for future cf-annotation work.
llvm-svn: 188224
| -rw-r--r-- | clang/lib/ARCMigrate/ObjCMT.cpp | 24 |
1 files changed, 23 insertions, 1 deletions
diff --git a/clang/lib/ARCMigrate/ObjCMT.cpp b/clang/lib/ARCMigrate/ObjCMT.cpp index 46d538e6327..b521b560263 100644 --- a/clang/lib/ARCMigrate/ObjCMT.cpp +++ b/clang/lib/ARCMigrate/ObjCMT.cpp @@ -24,6 +24,7 @@ #include "clang/Lex/PPConditionalDirectiveRecord.h" #include "clang/Lex/Preprocessor.h" #include "clang/Rewrite/Core/Rewriter.h" +#include "clang/AST/Attr.h" #include "llvm/ADT/SmallString.h" using namespace clang; @@ -44,7 +45,10 @@ class ObjCMigrateASTConsumer : public ASTConsumer { void migrateFactoryMethod(ASTContext &Ctx, ObjCContainerDecl *CDecl, ObjCMethodDecl *OM, ObjCInstanceTypeFamily OIT_Family = OIT_None); - + + void migrateFunctionDeclAnnotation(ASTContext &Ctx, FunctionDecl *FuncDecl); + + void migrateObjCMethodDeclAnnotation(ASTContext &Ctx, ObjCMethodDecl *MethodDecl); public: std::string MigrateDir; bool MigrateLiterals; @@ -739,6 +743,24 @@ void ObjCMigrateASTConsumer::migrateFactoryMethod(ASTContext &Ctx, ReplaceWithInstancetype(*this, OM); } +void ObjCMigrateASTConsumer::migrateFunctionDeclAnnotation( + ASTContext &Ctx, + FunctionDecl *FuncDecl) { + if (FuncDecl->hasAttr<CFAuditedTransferAttr>() || + FuncDecl->getAttr<CFReturnsRetainedAttr>() || + FuncDecl->getAttr<CFReturnsNotRetainedAttr>()) + return; +} + +void ObjCMigrateASTConsumer::migrateObjCMethodDeclAnnotation( + ASTContext &Ctx, + ObjCMethodDecl *MethodDecl) { + if (MethodDecl->hasAttr<CFAuditedTransferAttr>() || + MethodDecl->getAttr<CFReturnsRetainedAttr>() || + MethodDecl->getAttr<CFReturnsNotRetainedAttr>()) + return; +} + namespace { class RewritesReceiver : public edit::EditsReceiver { |

