summaryrefslogtreecommitdiffstats
path: root/clang/lib/Lex
diff options
context:
space:
mode:
authorJohn McCall <rjmccall@apple.com>2009-12-23 01:37:10 +0000
committerJohn McCall <rjmccall@apple.com>2009-12-23 01:37:10 +0000
commit230a5d527e8c6e188b3f8af47f7889420db03221 (patch)
tree637d4f28308e872460eae2e5ed3d91bd72d710c6 /clang/lib/Lex
parent417c8a43d61489a5ccca0e4e30f84c2f945b7fa9 (diff)
downloadbcm5719-llvm-230a5d527e8c6e188b3f8af47f7889420db03221.tar.gz
bcm5719-llvm-230a5d527e8c6e188b3f8af47f7889420db03221.zip
Eliminate a completely unnecessary buffer copy when parsing float literals.
llvm-svn: 91974
Diffstat (limited to 'clang/lib/Lex')
-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