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 | 90b6a2a6a78273b0df86485c887bb66c3daaaadf (patch) | |
tree | 1c061ed10b66cdc3877a25cdaa9a9da3d9298823 /clang/lib/Frontend/FrontendAction.cpp | |
parent | 0f3f9f78f8e8b0e13cef69edf22bc62860f5e9ea (diff) | |
download | bcm5719-llvm-90b6a2a6a78273b0df86485c887bb66c3daaaadf.tar.gz bcm5719-llvm-90b6a2a6a78273b0df86485c887bb66c3daaaadf.zip |
[arcmt] Fix the ARC migrator. -arcmt-modify requires running before the initialization of SourceManager
because it is going to modify the input file.
llvm-svn: 133323
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 0024818ad85..0128d6ee053 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -130,6 +130,9 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, setCurrentFile(Filename, InputKind); setCompilerInstance(&CI); + if (!BeginInvocation(CI)) + goto failure; + // AST files follow a very different path, since they share objects via the // AST unit. if (InputKind == IK_AST) { @@ -386,8 +389,13 @@ ASTConsumer *WrapperFrontendAction::CreateASTConsumer(CompilerInstance &CI, llvm::StringRef InFile) { return WrappedAction->CreateASTConsumer(CI, InFile); } +bool WrapperFrontendAction::BeginInvocation(CompilerInstance &CI) { + return WrappedAction->BeginInvocation(CI); +} bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI, llvm::StringRef Filename) { + WrappedAction->setCurrentFile(getCurrentFile(), getCurrentFileKind()); + WrappedAction->setCompilerInstance(&CI); return WrappedAction->BeginSourceFileAction(CI, Filename); } void WrapperFrontendAction::ExecuteAction() { |