Another trivial getSpelling simplification.

llvm-svn: 97327
This commit is contained in:
Benjamin Kramer 2010-02-27 16:29:36 +00:00
parent d46ed89d79
commit 53fa347ee6
1 changed files with 2 additions and 4 deletions

View File

@ -170,10 +170,8 @@ static bool EvaluateValue(PPValue &Result, Token &PeekTok, DefinedTracker &DT,
return true;
case tok::numeric_constant: {
llvm::SmallString<64> IntegerBuffer;
IntegerBuffer.resize(PeekTok.getLength());
const char *ThisTokBegin = &IntegerBuffer[0];
unsigned ActualLength = PP.getSpelling(PeekTok, ThisTokBegin);
NumericLiteralParser Literal(ThisTokBegin, ThisTokBegin+ActualLength,
llvm::StringRef Spelling = PP.getSpelling(PeekTok, IntegerBuffer);
NumericLiteralParser Literal(Spelling.begin(), Spelling.end(),
PeekTok.getLocation(), PP);
if (Literal.hadError)
return true; // a diagnostic was already reported.