diff options
author | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-01-12 19:15:33 +0000 |
---|---|---|
committer | Bruno Cardoso Lopes <bruno.cardoso@gmail.com> | 2017-01-12 19:15:33 +0000 |
commit | 052d95a6d697f973172b08b2f743dda9bd58dcf3 (patch) | |
tree | 215055f299c55ae9792d3a4e14530831fa9d9d68 /clang/lib/Lex/ModuleMap.cpp | |
parent | 45337df08f99529e1543ecb7c236ea63707c673b (diff) | |
download | bcm5719-llvm-052d95a6d697f973172b08b2f743dda9bd58dcf3.tar.gz bcm5719-llvm-052d95a6d697f973172b08b2f743dda9bd58dcf3.zip |
[Modules] Fix misleading warning about missing textual header in umbrella header
When a textual header is present inside a umbrella dir but not in the
header, we get the misleading warning:
warning: umbrella header for module 'FooFramework' does not include
header 'Baz_Private.h'
The module map in question:
framework module FooFramework {
umbrella header "FooUmbrella.h"
export *
module * { export * }
module Private {
textual header "Baz_Private.h"
}
}
Fix this by taking textual headers into account.
llvm-svn: 291794
Diffstat (limited to 'clang/lib/Lex/ModuleMap.cpp')
-rw-r--r-- | clang/lib/Lex/ModuleMap.cpp | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/clang/lib/Lex/ModuleMap.cpp b/clang/lib/Lex/ModuleMap.cpp index db834ede022..1488f624da6 100644 --- a/clang/lib/Lex/ModuleMap.cpp +++ b/clang/lib/Lex/ModuleMap.cpp @@ -446,9 +446,19 @@ ModuleMap::isHeaderUnavailableInModule(const FileEntry *Header, I = Known->second.begin(), E = Known->second.end(); I != E; ++I) { - if (I->isAvailable() && (!RequestingModule || - I->getModule()->isSubModuleOf(RequestingModule))) + + if (I->isAvailable() && + (!RequestingModule || + I->getModule()->isSubModuleOf(RequestingModule))) { + // When no requesting module is available, the caller is looking if a + // header is part a module by only looking into the module map. This is + // done by warn_uncovered_module_header checks; don't consider textual + // headers part of it in this mode, otherwise we get misleading warnings + // that a umbrella header is not including a textual header. + if (!RequestingModule && I->getRole() == ModuleMap::TextualHeader) + continue; return false; + } } return true; } |