aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPDirectives.cpp
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-12-23 01:30:52 +0000
committerTed Kremenek <kremenek@apple.com>2008-12-23 01:30:52 +0000
commite5680f3cd678014cf0872d34726dc804b0cbbdd4 (patch)
tree5b9950de1461e2b7456082320fc5b304dab6b792 /lib/Lex/PPDirectives.cpp
parent2a7e58dc24b17b1cb900a1ee30ea328d665b1a64 (diff)
PTH:
- Embed 'eom' tokens in PTH file. - Use embedded 'eom' tokens to not lazily generate them in the PTHLexer. This means that PTHLexer can always advance to the next token after reading a token (instead of buffering tokens using a copy). - Moved logic of 'ReadToken' into Lex. GetToken & ReadToken no longer exist. - These changes result in a 3.3% speedup (-Eonly) on Cocoa.h. - The code is a little gross. Many cleanups are possible and should be done. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@61360 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPDirectives.cpp')
-rw-r--r--lib/Lex/PPDirectives.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/Lex/PPDirectives.cpp b/lib/Lex/PPDirectives.cpp
index 59df8255e3..a5684cc36a 100644
--- a/lib/Lex/PPDirectives.cpp
+++ b/lib/Lex/PPDirectives.cpp
@@ -339,6 +339,13 @@ void Preprocessor::PTHSkipExcludedConditionalBlock() {
// If the #if block wasn't entered then enter the #else block now.
if (!CondInfo.FoundNonSkip) {
CondInfo.FoundNonSkip = true;
+
+ // Consume the eom token.
+ CurPTHLexer->ParsingPreprocessorDirective = true;
+ LexUnexpandedToken(Tok);
+ assert(Tok.is(tok::eom));
+ CurPTHLexer->ParsingPreprocessorDirective = false;
+
break;
}