summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2015-07-01 01:51:38 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2015-07-01 01:51:38 +0000
commit035f6dc9d1abe3ee88b6df1e5e46ee4c46d33da8 (patch)
treeea8382bf5ebdb66297601a37de9ba9d7a26ab8ad /clang/lib/Lex/PPDirectives.cpp
parent2374a7cba8ea820f27c05e3f7f8f7f98d27c650d (diff)
downloadbcm5719-llvm-035f6dc9d1abe3ee88b6df1e5e46ee4c46d33da8.tar.gz
bcm5719-llvm-035f6dc9d1abe3ee88b6df1e5e46ee4c46d33da8.zip
[modules] Make the include guard optimization fire a bit more when considering
re-entering a modular header. When we do the include guard check, we're in the visibility state for the file with the #include; the include guard may not be visible there, but we don't actually need it to be: if we've already parsed the submodule we're considering entering, it's always safe to skip it. llvm-svn: 241135
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 33ce7992281..ce64538de41 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/lib/Lex/PPDirectives.cpp
@@ -1749,7 +1749,8 @@ void Preprocessor::HandleIncludeDirective(SourceLocation HashLoc,
// Ask HeaderInfo if we should enter this #include file. If not, #including
// this file will have no effect.
if (ShouldEnter &&
- !HeaderInfo.ShouldEnterIncludeFile(*this, File, isImport)) {
+ !HeaderInfo.ShouldEnterIncludeFile(*this, File, isImport,
+ SuggestedModule.getModule())) {
ShouldEnter = false;
if (Callbacks)
Callbacks->FileSkipped(*File, FilenameTok, FileCharacter);
OpenPOWER on IntegriCloud