ARCMTActions.h 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  1. #pragma once
  2. #ifdef __GNUC__
  3. #pragma GCC diagnostic push
  4. #pragma GCC diagnostic ignored "-Wunused-parameter"
  5. #endif
  6. //===--- ARCMTActions.h - ARC Migrate Tool Frontend Actions -----*- C++ -*-===//
  7. //
  8. // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
  9. // See https://llvm.org/LICENSE.txt for license information.
  10. // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
  11. //
  12. //===----------------------------------------------------------------------===//
  13. #ifndef LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
  14. #define LLVM_CLANG_ARCMIGRATE_ARCMTACTIONS_H
  15. #include "clang/ARCMigrate/FileRemapper.h"
  16. #include "clang/Frontend/FrontendAction.h"
  17. #include <memory>
  18. namespace clang {
  19. namespace arcmt {
  20. class CheckAction : public WrapperFrontendAction {
  21. protected:
  22. bool BeginInvocation(CompilerInstance &CI) override;
  23. public:
  24. CheckAction(std::unique_ptr<FrontendAction> WrappedAction);
  25. };
  26. class ModifyAction : public WrapperFrontendAction {
  27. protected:
  28. bool BeginInvocation(CompilerInstance &CI) override;
  29. public:
  30. ModifyAction(std::unique_ptr<FrontendAction> WrappedAction);
  31. };
  32. class MigrateSourceAction : public ASTFrontendAction {
  33. FileRemapper Remapper;
  34. protected:
  35. bool BeginInvocation(CompilerInstance &CI) override;
  36. std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
  37. StringRef InFile) override;
  38. };
  39. class MigrateAction : public WrapperFrontendAction {
  40. std::string MigrateDir;
  41. std::string PlistOut;
  42. bool EmitPremigrationARCErrors;
  43. protected:
  44. bool BeginInvocation(CompilerInstance &CI) override;
  45. public:
  46. MigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
  47. StringRef migrateDir,
  48. StringRef plistOut,
  49. bool emitPremigrationARCErrors);
  50. };
  51. /// Migrates to modern ObjC syntax.
  52. class ObjCMigrateAction : public WrapperFrontendAction {
  53. std::string MigrateDir;
  54. unsigned ObjCMigAction;
  55. FileRemapper Remapper;
  56. CompilerInstance *CompInst;
  57. public:
  58. ObjCMigrateAction(std::unique_ptr<FrontendAction> WrappedAction,
  59. StringRef migrateDir, unsigned migrateAction);
  60. protected:
  61. std::unique_ptr<ASTConsumer> CreateASTConsumer(CompilerInstance &CI,
  62. StringRef InFile) override;
  63. bool BeginInvocation(CompilerInstance &CI) override;
  64. };
  65. }
  66. }
  67. #endif
  68. #ifdef __GNUC__
  69. #pragma GCC diagnostic pop
  70. #endif