aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/Lex/ModuleMap.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r--clang/lib/Lex/ModuleMap.cpp16
1 files changed, 7 insertions, 9 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp
index bcdc5b8..12da5a8 100644
--- a/clang/lib/Lex/ModuleMap.cpp
+++ b/clang/lib/Lex/ModuleMap.cpp
@@ -1903,18 +1903,16 @@ void ModuleMapParser::parseModuleDecl() {
continue;
}
- if (ActiveModule) {
- Diags.Report(Id[I].second, diag::err_mmap_missing_module_qualified)
- << Id[I].first
- << ActiveModule->getTopLevelModule()->getFullModuleName();
- } else {
- Diags.Report(Id[I].second, diag::err_mmap_expected_module_name);
- }
+ Diags.Report(Id[I].second, diag::err_mmap_missing_parent_module)
+ << Id[I].first << (ActiveModule != nullptr)
+ << (ActiveModule
+ ? ActiveModule->getTopLevelModule()->getFullModuleName()
+ : "");
HadError = true;
- return;
}
- if (ModuleMapFile != Map.getContainingModuleMapFile(TopLevelModule)) {
+ if (TopLevelModule &&
+ ModuleMapFile != Map.getContainingModuleMapFile(TopLevelModule)) {
assert(ModuleMapFile != Map.getModuleMapFileForUniquing(TopLevelModule) &&
"submodule defined in same file as 'module *' that allowed its "
"top-level module");