[ASMParser] Parse FP constants in non-C locales

This patch fixes PR25788, which allows for the parsing of
floating-point constants in non-C locales.

Patch by Antoine Pitrou!

Differential Revision: http://reviews.llvm.org/D15375

llvm-svn: 271574
This commit is contained in:
Meador Inge 2016-06-02 20:04:44 +00:00
parent dba8b4c04d
commit a86df9bfdc
1 changed files with 4 additions and 2 deletions

View File

@ -958,7 +958,8 @@ lltok::Kind LLLexer::LexDigitOrNegative() {
}
}
APFloatVal = APFloat(std::atof(TokStart));
APFloatVal = APFloat(APFloat::IEEEdouble,
StringRef(TokStart, CurPtr - TokStart));
return lltok::APFloat;
}
@ -994,6 +995,7 @@ lltok::Kind LLLexer::LexPositive() {
}
}
APFloatVal = APFloat(std::atof(TokStart));
APFloatVal = APFloat(APFloat::IEEEdouble,
StringRef(TokStart, CurPtr - TokStart));
return lltok::APFloat;
}