#ifndef LLVM_CLANG_LIB_ARCMIGRATE_TRANSFORMS_H
#define LLVM_CLANG_LIB_ARCMIGRATE_TRANSFORMS_H
#include "clang/AST/ParentMap.h"
#include "clang/AST/RecursiveASTVisitor.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/Support/SaveAndRestore.h"
namespace clang {
class Decl;
class Stmt;
class BlockDecl;
class ObjCMethodDecl;
class FunctionDecl;
namespace arcmt {
class MigrationPass;
namespace trans {
class MigrationContext;
void rewriteAutoreleasePool(MigrationPass &pass);
void rewriteUnbridgedCasts(MigrationPass &pass);
void makeAssignARCSafe(MigrationPass &pass);
void removeRetainReleaseDeallocFinalize(MigrationPass &pass);
void removeZeroOutPropsInDeallocFinalize(MigrationPass &pass);
void rewriteUnusedInitDelegate(MigrationPass &pass);
void checkAPIUses(MigrationPass &pass);
void removeEmptyStatementsAndDeallocFinalize(MigrationPass &pass);
class BodyContext { … };
class ObjCImplementationContext { … };
class ASTTraverser { … };
class MigrationContext { … };
class PropertyRewriteTraverser : public ASTTraverser { … };
class BlockObjCVariableTraverser : public ASTTraverser { … };
class ProtectedScopeTraverser : public ASTTraverser { … };
class GCAttrsTraverser : public ASTTraverser { … };
class GCCollectableCallsTraverser : public ASTTraverser { … };
bool canApplyWeak(ASTContext &Ctx, QualType type,
bool AllowOnUnknownClass = false);
bool isPlusOneAssign(const BinaryOperator *E);
bool isPlusOne(const Expr *E);
SourceLocation findLocationAfterSemi(SourceLocation loc, ASTContext &Ctx,
bool IsDecl = false);
SourceLocation findSemiAfterLocation(SourceLocation loc, ASTContext &Ctx,
bool IsDecl = false);
bool hasSideEffects(Expr *E, ASTContext &Ctx);
bool isGlobalVar(Expr *E);
StringRef getNilString(MigrationPass &Pass);
template <typename BODY_TRANS>
class BodyTransform : public RecursiveASTVisitor<BodyTransform<BODY_TRANS> > { … };
ExprSet;
void clearRefsIn(Stmt *S, ExprSet &refs);
template <typename iterator>
void clearRefsIn(iterator begin, iterator end, ExprSet &refs) { … }
void collectRefs(ValueDecl *D, Stmt *S, ExprSet &refs);
void collectRemovables(Stmt *S, ExprSet &exprs);
}
}
}
#endif