diff options
author | Daniel Jasper <djasper@google.com> | 2013-12-17 10:31:37 +0000 |
---|---|---|
committer | Daniel Jasper <djasper@google.com> | 2013-12-17 10:31:37 +0000 |
commit | 0761a8a085f404482b375f71e670da8ef2ea612e (patch) | |
tree | 910ebae7cd5a93306422c0bceeb7bd0bfaf2ac3a /clang/lib/Basic/Module.cpp | |
parent | 59bb0878e21df577f5d92ffef509d88ed6da1a95 (diff) | |
download | bcm5719-llvm-0761a8a085f404482b375f71e670da8ef2ea612e.tar.gz bcm5719-llvm-0761a8a085f404482b375f71e670da8ef2ea612e.zip |
Modules: Don't warn upon missing headers while reading the module map.
Instead, mark the module as unavailable so that clang errors as soon as
someone tries to build this module.
This works towards the long-term goal of not stat'ing the header files at all
while reading the module map and instead read them only when the module is
being built (there is a corresponding FIXME in parseHeaderDecl()). However, it
seems non-trivial to get there and this unblock us and moves us into the right
direction.
Also changed the implementation to reuse the same DiagnosticsEngine.
llvm-svn: 197485
Diffstat (limited to 'clang/lib/Basic/Module.cpp')
-rw-r--r-- | clang/lib/Basic/Module.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/clang/lib/Basic/Module.cpp b/clang/lib/Basic/Module.cpp index d08cef1a156..c6a1d602a94 100644 --- a/clang/lib/Basic/Module.cpp +++ b/clang/lib/Basic/Module.cpp @@ -69,11 +69,15 @@ static bool hasFeature(StringRef Feature, const LangOptions &LangOpts, bool Module::isAvailable(const LangOptions &LangOpts, const TargetInfo &Target, - Requirement &Req) const { + Requirement &Req, HeaderDirective &MissingHeader) const { if (IsAvailable) return true; for (const Module *Current = this; Current; Current = Current->Parent) { + if (!Current->MissingHeaders.empty()) { + MissingHeader = Current->MissingHeaders.front(); + return false; + } for (unsigned I = 0, N = Current->Requirements.size(); I != N; ++I) { if (hasFeature(Current->Requirements[I].first, LangOpts, Target) != Current->Requirements[I].second) { |