diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-21 07:50:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-21 07:50:06 +0000 |
commit | d0a69696acca62798dfc8b98f97c92bfa7fa0490 (patch) | |
tree | 206e7e718ce60abc79b21ef5bac86252a0340bce /lib/Lex/PTHLexer.cpp | |
parent | d1186fa38166a581b51975f0382a45fc3a0733d0 (diff) |
merge two checks for identifiers in the pth loop into one.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62677 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r-- | lib/Lex/PTHLexer.cpp | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp index 99bb3f795d..aa59db5ae2 100644 --- a/lib/Lex/PTHLexer.cpp +++ b/lib/Lex/PTHLexer.cpp @@ -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; |