From 1db40ee0042d3ff4ca47ec282fadf5870268e397 Mon Sep 17 00:00:00 2001 From: Argyrios Kyrtzidis Date: Tue, 16 Feb 2016 05:39:33 +0000 Subject: [PATCH] [Frontend] Make sure WrapperFrontendAction updates CurrentInput after calling BeginSourceFileAction. I don't have a test case to add unfortunately. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@260937 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Frontend/FrontendAction.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/lib/Frontend/FrontendAction.cpp b/lib/Frontend/FrontendAction.cpp index a8166a647d..cdaa18a7a3 100644 --- a/lib/Frontend/FrontendAction.cpp +++ b/lib/Frontend/FrontendAction.cpp @@ -559,7 +559,10 @@ bool WrapperFrontendAction::BeginSourceFileAction(CompilerInstance &CI, StringRef Filename) { WrappedAction->setCurrentInput(getCurrentInput()); WrappedAction->setCompilerInstance(&CI); - return WrappedAction->BeginSourceFileAction(CI, Filename); + auto Ret = WrappedAction->BeginSourceFileAction(CI, Filename); + // BeginSourceFileAction may change CurrentInput, e.g. during module builds. + setCurrentInput(WrappedAction->getCurrentInput()); + return Ret; } void WrapperFrontendAction::ExecuteAction() { WrappedAction->ExecuteAction(); -- 2.40.0