1//===--- ARCMTActions.h - ARC Migrate Tool Frontend Actions -----*- C++ -*-===// 2// 3// The LLVM Compiler Infrastructure 4// 5// This file is distributed under the University of Illinois Open Source 6// License. See LICENSE.TXT for details. 7// 8//===----------------------------------------------------------------------===// 9 10#ifndef LLVM_CLANG_ARCMIGRATE_ARCMT_ACTION_H 11#define LLVM_CLANG_ARCMIGRATE_ARCMT_ACTION_H 12 13#include "clang/Frontend/FrontendAction.h" 14#include "clang/ARCMigrate/FileRemapper.h" 15#include "llvm/ADT/OwningPtr.h" 16 17namespace clang { 18namespace arcmt { 19 20class CheckAction : public WrapperFrontendAction { 21protected: 22 virtual bool BeginInvocation(CompilerInstance &CI); 23 24public: 25 CheckAction(FrontendAction *WrappedAction); 26}; 27 28class ModifyAction : public WrapperFrontendAction { 29protected: 30 virtual bool BeginInvocation(CompilerInstance &CI); 31 32public: 33 ModifyAction(FrontendAction *WrappedAction); 34}; 35 36class MigrateSourceAction : public ASTFrontendAction { 37 FileRemapper Remapper; 38protected: 39 virtual bool BeginInvocation(CompilerInstance &CI); 40 virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, 41 StringRef InFile); 42}; 43 44class MigrateAction : public WrapperFrontendAction { 45 std::string MigrateDir; 46 std::string PlistOut; 47 bool EmitPremigrationARCErros; 48protected: 49 virtual bool BeginInvocation(CompilerInstance &CI); 50 51public: 52 MigrateAction(FrontendAction *WrappedAction, StringRef migrateDir, 53 StringRef plistOut, 54 bool emitPremigrationARCErrors); 55}; 56 57/// \brief Migrates to modern ObjC syntax. 58class ObjCMigrateAction : public WrapperFrontendAction { 59 std::string MigrateDir; 60 bool MigrateLiterals; 61 bool MigrateSubscripting; 62 FileRemapper Remapper; 63 CompilerInstance *CompInst; 64public: 65 ObjCMigrateAction(FrontendAction *WrappedAction, StringRef migrateDir, 66 bool migrateLiterals, 67 bool migrateSubscripting); 68 69protected: 70 virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,StringRef InFile); 71 virtual bool BeginInvocation(CompilerInstance &CI); 72}; 73 74} 75} 76 77#endif 78