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
diff --git a/lib/ARCMigrate/ObjCMT.cpp b/lib/ARCMigrate/ObjCMT.cpp
index 46d538e..b521b56 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 @@
   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 @@
   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 {