summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/Preprocessor.cpp
diff options
context:
space:
mode:
authorErik Verbruggen <erikjv@me.com>2017-11-03 09:40:07 +0000
committerErik Verbruggen <erikjv@me.com>2017-11-03 09:40:07 +0000
commit4d1eb2d5cb97b99fc0d8559661a7b569dc8ecc90 (patch)
tree41228f5cc84ebac7b103b02ef68f181967647fae /clang/lib/Lex/Preprocessor.cpp
parent8c825db25e32365652c9d68177224f8c3c1a551a (diff)
downloadbcm5719-llvm-4d1eb2d5cb97b99fc0d8559661a7b569dc8ecc90.tar.gz
bcm5719-llvm-4d1eb2d5cb97b99fc0d8559661a7b569dc8ecc90.zip
[preamble] Also record the "skipping" state of the preprocessor
When a preamble ends in a conditional preprocessor block that is being skipped, the preprocessor needs to continue skipping that block when the preamble is used. This fixes PR34570. llvm-svn: 317308
Diffstat (limited to 'clang/lib/Lex/Preprocessor.cpp')
-rw-r--r--clang/lib/Lex/Preprocessor.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Lex/Preprocessor.cpp b/clang/lib/Lex/Preprocessor.cpp
index 65df6a57f1d..d80899de8f8 100644
--- a/clang/lib/Lex/Preprocessor.cpp
+++ b/clang/lib/Lex/Preprocessor.cpp
@@ -550,6 +550,13 @@ void Preprocessor::replayPreambleConditionalStack() {
"CurPPLexer is null when calling replayPreambleConditionalStack.");
CurPPLexer->setConditionalLevels(PreambleConditionalStack.getStack());
PreambleConditionalStack.doneReplaying();
+ if (PreambleConditionalStack.reachedEOFWhileSkipping())
+ SkipExcludedConditionalBlock(
+ PreambleConditionalStack.SkipInfo->HashTokenLoc,
+ PreambleConditionalStack.SkipInfo->IfTokenLoc,
+ PreambleConditionalStack.SkipInfo->FoundNonSkipPortion,
+ PreambleConditionalStack.SkipInfo->FoundElse,
+ PreambleConditionalStack.SkipInfo->ElseLoc);
}
}
OpenPOWER on IntegriCloud