]> granicus.if.org Git - clang/commitdiff
No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifi...
authorKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>
Sat, 13 Mar 2010 08:53:33 +0000 (08:53 +0000)
committerKovarththanan Rajaratnam <kovarththanan.rajaratnam@gmail.com>
Sat, 13 Mar 2010 08:53:33 +0000 (08:53 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@98435 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Frontend/CacheTokens.cpp
lib/Frontend/RewriteMacros.cpp
lib/Lex/TokenLexer.cpp

index c845d56f4ec183281ff237da63f87b83bd5a3f47..ab5465a2fa2b2b2b8e3bd1f3832cb4e183ec59d6 100644 (file)
@@ -295,7 +295,7 @@ PTHEntry PTHWriter::LexTokens(Lexer& L) {
     }
 
     if (Tok.is(tok::identifier)) {
-      Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+      PP.LookUpIdentifierInfo(Tok);
       EmitToken(Tok);
       continue;
     }
@@ -321,7 +321,6 @@ PTHEntry PTHWriter::LexTokens(Lexer& L) {
       }
 
       IdentifierInfo* II = PP.LookUpIdentifierInfo(Tok);
-      Tok.setIdentifierInfo(II);
       tok::PPKeywordKind K = II->getPPKeywordID();
 
       ParsingPreprocessorDirective = true;
@@ -344,7 +343,7 @@ PTHEntry PTHWriter::LexTokens(Lexer& L) {
         L.setParsingPreprocessorDirective(false);
         assert(!Tok.isAtStartOfLine());
         if (Tok.is(tok::identifier))
-          Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+          PP.LookUpIdentifierInfo(Tok);
 
         break;
       }
index 0bcbd4ff0ee4c8aa37468d8a8e27f06494bad801..954e8e23cac79728c1a0805767df235e774d75b3 100644 (file)
@@ -79,7 +79,7 @@ static void LexRawTokensFromMainFile(Preprocessor &PP,
     // up the indentifier info.  This is important for equality comparison of
     // identifier tokens.
     if (RawTok.is(tok::identifier) && !RawTok.getIdentifierInfo())
-      RawTok.setIdentifierInfo(PP.LookUpIdentifierInfo(RawTok));
+      PP.LookUpIdentifierInfo(RawTok);
 
     RawTokens.push_back(RawTok);
   } while (RawTok.isNot(tok::eof));
index 5d95eb39c89e614ea187b3b326018df7a824f82e..aae735213d8a66935705cb661330631c2c0535bf 100644 (file)
@@ -325,7 +325,7 @@ void TokenLexer::Lex(Token &Tok) {
     // returned by PasteTokens, not the pasted token.
     if (PasteTokens(Tok))
       return;
-    
+
     TokenIsFromPaste = true;
   }
 
@@ -506,8 +506,7 @@ bool TokenLexer::PasteTokens(Token &Tok) {
   if (Tok.is(tok::identifier)) {
     // Look up the identifier info for the token.  We disabled identifier lookup
     // by saying we're skipping contents, so we need to do this manually.
-    IdentifierInfo *II = PP.LookUpIdentifierInfo(Tok, ResultTokStrPtr);
-    Tok.setIdentifierInfo(II);
+    PP.LookUpIdentifierInfo(Tok, ResultTokStrPtr);
   }
   return false;
 }