[cfe-commits] r64247 - /cfe/trunk/Driver/CacheTokens.cpp

Ted Kremenek kremenek at apple.com
Tue Feb 10 14:27:10 PST 2009


Author: kremenek
Date: Tue Feb 10 16:27:09 2009
New Revision: 64247

URL: http://llvm.org/viewvc/llvm-project?rev=64247&view=rev
Log:
PTH generation: Don't call 'EmitToken' in the loop condition.  This is preparing for other changes within the loop.

Modified:
    cfe/trunk/Driver/CacheTokens.cpp

Modified: cfe/trunk/Driver/CacheTokens.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/Driver/CacheTokens.cpp?rev=64247&r1=64246&r2=64247&view=diff

==============================================================================
--- cfe/trunk/Driver/CacheTokens.cpp (original)
+++ cfe/trunk/Driver/CacheTokens.cpp Tue Feb 10 16:27:09 2009
@@ -444,6 +444,7 @@
     
     if (Tok.is(tok::identifier)) {
       Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+      EmitToken(Tok);
       continue;
     }
 
@@ -460,8 +461,10 @@
       assert(!Tok.isAtStartOfLine());
       
       // Did we see 'include'/'import'/'include_next'?
-      if (!Tok.is(tok::identifier))
+      if (!Tok.is(tok::identifier)) {
+        EmitToken(Tok);
         continue;
+      }
       
       IdentifierInfo* II = PP.LookUpIdentifierInfo(Tok);
       Tok.setIdentifierInfo(II);
@@ -491,8 +494,8 @@
       case tok::pp_if:
       case tok::pp_ifdef:
       case tok::pp_ifndef: {
-        // Ad an entry for '#if' and friends.  We initially set the target index
-        // to 0.  This will get backpatched when we hit #endif.
+        // Add an entry for '#if' and friends.  We initially set the target
+        // index to 0.  This will get backpatched when we hit #endif.
         PPStartCond.push_back(PPCond.size());
         PPCond.push_back(std::make_pair(HashOff, 0U));
         break;
@@ -530,9 +533,11 @@
         break;
       }
       }
-    }    
+    }
+    
+    EmitToken(Tok);
   }
-  while (EmitToken(Tok), Tok.isNot(tok::eof));
+  while (Tok.isNot(tok::eof));
 
   assert(PPStartCond.empty() && "Error: imblanced preprocessor conditionals.");
 





More information about the cfe-commits mailing list