[PATCH] D34518: [ADT] Add llvm::to_float
Pavel Labath via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Thu Jun 22 10:37:03 PDT 2017
labath created this revision.
The function matches the interface of llvm::to_integer, but as we are
calling out to a C library function (implementing it ourselves seemed
way too complicated), I let it take a Twine argument, so we can avoid a
string copy at least in some cases.
I add a test and replace a couple of existing uses of strtod with this
function.
https://reviews.llvm.org/D34518
Files:
include/llvm/ADT/StringExtras.h
lib/Support/CommandLine.cpp
lib/Support/YAMLTraits.cpp
unittests/ADT/StringExtrasTest.cpp
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D34518.103600.patch
Type: text/x-patch
Size: 4526 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20170622/177c7566/attachment.bin>
More information about the llvm-commits
mailing list