VMCore/AsmWriter.cpp: Use APFloat instead of atof(3).

atof(3) might behave differently among platforms.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@150661 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
NAKAMURA Takumi 2012-02-16 04:19:15 +00:00
parent 1834df8384
commit c8782a1a53

View File

@ -733,7 +733,7 @@ static void WriteConstantInternal(raw_ostream &Out, const Constant *CV,
((StrVal[0] == '-' || StrVal[0] == '+') &&
(StrVal[1] >= '0' && StrVal[1] <= '9'))) {
// Reparse stringized version!
if (atof(StrVal.c_str()) == Val) {
if (APFloat(APFloat::IEEEdouble, StrVal).convertToDouble() == Val) {
Out << StrVal.str();
return;
}