clang API Documentation

ARCMTActions.h
Go to the documentation of this file.
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_ARCMTACTIONS_H
00011 #define LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
00012 
00013 #include "clang/ARCMigrate/FileRemapper.h"
00014 #include "clang/Frontend/FrontendAction.h"
00015 #include <memory>
00016 
00017 namespace clang {
00018 namespace arcmt {
00019 
00020 class CheckAction : public WrapperFrontendAction {
00021 protected:
00022   bool BeginInvocation(CompilerInstance &CI) override;
00023 
00024 public:
00025   CheckAction(FrontendAction *WrappedAction);
00026 };
00027 
00028 class ModifyAction : public WrapperFrontendAction {
00029 protected:
00030   bool BeginInvocation(CompilerInstance &CI) override;
00031 
00032 public:
00033   ModifyAction(FrontendAction *WrappedAction);
00034 };
00035 
00036 class MigrateSourceAction : public ASTFrontendAction {
00037   FileRemapper Remapper;
00038 protected:
00039   bool BeginInvocation(CompilerInstance &CI) override;
00040   std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
00041                                                  StringRef InFile) override;
00042 };
00043 
00044 class MigrateAction : public WrapperFrontendAction {
00045   std::string MigrateDir;
00046   std::string PlistOut;
00047   bool EmitPremigrationARCErros;
00048 protected:
00049   bool BeginInvocation(CompilerInstance &CI) override;
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   unsigned    ObjCMigAction;
00061   FileRemapper Remapper;
00062   CompilerInstance *CompInst;
00063 public:
00064   ObjCMigrateAction(FrontendAction *WrappedAction, StringRef migrateDir,
00065                     unsigned migrateAction);
00066 
00067 protected:
00068   std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
00069                                                  StringRef InFile) override;
00070   bool BeginInvocation(CompilerInstance &CI) override;
00071 };
00072 
00073 }
00074 }
00075 
00076 #endif