aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPCaching.cpp
diff options
context:
space:
mode:
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-12 21:41:41 +0000
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>2010-07-12 21:41:41 +0000
commit8951bfde1d72a376b6932a4e14957629701d3481 (patch)
treeb92b0b7f28335cdd911f2694d7e5319de6f45f3c /lib/Lex/PPCaching.cpp
parent0a67eddc8fa2d6d1319deff0d52850f079753b2a (diff)
Remove the check for repeated tok::eofs, we are not supposed to go past eof so this code is
totally unnecessary. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108199 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPCaching.cpp')
-rw-r--r--lib/Lex/PPCaching.cpp13
1 files changed, 4 insertions, 9 deletions
diff --git a/lib/Lex/PPCaching.cpp b/lib/Lex/PPCaching.cpp
index 16fcaa365c..33106591c3 100644
--- a/lib/Lex/PPCaching.cpp
+++ b/lib/Lex/PPCaching.cpp
@@ -54,10 +54,7 @@ void Preprocessor::CachingLex(Token &Result) {
}
ExitCachingLexMode();
- // True if we consumed everything already.
- bool PastEOF = CurPPLexer == 0 && CurTokenLexer == 0;
- if (!PastEOF)
- Lex(Result);
+ Lex(Result);
if (!isBacktrackEnabled()) {
// All cached tokens were consumed.
@@ -66,12 +63,10 @@ void Preprocessor::CachingLex(Token &Result) {
return;
}
- // Cache the lexed token if it's not a repeated tok::eof.
+ // Cache the lexed token.
EnterCachingLexMode();
- if (!PastEOF) {
- CachedTokens.push_back(Result);
- ++CachedLexPos;
- }
+ CachedTokens.push_back(Result);
+ ++CachedLexPos;
}
void Preprocessor::EnterCachingLexMode() {