r188224 - ObjectiveC migration. Add couple of routine
Fariborz Jahanian
fjahanian at apple.com
Mon Aug 12 16:17:14 PDT 2013
Author: fjahanian
Date: Mon Aug 12 18:17:13 2013
New Revision: 188224
URL: http://llvm.org/viewvc/llvm-project?rev=188224&view=rev
Log:
ObjectiveC migration. Add couple of routine
, currently unused, for future cf-annotation work.
Modified:
cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
Modified: cfe/trunk/lib/ARCMigrate/ObjCMT.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/ARCMigrate/ObjCMT.cpp?rev=188224&r1=188223&r2=188224&view=diff
==============================================================================
--- cfe/trunk/lib/ARCMigrate/ObjCMT.cpp (original)
+++ cfe/trunk/lib/ARCMigrate/ObjCMT.cpp Mon Aug 12 18:17:13 2013
@@ -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 AS
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::migrateFact
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 {
More information about the cfe-commits
mailing list