aboutsummaryrefslogtreecommitdiff
path: root/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Frontend/CompilerInstance.cpp')
-rw-r--r--lib/Frontend/CompilerInstance.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/lib/Frontend/CompilerInstance.cpp b/lib/Frontend/CompilerInstance.cpp
index 0e3b25168f..ea2c3bd6c6 100644
--- a/lib/Frontend/CompilerInstance.cpp
+++ b/lib/Frontend/CompilerInstance.cpp
@@ -278,9 +278,7 @@ void CompilerInstance::createPreprocessor() {
llvm::sys::path::append(SpecificModuleCache,
getInvocation().getModuleHash());
PP->getHeaderSearchInfo().configureModules(SpecificModuleCache,
- getPreprocessorOpts().ModuleBuildPath.empty()
- ? std::string()
- : getPreprocessorOpts().ModuleBuildPath.back());
+ getLangOpts().CurrentModule);
// Handle generating dependencies, if requested.
const DependencyOutputOptions &DepOpts = getDependencyOutputOpts();
@@ -992,6 +990,9 @@ static void compileModule(CompilerInstance &ImportingInstance,
Invocation->getLangOpts().resetNonModularOptions();
Invocation->getPreprocessorOpts().resetNonModularOptions();
+ // Note the name of the module we're building.
+ Invocation->getLangOpts().CurrentModule = ModuleName;
+
// Note that this module is part of the module build path, so that we
// can detect cycles in the module graph.
Invocation->getPreprocessorOpts().ModuleBuildPath.push_back(ModuleName);