forked from OSchip/llvm-project
parent
8bb4edb236
commit
c5a00067ac
|
|
@ -341,21 +341,20 @@ FinishIdentifier:
|
|||
Result.SetKind(tok::identifier);
|
||||
|
||||
// Look up this token, see if it is a macro, or if it is a language keyword.
|
||||
const char *SpelledTokStart, *SpelledTokEnd;
|
||||
IdentifierTokenInfo *II;
|
||||
if (!Result.needsCleaning()) {
|
||||
// No cleaning needed, just use the characters from the lexed buffer.
|
||||
SpelledTokStart = IdStart;
|
||||
SpelledTokEnd = IdEnd;
|
||||
II = PP.getIdentifierInfo(IdStart, IdEnd);
|
||||
} else {
|
||||
// Cleaning needed, alloca a buffer, clean into it, then use the buffer.
|
||||
char *TmpBuf = (char*)alloca(Result.getLength());
|
||||
unsigned Size = PP.getSpelling(Result, TmpBuf);
|
||||
SpelledTokStart = TmpBuf;
|
||||
SpelledTokEnd = TmpBuf+Size;
|
||||
II = PP.getIdentifierInfo(TmpBuf, TmpBuf+Size);
|
||||
}
|
||||
Result.SetIdentifierInfo(II);
|
||||
|
||||
Result.SetIdentifierInfo(PP.getIdentifierInfo(SpelledTokStart,
|
||||
SpelledTokEnd));
|
||||
// Finally, now that we know we have an identifier, pass this off to the
|
||||
// preprocessor, which may macro expand it or something.
|
||||
return PP.HandleIdentifier(Result);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue