diff options
author | Chris Lattner <sabre@nondot.org> | 2009-01-18 02:34:01 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2009-01-18 02:34:01 +0000 |
commit | 18fc6ceb561d6e484742ff23ec538dfdfb05b7b7 (patch) | |
tree | 82fad26d265b39e36aa1902a29760a0814a56203 /clang/lib/Lex/PTHLexer.cpp | |
parent | da4df2928c80a151862ac62e24894da9760f498b (diff) | |
download | bcm5719-llvm-18fc6ceb561d6e484742ff23ec538dfdfb05b7b7.tar.gz bcm5719-llvm-18fc6ceb561d6e484742ff23ec538dfdfb05b7b7.zip |
rename some variables, only set a tokens identifierinfo if non-null.
llvm-svn: 62450
Diffstat (limited to 'clang/lib/Lex/PTHLexer.cpp')
-rw-r--r-- | clang/lib/Lex/PTHLexer.cpp | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/clang/lib/Lex/PTHLexer.cpp b/clang/lib/Lex/PTHLexer.cpp index 92c5e8815b3..a1d7f5735ea 100644 --- a/clang/lib/Lex/PTHLexer.cpp +++ b/clang/lib/Lex/PTHLexer.cpp @@ -107,9 +107,9 @@ LexNextToken: const unsigned char *CurPtrShadow = CurPtr; // Read in the data for the token. - tok::TokenKind k = (tok::TokenKind) Read8(CurPtrShadow); - Token::TokenFlags flags = (Token::TokenFlags) Read8(CurPtrShadow); - uint32_t perID = Read24(CurPtrShadow); + tok::TokenKind TKind = (tok::TokenKind) Read8(CurPtrShadow); + Token::TokenFlags TFlags = (Token::TokenFlags) Read8(CurPtrShadow); + uint32_t IdentifierID = Read24(CurPtrShadow); uint32_t FileOffset = Read32(CurPtrShadow); uint32_t Len = Read16(CurPtrShadow); CurPtr = CurPtrShadow; @@ -119,10 +119,11 @@ LexNextToken: //===--------------------------------------==// Tok.startToken(); - Tok.setKind(k); - Tok.setFlag(flags); + Tok.setKind(TKind); + Tok.setFlag(TFlags); assert(!LexingRawMode); - Tok.setIdentifierInfo(perID ? PTHMgr.GetIdentifierInfo(perID-1) : 0); + if (IdentifierID) + Tok.setIdentifierInfo(PTHMgr.GetIdentifierInfo(IdentifierID-1)); Tok.setLocation(FileStartLoc.getFileLocWithOffset(FileOffset)); Tok.setLength(Len); @@ -137,12 +138,12 @@ LexNextToken: << '\n'; #endif - if (k == tok::identifier) { + if (TKind == tok::identifier) { MIOpt.ReadToken(); return PP->HandleIdentifier(Tok); } - if (k == tok::eof) { + if (TKind == tok::eof) { // Save the end-of-file token. EofToken = Tok; @@ -159,7 +160,7 @@ LexNextToken: return PPCache->Lex(Tok); } - if (k == tok::hash && Tok.isAtStartOfLine()) { + if (TKind == tok::hash && Tok.isAtStartOfLine()) { LastHashTokPtr = CurPtr - DISK_TOKEN_SIZE; assert(!LexingRawMode); PP->HandleDirective(Tok); @@ -170,7 +171,7 @@ LexNextToken: return PP->Lex(Tok); } - if (k == tok::eom) { + if (TKind == tok::eom) { assert(ParsingPreprocessorDirective); ParsingPreprocessorDirective = false; return; |