aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PTHLexer.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2009-01-18 02:34:01 +0000
committerChris Lattner <sabre@nondot.org>2009-01-18 02:34:01 +0000
commit898a0bb1972efb6e03cb1151412ec7392cef07de (patch)
tree874b933cc58533a9be27692dfccc823a914b37ed /lib/Lex/PTHLexer.cpp
parent4b4218f48fef71a179c5a8287dae281580faf52f (diff)
rename some variables, only set a tokens identifierinfo if non-null.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@62450 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PTHLexer.cpp')
-rw-r--r--lib/Lex/PTHLexer.cpp21
1 files changed, 11 insertions, 10 deletions
diff --git a/lib/Lex/PTHLexer.cpp b/lib/Lex/PTHLexer.cpp
index 92c5e8815b..a1d7f5735e 100644
--- a/lib/Lex/PTHLexer.cpp
+++ b/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;