summaryrefslogtreecommitdiffstats
path: root/clang/lib/Serialization
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2011-12-20 00:28:52 +0000
committerDouglas Gregor <dgregor@apple.com>2011-12-20 00:28:52 +0000
commit98a52db80c80fb45adb65a341c1dae62dcc364a2 (patch)
tree0ec00c68dea7a0616b3eba390f2e7e191510e4b7 /clang/lib/Serialization
parent9eb3f00406abcb3498b3e5e702eb69a9612a88bc (diff)
downloadbcm5719-llvm-98a52db80c80fb45adb65a341c1dae62dcc364a2.tar.gz
bcm5719-llvm-98a52db80c80fb45adb65a341c1dae62dcc364a2.zip
Detect when mapping a #include/#import over to a submodule ends up
hitting a submodule that was never actually created, e.g., because that header wasn't parsed. In such cases, complain (because the module's umbrella headers don't cover everything) and fall back to including the header. Later, we'll add a warning at module-build time to catch all such cases. However, this fallback is important to eliminate assertions in the ASTWriter when this happens. llvm-svn: 146933
Diffstat (limited to 'clang/lib/Serialization')
-rw-r--r--clang/lib/Serialization/ASTReader.cpp1
-rw-r--r--clang/lib/Serialization/ASTWriter.cpp1
2 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Serialization/ASTReader.cpp b/clang/lib/Serialization/ASTReader.cpp
index 1efc95408b3..9fc2962d27c 100644
--- a/clang/lib/Serialization/ASTReader.cpp
+++ b/clang/lib/Serialization/ASTReader.cpp
@@ -3086,6 +3086,7 @@ ASTReader::ASTReadResult ASTReader::ReadSubmoduleBlock(ModuleFile &F) {
return Failure;
}
+ CurrentModule->IsFromModuleFile = true;
CurrentModule->InferSubmodules = InferSubmodules;
CurrentModule->InferExplicitSubmodules = InferExplicitSubmodules;
CurrentModule->InferExportWildcard = InferExportWildcard;
diff --git a/clang/lib/Serialization/ASTWriter.cpp b/clang/lib/Serialization/ASTWriter.cpp
index 1776b97bb03..6883dbe3294 100644
--- a/clang/lib/Serialization/ASTWriter.cpp
+++ b/clang/lib/Serialization/ASTWriter.cpp
@@ -1877,7 +1877,6 @@ void ASTWriter::WriteSubmodules(Module *WritingModule) {
for (ASTContext::import_iterator I = Context->local_import_begin(),
IEnd = Context->local_import_end();
I != IEnd; ++I) {
- assert(SubmoduleIDs.find(I->getImportedModule()) != SubmoduleIDs.end());
if (Module *ImportedFrom
= ModMap.inferModuleFromLocation(FullSourceLoc(I->getLocation(),
SrcMgr))) {
OpenPOWER on IntegriCloud