[cfe-commits] r62677 - /cfe/trunk/lib/Lex/PTHLexer.cpp
Chris Lattner
sabre at nondot.org
Tue Jan 20 23:50:06 PST 2009
Author: lattner
Date: Wed Jan 21 01:50:06 2009
New Revision: 62677
URL: http://llvm.org/viewvc/llvm-project?rev=62677&view=rev
Log:
merge two checks for identifiers in the pth loop into one.
Modified:
cfe/trunk/lib/Lex/PTHLexer.cpp
Modified: cfe/trunk/lib/Lex/PTHLexer.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PTHLexer.cpp?rev=62677&r1=62676&r2=62677&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PTHLexer.cpp (original)
+++ cfe/trunk/lib/Lex/PTHLexer.cpp Wed Jan 21 01:50:06 2009
@@ -125,11 +125,19 @@
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 @@
<< '\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;
More information about the cfe-commits
mailing list