diff options
author | Ben Langmuir <blangmuir@apple.com> | 2014-04-18 23:51:00 +0000 |
---|---|---|
committer | Ben Langmuir <blangmuir@apple.com> | 2014-04-18 23:51:00 +0000 |
commit | 993055f860b4c65998394044495dc408d51214ee (patch) | |
tree | 2c7dd9673bee033d7cf9ee33c38a372fadc040c2 /clang/lib/Basic/Module.cpp | |
parent | 4bc13f6b474e0534d0f791029d65f6846afac989 (diff) | |
download | llvm-993055f860b4c65998394044495dc408d51214ee.zip llvm-993055f860b4c65998394044495dc408d51214ee.tar.gz llvm-993055f860b4c65998394044495dc408d51214ee.tar.bz2 |
Fix a hole with nested unavailable submodules from r206664
If a module doesn't meet a requirement, neither do its submodules. If we
don't propogate that, we might think it's an error to be missing a
header in one of those submodules.
llvm-svn: 206673
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index 6f29fae..64013bd 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -39,6 +39,7 @@ Module::Module(StringRef Name, SourceLocation DefinitionLoc, Module *Parent, IsSystem = true; if (Parent->IsExternC) IsExternC = true; + IsMissingRequirement = Parent->IsMissingRequirement; Parent->SubModuleIndex[Name] = Parent->SubModules.size(); Parent->SubModules.push_back(this); @@ -160,11 +161,10 @@ void Module::addRequirement(StringRef Feature, bool RequiredState, if (hasFeature(Feature, LangOpts, Target) == RequiredState) return; - IsMissingRequirement = true; - markUnavailable(); + markUnavailable(/*MissingRequirement*/true); } -void Module::markUnavailable() { +void Module::markUnavailable(bool MissingRequirement) { if (!IsAvailable) return; @@ -178,6 +178,7 @@ void Module::markUnavailable() { continue; Current->IsAvailable = false; + Current->IsMissingRequirement |= MissingRequirement; for (submodule_iterator Sub = Current->submodule_begin(), SubEnd = Current->submodule_end(); Sub != SubEnd; ++Sub) { |