From aeb863c3b4f1b1f38a524d21570c17aa8fd9e9c9 Mon Sep 17 00:00:00 2001 From: Benjamin Kramer Date: Sat, 27 Feb 2010 16:29:36 +0000 Subject: [PATCH] Another trivial getSpelling simplification. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97327 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Lex/PPExpressions.cpp | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/lib/Lex/PPExpressions.cpp b/lib/Lex/PPExpressions.cpp index 6c9212632f..ede129edcb 100644 --- a/lib/Lex/PPExpressions.cpp +++ b/lib/Lex/PPExpressions.cpp @@ -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. -- 2.40.0