clang 8.0.0

ARCMTActions.h
Go to the documentation of this file.
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_ARCMTACTIONS_H
11 #define LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
12
13 #include "clang/ARCMigrate/FileRemapper.h"
14 #include "clang/Frontend/FrontendAction.h"
15 #include <memory>
16
17 namespace clang {
18 namespace arcmt {
19
20 class CheckAction : public WrapperFrontendAction {
21 protected:
22 bool BeginInvocation(CompilerInstance &CI) override;
23
24 public:
25 CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
26 };
27
28 class ModifyAction : public WrapperFrontendAction {
29 protected:
30 bool BeginInvocation(CompilerInstance &CI) override;
31
32 public:
33 ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
34 };
35
36 class MigrateSourceAction : public ASTFrontendAction {
37 FileRemapper Remapper;
38 protected:
39 bool BeginInvocation(CompilerInstance &CI) override;
40 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
41 StringRef InFile) override;
42 };
43
44 class MigrateAction : public WrapperFrontendAction {
45 std::string MigrateDir;
46 std::string PlistOut;
47 bool EmitPremigrationARCErros;
48 protected:
49 bool BeginInvocation(CompilerInstance &CI) override;
50
51 public:
52 MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
53 StringRef migrateDir,
54 StringRef plistOut,
55 bool emitPremigrationARCErrors);
56 };
57
58 /// Migrates to modern ObjC syntax.
59 class ObjCMigrateAction : public WrapperFrontendAction {
60 std::string MigrateDir;
61 unsigned ObjCMigAction;
62 FileRemapper Remapper;
63 CompilerInstance *CompInst;
64 public:
65 ObjCMigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
66 StringRef migrateDir, unsigned migrateAction);
67
68 protected:
69 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
70 StringRef InFile) override;
71 bool BeginInvocation(CompilerInstance &CI) override;
72 };
73
74 }
75 }
76
77 #endif
clang::arcmt::ObjCMigrateAction
Migrates to modern ObjC syntax.
Definition: ARCMTActions.h:59
clang::WrapperFrontendAction::CreateASTConsumer
std::unique_ptr< ASTConsumer > CreateASTConsumer(CompilerInstance &CI, StringRef InFile) override
Create the AST consumer object for this action, if supported.
Definition: FrontendAction.cpp:1049
clang::arcmt::ModifyAction
Definition: ARCMTActions.h:28
clang::arcmt::FileRemapper
Definition: FileRemapper.h:31
FileRemapper.h
clang::arcmt::MigrateSourceAction
Definition: ARCMTActions.h:36
clang::arcmt::MigrateAction
Definition: ARCMTActions.h:44
clang::CompilerInstance
CompilerInstance - Helper class for managing a single instance of the Clang compiler.
Definition: CompilerInstance.h:73
clang::ASTFrontendAction
Abstract base class to use for AST consumer-based frontend actions.
Definition: FrontendAction.h:243
clang::arcmt::CheckAction::CheckAction
CheckAction(std::unique_ptr< FrontendAction > WrappedAction)
Definition: ARCMTActions.cpp:28
clang
Dataflow Directional Tag Classes.
Definition: CFGReachabilityAnalysis.h:22
clang::arcmt::CheckAction
Definition: ARCMTActions.h:20
clang::WrapperFrontendAction
A frontend action which simply wraps some other runtime-specified frontend action.
Definition: FrontendAction.h:304
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:17
FrontendAction.h
Defines the clang::FrontendAction interface and various convenience abstract classes (clang::ASTFront...