summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorVictor Leschuk <vleschuk@accesssoftek.com>2017-08-30 11:31:56 +0000
committerVictor Leschuk <vleschuk@accesssoftek.com>2017-08-30 11:31:56 +0000
commitdb68911b070847dd237518ff713e3349af0566ff (patch)
tree7f2b7db557cdf34df2041cceadae1cc75a4958ac /clang/lib/Frontend/CompilerInstance.cpp
parent89df797ee978f36f66bdd2e53501aaaeea3d8c28 (diff)
downloadbcm5719-llvm-db68911b070847dd237518ff713e3349af0566ff.tar.gz
bcm5719-llvm-db68911b070847dd237518ff713e3349af0566ff.zip
Revert r312105 [modules] Add ability to specify module name to module file mapping
Looks like it breaks win10 builder. llvm-svn: 312112
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp17
1 files changed, 4 insertions, 13 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index 9a4bcc2722e..84d837d4883 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -1641,14 +1641,6 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
} else if (ModuleName == getLangOpts().CurrentModule) {
// This is the module we're building.
Module = PP->getHeaderSearchInfo().lookupModule(ModuleName);
- /// FIXME: perhaps we should (a) look for a module using the module name
- // to file map (PrebuiltModuleFiles) and (b) diagnose if still not found?
- //if (Module == nullptr) {
- // getDiagnostics().Report(ModuleNameLoc, diag::err_module_not_found)
- // << ModuleName;
- // ModuleBuildFailed = true;
- // return ModuleLoadResult();
- //}
Known = KnownModules.insert(std::make_pair(Path[0].first, Module)).first;
} else {
// Search for a module with the given name.
@@ -1670,17 +1662,16 @@ CompilerInstance::loadModule(SourceLocation ImportLoc,
}
// Try to load the module from the prebuilt module path.
- if (Source == ModuleNotFound && (!HSOpts.PrebuiltModuleFiles.empty() ||
- !HSOpts.PrebuiltModulePaths.empty())) {
- ModuleFileName =
- PP->getHeaderSearchInfo().getPrebuiltModuleFileName(ModuleName);
+ if (Source == ModuleNotFound && !HSOpts.PrebuiltModulePaths.empty()) {
+ ModuleFileName = PP->getHeaderSearchInfo().getModuleFileName(
+ ModuleName, "", /*UsePrebuiltPath*/ true);
if (!ModuleFileName.empty())
Source = PrebuiltModulePath;
}
// Try to load the module from the module cache.
if (Source == ModuleNotFound && Module) {
- ModuleFileName = PP->getHeaderSearchInfo().getCachedModuleFileName(Module);
+ ModuleFileName = PP->getHeaderSearchInfo().getModuleFileName(Module);
Source = ModuleCache;
}
OpenPOWER on IntegriCloud