diff options
Diffstat (limited to 'clang/lib/Lex/HeaderSearch.cpp')
-rw-r--r-- | clang/lib/Lex/HeaderSearch.cpp | 23 |
1 files changed, 9 insertions, 14 deletions
diff --git a/clang/lib/Lex/HeaderSearch.cpp b/clang/lib/Lex/HeaderSearch.cpp index b18d27376a5..1ebcc0a1c65 100644 --- a/clang/lib/Lex/HeaderSearch.cpp +++ b/clang/lib/Lex/HeaderSearch.cpp @@ -128,24 +128,21 @@ void HeaderSearch::getHeaderMapFileNames( Names.push_back(HM.first->getName()); } -std::string HeaderSearch::getCachedModuleFileName(Module *Module) { +std::string HeaderSearch::getModuleFileName(Module *Module) { const FileEntry *ModuleMap = getModuleMap().getModuleMapFileForUniquing(Module); - return getCachedModuleFileName(Module->Name, ModuleMap->getName()); + return getModuleFileName(Module->Name, ModuleMap->getName(), + /*UsePrebuiltPath*/false); } -std::string HeaderSearch::getPrebuiltModuleFileName(StringRef ModuleName, - bool FileMapOnly) { - // First check the module name to pcm file map. - auto i (HSOpts->PrebuiltModuleFiles.find(ModuleName)); - if (i != HSOpts->PrebuiltModuleFiles.end()) - return i->second; - - if (FileMapOnly || HSOpts->PrebuiltModulePaths.empty()) +std::string HeaderSearch::getModuleFileName(StringRef ModuleName, + StringRef ModuleMapPath, + bool UsePrebuiltPath) { + if (UsePrebuiltPath) { + if (HSOpts->PrebuiltModulePaths.empty()) return std::string(); - // Then go through each prebuilt module directory and try to find the pcm - // file. + // Go though each prebuilt module path and try to find the pcm file. for (const std::string &Dir : HSOpts->PrebuiltModulePaths) { SmallString<256> Result(Dir); llvm::sys::fs::make_absolute(Result); @@ -157,8 +154,6 @@ std::string HeaderSearch::getPrebuiltModuleFileName(StringRef ModuleName, return std::string(); } -std::string HeaderSearch::getCachedModuleFileName(StringRef ModuleName, - StringRef ModuleMapPath) { // If we don't have a module cache path or aren't supposed to use one, we // can't do anything. if (getModuleCachePath().empty()) |