[cfe-commits] r97327 - /cfe/trunk/lib/Lex/PPExpressions.cpp
Benjamin Kramer
benny.kra at googlemail.com
Sat Feb 27 08:29:37 PST 2010
Author: d0k
Date: Sat Feb 27 10:29:36 2010
New Revision: 97327
URL: http://llvm.org/viewvc/llvm-project?rev=97327&view=rev
Log:
Another trivial getSpelling simplification.
Modified:
cfe/trunk/lib/Lex/PPExpressions.cpp
Modified: cfe/trunk/lib/Lex/PPExpressions.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Lex/PPExpressions.cpp?rev=97327&r1=97326&r2=97327&view=diff
==============================================================================
--- cfe/trunk/lib/Lex/PPExpressions.cpp (original)
+++ cfe/trunk/lib/Lex/PPExpressions.cpp Sat Feb 27 10:29:36 2010
@@ -170,10 +170,8 @@
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.
More information about the cfe-commits
mailing list