summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex/LiteralSupport.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'clang/lib/Lex/LiteralSupport.cpp')
-rw-r--r--clang/lib/Lex/LiteralSupport.cpp7
1 files changed, 1 insertions, 6 deletions
diff --git a/clang/lib/Lex/LiteralSupport.cpp b/clang/lib/Lex/LiteralSupport.cpp
index ab669422b27..f1993d22643 100644
--- a/clang/lib/Lex/LiteralSupport.cpp
+++ b/clang/lib/Lex/LiteralSupport.cpp
@@ -615,17 +615,12 @@ GetFloatValue(const llvm::fltSemantics &Format, bool* isExact) {
using llvm::APFloat;
using llvm::StringRef;
- llvm::SmallVector<char,256> floatChars;
unsigned n = std::min(SuffixBegin - ThisTokBegin, ThisTokEnd - ThisTokBegin);
- for (unsigned i = 0; i != n; ++i)
- floatChars.push_back(ThisTokBegin[i]);
-
- floatChars.push_back('\0');
APFloat V (Format, APFloat::fcZero, false);
APFloat::opStatus status;
- status = V.convertFromString(StringRef(&floatChars[0], n),
+ status = V.convertFromString(StringRef(ThisTokBegin, n),
APFloat::rmNearestTiesToEven);
if (isExact)
OpenPOWER on IntegriCloud