[cfe-commits] r98435 - in /cfe/trunk/lib: Frontend/CacheTokens.cpp Frontend/RewriteMacros.cpp Lex/TokenLexer.cpp
Kovarththanan Rajaratnam
kovarththanan.rajaratnam at gmail.com
Sat Mar 13 00:53:33 PST 2010
Author: krj
Date: Sat Mar 13 02:53:33 2010
New Revision: 98435
URL: http://llvm.org/viewvc/llvm-project?rev=98435&view=rev
Log:
No need to call setIdentifierInfo() after LookUpIdentifierInfo() which LookUpIdentifierInfo() will automatically do
Modified:
cfe/trunk/lib/Frontend/CacheTokens.cpp
cfe/trunk/lib/Frontend/RewriteMacros.cpp
cfe/trunk/lib/Lex/TokenLexer.cpp
Modified: cfe/trunk/lib/Frontend/CacheTokens.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/CacheTokens.cpp?rev=98435&r1=98434&r2=98435&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/CacheTokens.cpp (original)
+++ cfe/trunk/lib/Frontend/CacheTokens.cpp Sat Mar 13 02:53:33 2010
@@ -295,7 +295,7 @@
}
if (Tok.is(tok::identifier)) {
- Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+ PP.LookUpIdentifierInfo(Tok);
EmitToken(Tok);
continue;
}
@@ -321,7 +321,6 @@
}
IdentifierInfo* II = PP.LookUpIdentifierInfo(Tok);
- Tok.setIdentifierInfo(II);
tok::PPKeywordKind K = II->getPPKeywordID();
ParsingPreprocessorDirective = true;
@@ -344,7 +343,7 @@
L.setParsingPreprocessorDirective(false);
assert(!Tok.isAtStartOfLine());
if (Tok.is(tok::identifier))
- Tok.setIdentifierInfo(PP.LookUpIdentifierInfo(Tok));
+ PP.LookUpIdentifierInfo(Tok);
break;
}
Modified: cfe/trunk/lib/Frontend/RewriteMacros.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Frontend/RewriteMacros.cpp?rev=98435&r1=98434&r2=98435&view=diff
==============================================================================
--- cfe/trunk/lib/Frontend/RewriteMacros.cpp (original)
+++ cfe/trunk/lib/Frontend/RewriteMacros.cpp Sat Mar 13 02:53:33 2010
@@ -79,7 +79,7 @@
// 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));
Modified: cfe/trunk/lib/Lex/TokenLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/TokenLexer.cpp?rev=98435&r1=98434&r2=98435&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/TokenLexer.cpp (original)
+++ cfe/trunk/lib/Lex/TokenLexer.cpp Sat Mar 13 02:53:33 2010
@@ -325,7 +325,7 @@
// returned by PasteTokens, not the pasted token.
if (PasteTokens(Tok))
return;
-
+
TokenIsFromPaste = true;
}
@@ -506,8 +506,7 @@
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;
}
More information about the cfe-commits
mailing list