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 | b53460e9879f74be8f36cbc95209e628e9feecf3 (patch) | |
| tree | 2a6f083aa0d9f88a5fad7e6253a5fb55f7a1ca6c /lib/Lex/ModuleMap.cpp | |
| parent | 1c069a8d13cacf40bf3121f852f3647e82271ac9 (diff) | |
| download | clang-b53460e9879f74be8f36cbc95209e628e9feecf3.tar.gz clang-b53460e9879f74be8f36cbc95209e628e9feecf3.tar.bz2 clang-b53460e9879f74be8f36cbc95209e628e9feecf3.tar.xz | |
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.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@206664 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/ModuleMap.cpp')
| -rw-r--r-- | lib/Lex/ModuleMap.cpp | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/Lex/ModuleMap.cpp b/lib/Lex/ModuleMap.cpp index 27ba7620ff..0e712b0dce 100644 --- a/lib/Lex/ModuleMap.cpp +++ b/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); } } |
