r260937 - [Frontend] Make sure WrapperFrontendAction updates CurrentInput after calling BeginSourceFileAction.
Argyrios Kyrtzidis via cfe-commits
cfe-commits at lists.llvm.org
Mon Feb 15 21:39:33 PST 2016
Author: akirtzidis
Date: Mon Feb 15 23:39:33 2016
New Revision: 260937
URL: http://llvm.org/viewvc/llvm-project?rev=260937&view=rev
Log:
[Frontend] Make sure WrapperFrontendAction updates CurrentInput after calling BeginSourceFileAction.
I don't have a test case to add unfortunately.
Modified:
cfe/trunk/lib/Frontend/FrontendAction.cpp
Modified: cfe/trunk/lib/Frontend/FrontendAction.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/FrontendAction.cpp?rev=260937&r1=260936&r2=260937&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/FrontendAction.cpp (original)
+++ cfe/trunk/lib/Frontend/FrontendAction.cpp Mon Feb 15 23:39:33 2016
@@ -559,7 +559,10 @@ bool WrapperFrontendAction::BeginSourceF
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();
More information about the cfe-commits
mailing list