diff options
author | Meador Inge <meadori@codesourcery.com> | 2016-06-02 20:04:44 +0000 |
---|---|---|
committer | Meador Inge <meadori@codesourcery.com> | 2016-06-02 20:04:44 +0000 |
commit | a86df9bfdc1aafe9b9797a8bd83aa0da6e4c2970 (patch) | |
tree | 488bc262beb45687dbe1dc18cbde2eabaafb47b0 | |
parent | dba8b4c04d579b946572800d20419e70177b3194 (diff) | |
download | bcm5719-llvm-a86df9bfdc1aafe9b9797a8bd83aa0da6e4c2970.tar.gz bcm5719-llvm-a86df9bfdc1aafe9b9797a8bd83aa0da6e4c2970.zip |
[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
-rw-r--r-- | llvm/lib/AsmParser/LLLexer.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/llvm/lib/AsmParser/LLLexer.cpp b/llvm/lib/AsmParser/LLLexer.cpp index fd0081f6f97..bf457a95cd7 100644 --- a/llvm/lib/AsmParser/LLLexer.cpp +++ b/llvm/lib/AsmParser/LLLexer.cpp @@ -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; } |