summaryrefslogtreecommitdiffstats
path: root/clang/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
commit1b18ad240c9bc9e4e376e16d182cab7746e3519a (patch)
tree1062be7fe74ecd02ae1e513a7b94741204c8ca06 /clang/lib/Lex/PPDirectives.cpp
parent033f56d5335abac6808940c402b9fced0e30d8a6 (diff)
downloadbcm5719-llvm-1b18ad240c9bc9e4e376e16d182cab7746e3519a.tar.gz
bcm5719-llvm-1b18ad240c9bc9e4e376e16d182cab7746e3519a.zip
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. llvm-svn: 61360
Diffstat (limited to 'clang/lib/Lex/PPDirectives.cpp')
-rw-r--r--clang/lib/Lex/PPDirectives.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/clang/lib/Lex/PPDirectives.cpp b/clang/lib/Lex/PPDirectives.cpp
index 59df8255e32..a5684cc36a4 100644
--- a/clang/lib/Lex/PPDirectives.cpp
+++ b/clang/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;
}
OpenPOWER on IntegriCloud