clang  14.0.0git
ARCMTActions.h
Go to the documentation of this file.
1 //===--- ARCMTActions.h - ARC Migrate Tool Frontend Actions -----*- C++ -*-===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
8 
9 #ifndef LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
10 #define LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
11 
14 #include <memory>
15 
16 namespace clang {
17 namespace arcmt {
18 
20 protected:
21  bool BeginInvocation(CompilerInstance &CI) override;
22 
23 public:
24  CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
25 };
26 
28 protected:
29  bool BeginInvocation(CompilerInstance &CI) override;
30 
31 public:
32  ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
33 };
34 
36  FileRemapper Remapper;
37 protected:
38  bool BeginInvocation(CompilerInstance &CI) override;
39  std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
40  StringRef InFile) override;
41 };
42 
44  std::string MigrateDir;
45  std::string PlistOut;
46  bool EmitPremigrationARCErros;
47 protected:
48  bool BeginInvocation(CompilerInstance &CI) override;
49 
50 public:
51  MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
52  StringRef migrateDir,
53  StringRef plistOut,
54  bool emitPremigrationARCErrors);
55 };
56 
57 /// Migrates to modern ObjC syntax.
59  std::string MigrateDir;
60  unsigned ObjCMigAction;
61  FileRemapper Remapper;
62  CompilerInstance *CompInst;
63 public:
64  ObjCMigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
65  StringRef migrateDir, unsigned migrateAction);
66 
67 protected:
68  std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
69  StringRef InFile) override;
70  bool BeginInvocation(CompilerInstance &CI) override;
71 };
72 
73 }
74 }
75 
76 #endif
clang::arcmt::MigrateAction
Definition: ARCMTActions.h:43
string
string(SUBSTRING ${CMAKE_CURRENT_BINARY_DIR} 0 ${PATH_LIB_START} PATH_HEAD) string(SUBSTRING $
Definition: CMakeLists.txt:22
FrontendAction.h
clang::arcmt::ModifyAction
Definition: ARCMTActions.h:27
clang::arcmt::FileRemapper
Definition: FileRemapper.h:32
clang::arcmt::MigrateAction::BeginInvocation
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
Definition: ARCMTActions.cpp:39
clang::arcmt::ObjCMigrateAction::BeginInvocation
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
Definition: ObjCMT.cpp:209
clang::CompilerInstance
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Definition: CompilerInstance.h:74
clang::arcmt::CheckAction::CheckAction
CheckAction(std::unique_ptr< FrontendAction > WrappedAction)
Definition: ARCMTActions.cpp:27
clang::arcmt::ObjCMigrateAction
Migrates to modern ObjC syntax.
Definition: ARCMTActions.h:58
clang::arcmt::MigrateSourceAction::CreateASTConsumer
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
Definition: ObjCMT.cpp:2009
FileRemapper.h
clang::arcmt::ModifyAction::ModifyAction
ModifyAction(std::unique_ptr< FrontendAction > WrappedAction)
Definition: ARCMTActions.cpp:36
clang::arcmt::ModifyAction::BeginInvocation
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
Definition: ARCMTActions.cpp:30
clang
Definition: CalledOnceCheck.h:17
clang::arcmt::CheckAction
Definition: ARCMTActions.h:19
clang::WrapperFrontendAction::WrappedAction
std::unique_ptr< FrontendAction > WrappedAction
Definition: FrontendAction.h:307
clang::arcmt::CheckAction::BeginInvocation
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
Definition: ARCMTActions.cpp:16
clang::arcmt::ObjCMigrateAction::CreateASTConsumer
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
Definition: ObjCMT.cpp:197
clang::arcmt::MigrateSourceAction
Definition: ARCMTActions.h:35
clang::ASTFrontendAction
Abstract base class to use for AST consumer-based frontend actions.
Definition: FrontendAction.h:243
clang::arcmt::MigrateSourceAction::BeginInvocation
bool BeginInvocation(CompilerInstance &CI) override
Callback before starting processing a single input, giving the opportunity to modify the CompilerInvo...
Definition: ObjCMT.cpp:1984
clang::arcmt::ObjCMigrateAction::ObjCMigrateAction
ObjCMigrateAction(std::unique_ptr< FrontendAction > WrappedAction, StringRef migrateDir, unsigned migrateAction)
Definition: ObjCMT.cpp:187
clang::arcmt::MigrateAction::MigrateAction
MigrateAction(std::unique_ptr< FrontendAction > WrappedAction, StringRef migrateDir, StringRef plistOut, bool emitPremigrationARCErrors)
Definition: ARCMTActions.cpp:51
clang::WrapperFrontendAction
A frontend action which simply wraps some other runtime-specified frontend action.
Definition: FrontendAction.h:305