From 46f4fd5938b0ff4ebbb83ba1df225f73d640613d Mon Sep 17 00:00:00 2001 From: Fariborz Jahanian Date: Mon, 12 Aug 2013 23:17:13 +0000 Subject: [PATCH] ObjectiveC migration. Add couple of routine , currently unused, for future cf-annotation work. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@188224 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/ARCMigrate/ObjCMT.cpp | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp index 46d538e632..b521b56026 100644 --- a/lib/ARCMigrate/ObjCMT.cpp +++ b/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() || + FuncDecl->getAttr() || + FuncDecl->getAttr()) + return; +} + +void ObjCMigrateASTConsumer::migrateObjCMethodDeclAnnotation( + ASTContext &Ctx, + ObjCMethodDecl *MethodDecl) { + if (MethodDecl->hasAttr() || + MethodDecl->getAttr() || + MethodDecl->getAttr()) + return; +} + namespace { class RewritesReceiver : public edit::EditsReceiver { -- 2.40.0