ObjectiveC migration. Add couple of routine

, currently unused, for future cf-annotation work.

llvm-svn: 188224
This commit is contained in:
Fariborz Jahanian 2013-08-12 23:17:13 +00:00
parent 8c789099b9
commit dfe6ed9660
1 changed files with 23 additions and 1 deletions

View File

@ -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 {