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
12#include "clang/ARCMigrate/FileRemapper.h"
13#include "clang/Frontend/FrontendAction.h"
14#include <memory>
15
16namespace clang {
17namespace arcmt {
18
19class CheckAction : public WrapperFrontendAction {
20protected:
21 bool BeginInvocation(CompilerInstance &CI) override;
22
23public:
24 CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
25};
26
27class ModifyAction : public WrapperFrontendAction {
28protected:
29 bool BeginInvocation(CompilerInstance &CI) override;
30
31public:
32 ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
33};
34
35class MigrateSourceAction : public ASTFrontendAction {
36 FileRemapper Remapper;
37protected:
38 bool BeginInvocation(CompilerInstance &CI) override;
39 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
40 StringRef InFile) override;
41};
42
43class MigrateAction : public WrapperFrontendAction {
44 std::string MigrateDir;
45 std::string PlistOut;
46 bool EmitPremigrationARCErrors;
47protected:
48 bool BeginInvocation(CompilerInstance &CI) override;
49
50public:
51 MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
52 StringRef migrateDir,
53 StringRef plistOut,
54 bool emitPremigrationARCErrors);
55};
56
57/// Migrates to modern ObjC syntax.
58class ObjCMigrateAction : public WrapperFrontendAction {
59 std::string MigrateDir;
60 unsigned ObjCMigAction;
61 FileRemapper Remapper;
62 CompilerInstance *CompInst;
63public:
64 ObjCMigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
65 StringRef migrateDir, unsigned migrateAction);
66
67protected:
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
77

source code of clang/include/clang/ARCMigrate/ARCMTActions.h