]> granicus.if.org Git - clang/commitdiff
merge two checks for identifiers in the pth loop into one.
authorChris Lattner <sabre@nondot.org>
Wed, 21 Jan 2009 07:50:06 +0000 (07:50 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 21 Jan 2009 07:50:06 +0000 (07:50 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62677 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Lex/PTHLexer.cpp

index 99bb3f795d8a82d84a3ac78c77306d9525351b37..aa59db5ae2a0dbb71c6cc355a6ef5f24276d7f1c 100644 (file)
@@ -125,11 +125,19 @@ LexNextToken:
   Tok.setKind(TKind);
   Tok.setFlag(TFlags);
   assert(!LexingRawMode);
-  if (IdentifierID)
-    Tok.setIdentifierInfo(PTHMgr.GetIdentifierInfo(IdentifierID-1));
   Tok.setLocation(FileStartLoc.getFileLocWithOffset(FileOffset));
   Tok.setLength(Len);
 
+  // Handle identifiers.
+  if (IdentifierID) {
+    MIOpt.ReadToken();
+    IdentifierInfo *II = PTHMgr.GetIdentifierInfo(IdentifierID-1);
+    Tok.setIdentifierInfo(II);
+    if (II->isHandleIdentifierCase())
+      PP->HandleIdentifier(Tok);
+    return;
+  }
+  
   //===--------------------------------------==//
   // Process the token.
   //===--------------------------------------==//
@@ -141,13 +149,6 @@ LexNextToken:
     << '\n';
 #endif  
 
-  if (TKind == tok::identifier) {
-    MIOpt.ReadToken();
-    if (Tok.getIdentifierInfo()->isHandleIdentifierCase())
-      PP->HandleIdentifier(Tok);
-    return;
-  }
-  
   if (TKind == tok::eof) {
     // Save the end-of-file token.
     EofToken = Tok;