diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-01-23 00:01:13 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2015-01-23 00:01:13 +0000 |
commit | ac425e9165019ccaa0ee1be0a88c90ae84d84175 (patch) | |
tree | 1e7b00b26f6e11663a36612a10b7711acc98d20b /clang/lib/Frontend/FrontendAction.cpp | |
parent | 5f715d36a7e04c11e1ce9b6aeb723d3b75053c40 (diff) | |
download | bcm5719-llvm-ac425e9165019ccaa0ee1be0a88c90ae84d84175.tar.gz bcm5719-llvm-ac425e9165019ccaa0ee1be0a88c90ae84d84175.zip |
PR22299: Relocate code for handling -fmodule-map-file= so that we don't try to
produce diagnostics with source locations before the diagnostics system is
ready for them.
llvm-svn: 226882
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r-- | clang/lib/Frontend/FrontendAction.cpp | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp index c81c81aba4d..0bb5d87407b 100644 --- a/clang/lib/Frontend/FrontendAction.cpp +++ b/clang/lib/Frontend/FrontendAction.cpp @@ -383,6 +383,15 @@ bool FrontendAction::BeginSourceFile(CompilerInstance &CI, "doesn't support modules"); } + // If we were asked to load any module map files, do so now. + for (const auto &Filename : CI.getFrontendOpts().ModuleMapFiles) { + if (auto *File = CI.getFileManager().getFile(Filename)) + CI.getPreprocessor().getHeaderSearchInfo().loadModuleMapFile( + File, /*IsSystem*/false); + else + CI.getDiagnostics().Report(diag::err_module_map_not_found) << Filename; + } + // If we were asked to load any module files, do so now. for (const auto &ModuleFile : CI.getFrontendOpts().ModuleFiles) if (!CI.loadModuleFile(ModuleFile)) |