From 90b6a2a6a78273b0df86485c887bb66c3daaaadf Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Sat, 18 Jun 2011 00:53:41 +0000 Subject: [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 --- clang/lib/Frontend/FrontendAction.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'clang/lib/Frontend/FrontendAction.cpp') diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index 0024818..0128d6e 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() { -- cgit v1.1