diff options
author | Stella Stamenova <stilis@microsoft.com> | 2020-11-05 17:16:14 -0800 |
---|---|---|
committer | Stella Stamenova <stilis@microsoft.com> | 2020-11-05 17:16:14 -0800 |
commit | c67656b994c87224e0b33e2c4b09093986a5cfa6 (patch) | |
tree | b9fe25d9dc45203ab2ec46f96b96f7beab16c79c /clang/lib/Frontend/CompilerInstance.cpp | |
parent | 99a99c29c6daef56a320a0d77bb6691aa66d81f1 (diff) | |
download | llvm-c67656b994c87224e0b33e2c4b09093986a5cfa6.zip llvm-c67656b994c87224e0b33e2c4b09093986a5cfa6.tar.gz llvm-c67656b994c87224e0b33e2c4b09093986a5cfa6.tar.bz2 |
Revert "Allow searching for prebuilt implicit modules."
This reverts commit 71e108cd86e70b06c5fa3a63689dcb3555c3d13f.
This change caused a build failure on Windows:
http://lab.llvm.org:8011/#/builders/83/builds/570
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r-- | clang/lib/Frontend/CompilerInstance.cpp | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp index f4b00df..030ef42 100644 --- a/clang/lib/Frontend/CompilerInstance.cpp +++ b/clang/lib/Frontend/CompilerInstance.cpp @@ -428,12 +428,8 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) { PP->setPreprocessedOutput(getPreprocessorOutputOpts().ShowCPP); - if (PP->getLangOpts().Modules && PP->getLangOpts().ImplicitModules) { - std::string ModuleHash = getInvocation().getModuleHash(); - PP->getHeaderSearchInfo().setModuleHash(ModuleHash); - PP->getHeaderSearchInfo().setModuleCachePath( - getSpecificModuleCachePath(ModuleHash)); - } + if (PP->getLangOpts().Modules && PP->getLangOpts().ImplicitModules) + PP->getHeaderSearchInfo().setModuleCachePath(getSpecificModuleCachePath()); // Handle generating dependencies, if requested. const DependencyOutputOptions &DepOpts = getDependencyOutputOpts(); @@ -481,11 +477,13 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) { } } -std::string CompilerInstance::getSpecificModuleCachePath(StringRef ModuleHash) { - // Set up the module path, including the hash for the module-creation options. +std::string CompilerInstance::getSpecificModuleCachePath() { + // Set up the module path, including the hash for the + // module-creation options. SmallString<256> SpecificModuleCache(getHeaderSearchOpts().ModuleCachePath); if (!SpecificModuleCache.empty() && !getHeaderSearchOpts().DisableModuleHash) - llvm::sys::path::append(SpecificModuleCache, ModuleHash); + llvm::sys::path::append(SpecificModuleCache, + getInvocation().getModuleHash()); return std::string(SpecificModuleCache.str()); } @@ -1675,8 +1673,6 @@ static ModuleSource selectModuleSource( if (!HSOpts.PrebuiltModuleFiles.empty() || !HSOpts.PrebuiltModulePaths.empty()) { ModuleFilename = HS.getPrebuiltModuleFileName(ModuleName); - if (HSOpts.EnablePrebuiltImplicitModules && ModuleFilename.empty()) - ModuleFilename = HS.getPrebuiltImplicitModuleFileName(M); if (!ModuleFilename.empty()) return MS_PrebuiltModulePath; } |