summaryrefslogtreecommitdiffstats
path: root/clang/lib/Frontend/CompilerInstance.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2014-12-06 01:13:41 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2014-12-06 01:13:41 +0000
commit4a89a06d0d90b101e8866ecc4a5d239f32f9a243 (patch)
tree6be5871acc23b2eff1a861acf23923a199bb2a05 /clang/lib/Frontend/CompilerInstance.cpp
parentceeb74e606f4c4ad22dd4d471a4b2b901987eff0 (diff)
downloadbcm5719-llvm-4a89a06d0d90b101e8866ecc4a5d239f32f9a243.tar.gz
bcm5719-llvm-4a89a06d0d90b101e8866ecc4a5d239f32f9a243.zip
PR21217: Slightly more eagerly load -fmodule-map-file= files and provide
diagnostics if they don't exist. Based on a patch by John Thompson! llvm-svn: 223561
Diffstat (limited to 'clang/lib/Frontend/CompilerInstance.cpp')
-rw-r--r--clang/lib/Frontend/CompilerInstance.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/clang/lib/Frontend/CompilerInstance.cpp b/clang/lib/Frontend/CompilerInstance.cpp
index dcc824723aa..a5165ad6211 100644
--- a/clang/lib/Frontend/CompilerInstance.cpp
+++ b/clang/lib/Frontend/CompilerInstance.cpp
@@ -371,6 +371,14 @@ void CompilerInstance::createPreprocessor(TranslationUnitKind TUKind) {
AttachHeaderIncludeGen(*PP, /*ShowAllHeaders=*/false, /*OutputPath=*/"",
/*ShowDepth=*/true, /*MSStyle=*/true);
}
+
+ // Load all explictly-specified module map files.
+ for (const auto &Filename : getFrontendOpts().ModuleMapFiles) {
+ if (auto *File = getFileManager().getFile(Filename))
+ PP->getHeaderSearchInfo().loadModuleMapFile(File, /*IsSystem*/false);
+ else
+ getDiagnostics().Report(diag::err_module_map_not_found) << Filename;
+ }
}
// ASTContext
OpenPOWER on IntegriCloud