diff options
author | Ben Langmuir <blangmuir@apple.com> | 2014-04-18 22:07:31 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2014-04-18 22:07:31 +0000 |
commit | ec8c975214ceb9f59301e2abcd084fcdff06fbcd (patch) | |
tree | 52c5c5952a7ba7061df3421293c7679fa5a32193 /clang/lib/Lex/ModuleMap.cpp | |
parent | b5d368e838934c1347063a20302acb0afea5f3ab (diff) | |
download | bcm5719-llvm-ec8c975214ceb9f59301e2abcd084fcdff06fbcd.tar.gz bcm5719-llvm-ec8c975214ceb9f59301e2abcd084fcdff06fbcd.zip |
Don't build modules with (submodules with) missing headers
Unless they are in submodules that aren't available anyway, due to
requirements not being met. Also, mark children as unavailable when the
parent is.
llvm-svn: 206664
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index 27ba7620ff5..0e712b0dce6 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -1477,6 +1477,15 @@ void ModuleMapParser::parseModuleDecl() { inferFrameworkLink(ActiveModule, Directory, SourceMgr.getFileManager()); } + // If the module meets all requirements but is still unavailable, mark the + // whole tree as unavailable to prevent it from building. + if (!ActiveModule->IsAvailable && !ActiveModule->IsMissingRequirement && + ActiveModule->Parent) { + ActiveModule->getTopLevelModule()->markUnavailable(); + ActiveModule->getTopLevelModule()->MissingHeaders.append( + ActiveModule->MissingHeaders.begin(), ActiveModule->MissingHeaders.end()); + } + // We're done parsing this module. Pop back to the previous module. ActiveModule = PreviousActiveModule; } @@ -1705,9 +1714,8 @@ void ModuleMapParser::parseHeaderDecl(MMToken::TokenKind LeadingToken, // If we find a module that has a missing header, we mark this module as // unavailable and store the header directive for displaying diagnostics. - // Other submodules in the same module can still be used. Header.IsUmbrella = LeadingToken == MMToken::UmbrellaKeyword; - ActiveModule->IsAvailable = false; + ActiveModule->markUnavailable(); ActiveModule->MissingHeaders.push_back(Header); } } |