clang API Documentation
00001 //===--- ARCMTActions.h - ARC Migrate Tool Frontend Actions -----*- C++ -*-===// 00002 // 00003 // The LLVM Compiler Infrastructure 00004 // 00005 // This file is distributed under the University of Illinois Open Source 00006 // License. See LICENSE.TXT for details. 00007 // 00008 //===----------------------------------------------------------------------===// 00009 00010 #ifndef LLVM_CLANG_ARCMIGRATE_ARCMT_ACTION_H 00011 #define LLVM_CLANG_ARCMIGRATE_ARCMT_ACTION_H 00012 00013 #include "clang/Frontend/FrontendAction.h" 00014 #include "clang/ARCMigrate/FileRemapper.h" 00015 #include "llvm/ADT/OwningPtr.h" 00016 00017 namespace clang { 00018 namespace arcmt { 00019 00020 class CheckAction : public WrapperFrontendAction { 00021 protected: 00022 virtual bool BeginInvocation(CompilerInstance &CI); 00023 00024 public: 00025 CheckAction(FrontendAction *WrappedAction); 00026 }; 00027 00028 class ModifyAction : public WrapperFrontendAction { 00029 protected: 00030 virtual bool BeginInvocation(CompilerInstance &CI); 00031 00032 public: 00033 ModifyAction(FrontendAction *WrappedAction); 00034 }; 00035 00036 class MigrateSourceAction : public ASTFrontendAction { 00037 FileRemapper Remapper; 00038 protected: 00039 virtual bool BeginInvocation(CompilerInstance &CI); 00040 virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, 00041 StringRef InFile); 00042 }; 00043 00044 class MigrateAction : public WrapperFrontendAction { 00045 std::string MigrateDir; 00046 std::string PlistOut; 00047 bool EmitPremigrationARCErros; 00048 protected: 00049 virtual bool BeginInvocation(CompilerInstance &CI); 00050 00051 public: 00052 MigrateAction(FrontendAction *WrappedAction, StringRef migrateDir, 00053 StringRef plistOut, 00054 bool emitPremigrationARCErrors); 00055 }; 00056 00057 /// \brief Migrates to modern ObjC syntax. 00058 class ObjCMigrateAction : public WrapperFrontendAction { 00059 std::string MigrateDir; 00060 bool MigrateLiterals; 00061 bool MigrateSubscripting; 00062 FileRemapper Remapper; 00063 CompilerInstance *CompInst; 00064 public: 00065 ObjCMigrateAction(FrontendAction *WrappedAction, StringRef migrateDir, 00066 bool migrateLiterals, 00067 bool migrateSubscripting); 00068 00069 protected: 00070 virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI,StringRef InFile); 00071 virtual bool BeginInvocation(CompilerInstance &CI); 00072 }; 00073 00074 } 00075 } 00076 00077 #endif