aboutsummaryrefslogtreecommitdiff
path: root/lib/Lex/PPExpressions.cpp
diff options
context:
space:
mode:
authorBenjamin Kramer <benny.kra@googlemail.com>2010-02-27 16:29:36 +0000
committerBenjamin Kramer <benny.kra@googlemail.com>2010-02-27 16:29:36 +0000
commitaeb863c3b4f1b1f38a524d21570c17aa8fd9e9c9 (patch)
tree211f27619b3a3c1bfcaef28d06732dc32aafb839 /lib/Lex/PPExpressions.cpp
parentb9021e9955358dcca3aaa3db7a9b8114aa284902 (diff)
Another trivial getSpelling simplification.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@97327 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Lex/PPExpressions.cpp')
-rw-r--r--lib/Lex/PPExpressions.cpp6
1 files 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.