]> granicus.if.org Git - clang/commitdiff
Remove the check for repeated tok::eofs, we are not supposed to go past eof so this...
authorArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 12 Jul 2010 21:41:41 +0000 (21:41 +0000)
committerArgyrios Kyrtzidis <akyrtzi@gmail.com>
Mon, 12 Jul 2010 21:41:41 +0000 (21:41 +0000)
totally unnecessary.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@108199 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PPCaching.cpp

index 16fcaa365cb4a5bc911a75be03ea9d15420ba2b6..33106591c3bac793fc235665ddbcbc50cd134fe1 100644 (file)
@@ -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() {