diff options
author | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-18 00:53:41 +0000 |
---|---|---|
committer | Argyrios Kyrtzidis <akyrtzi@gmail.com> | 2011-06-18 00:53:41 +0000 |
commit | e665d6929e11796620ff799bc0186ebd747bfc76 (patch) | |
tree | 674045cb6c17c790f19a161135db2d3c77e12a51 /include | |
parent | 60a5e3f90031191f18128eab8326eea70b266b27 (diff) |
[arcmt] Fix the ARC migrator. -arcmt-modify requires running before the initialization of SourceManager
because it is going to modify the input file.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@133323 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'include')
-rw-r--r-- | include/clang/ARCMigrate/ARCMTActions.h | 4 | ||||
-rw-r--r-- | include/clang/Frontend/FrontendAction.h | 9 |
2 files changed, 11 insertions, 2 deletions
diff --git a/include/clang/ARCMigrate/ARCMTActions.h b/include/clang/ARCMigrate/ARCMTActions.h index 2dd57ab88b..fd85a0836a 100644 --- a/include/clang/ARCMigrate/ARCMTActions.h +++ b/include/clang/ARCMigrate/ARCMTActions.h @@ -18,7 +18,7 @@ namespace arcmt { class CheckAction : public WrapperFrontendAction { protected: - virtual void ExecuteAction(); + virtual bool BeginInvocation(CompilerInstance &CI); public: CheckAction(FrontendAction *WrappedAction); @@ -26,7 +26,7 @@ public: class TransformationAction : public WrapperFrontendAction { protected: - virtual void ExecuteAction(); + virtual bool BeginInvocation(CompilerInstance &CI); public: TransformationAction(FrontendAction *WrappedAction); diff --git a/include/clang/Frontend/FrontendAction.h b/include/clang/Frontend/FrontendAction.h index 2538f55aaf..f335475665 100644 --- a/include/clang/Frontend/FrontendAction.h +++ b/include/clang/Frontend/FrontendAction.h @@ -78,6 +78,14 @@ protected: virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, llvm::StringRef InFile) = 0; + /// \brief Callback before starting processing a single input, giving the + /// opportunity to modify the CompilerInvocation or do some other action + /// before BeginSourceFileAction is called. + /// + /// \return True on success; on failure \see BeginSourceFileAction() and + /// ExecutionAction() and EndSourceFileAction() will not be called. + virtual bool BeginInvocation(CompilerInstance &CI) { return true; } + /// BeginSourceFileAction - Callback at the start of processing a single /// input. /// @@ -265,6 +273,7 @@ class WrapperFrontendAction : public FrontendAction { protected: virtual ASTConsumer *CreateASTConsumer(CompilerInstance &CI, llvm::StringRef InFile); + virtual bool BeginInvocation(CompilerInstance &CI); virtual bool BeginSourceFileAction(CompilerInstance &CI, llvm::StringRef Filename); virtual void ExecuteAction(); |