aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Frontend/FrontendAction.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-06-05 18:57:56 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-06-05 18:57:56 +0000
commit27e5aa08920da04e5f2798f7d4da9a5063da7be6 (patch)
treee6b0ddf9a454a71bc1d460e2d0cb06277d931405 /clang/lib/Frontend/FrontendAction.cpp
parent6b1993491535d59799de3a3bef4dd5b496b14b54 (diff)
downloadllvm-27e5aa08920da04e5f2798f7d4da9a5063da7be6.zip
llvm-27e5aa08920da04e5f2798f7d4da9a5063da7be6.tar.gz
llvm-27e5aa08920da04e5f2798f7d4da9a5063da7be6.tar.bz2
Factor out and unify emission of "module is unavailable" diagnostics.
Inspired by post-commit review of r304190. llvm-svn: 304728
Diffstat (limited to 'clang/lib/Frontend/FrontendAction.cpp')
-rw-r--r--clang/lib/Frontend/FrontendAction.cpp16
1 files changed, 2 insertions, 14 deletions
diff --git a/clang/lib/Frontend/FrontendAction.cpp b/clang/lib/Frontend/FrontendAction.cpp
index ef98172..2de8f06 100644
--- a/clang/lib/Frontend/FrontendAction.cpp
+++ b/clang/lib/Frontend/FrontendAction.cpp
@@ -443,21 +443,9 @@ static Module *prepareToBuildModule(CompilerInstance &CI,
}
// Check whether we can build this module at all.
- clang::Module::Requirement Requirement;
- clang::Module::UnresolvedHeaderDirective MissingHeader;
- if (!M->isAvailable(CI.getLangOpts(), CI.getTarget(), Requirement,
- MissingHeader)) {
- if (MissingHeader.FileNameLoc.isValid()) {
- CI.getDiagnostics().Report(MissingHeader.FileNameLoc,
- diag::err_module_header_missing)
- << MissingHeader.IsUmbrella << MissingHeader.FileName;
- } else {
- CI.getDiagnostics().Report(diag::err_module_unavailable)
- << M->getFullModuleName() << Requirement.second << Requirement.first;
- }
-
+ if (Preprocessor::checkModuleIsAvailable(CI.getLangOpts(), CI.getTarget(),
+ CI.getDiagnostics(), M))
return nullptr;
- }
// Inform the preprocessor that includes from within the input buffer should
// be resolved relative to the build directory of the module map file.