1 //===--- ARCMTActions.h - ARC Migrate Tool Frontend Actions -----*- C++ -*-===//
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
7 //===----------------------------------------------------------------------===//
9 #ifndef LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
10 #define LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
12 #include "clang/ARCMigrate/FileRemapper.h"
13 #include "clang/Frontend/FrontendAction.h"
19 class CheckAction : public WrapperFrontendAction {
21 bool BeginInvocation(CompilerInstance &CI) override;
24 CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
27 class ModifyAction : public WrapperFrontendAction {
29 bool BeginInvocation(CompilerInstance &CI) override;
32 ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
35 class MigrateSourceAction : public ASTFrontendAction {
36 FileRemapper Remapper;
38 bool BeginInvocation(CompilerInstance &CI) override;
39 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
40 StringRef InFile) override;
43 class MigrateAction : public WrapperFrontendAction {
44 std::string MigrateDir;
46 bool EmitPremigrationARCErros;
48 bool BeginInvocation(CompilerInstance &CI) override;
51 MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
54 bool emitPremigrationARCErrors);
57 /// Migrates to modern ObjC syntax.
58 class ObjCMigrateAction : public WrapperFrontendAction {
59 std::string MigrateDir;
60 unsigned ObjCMigAction;
61 FileRemapper Remapper;
62 CompilerInstance *CompInst;
64 ObjCMigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
65 StringRef migrateDir, unsigned migrateAction);
68 std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
69 StringRef InFile) override;
70 bool BeginInvocation(CompilerInstance &CI) override;