diff options
author | Erik Verbruggen <erikjv@me.com> | 2017-11-03 09:40:07 +0000 |
---|---|---|
committer | Erik Verbruggen <erikjv@me.com> | 2017-11-03 09:40:07 +0000 |
commit | 4d1eb2d5cb97b99fc0d8559661a7b569dc8ecc90 (patch) | |
tree | 41228f5cc84ebac7b103b02ef68f181967647fae /clang/lib/Lex/Preprocessor.cpp | |
parent | 8c825db25e32365652c9d68177224f8c3c1a551a (diff) | |
download | bcm5719-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.cpp | 7 |
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); } } |