[PATCH] D32276: [AsmWriter/APFloat] FP constant printing: Avoid usage of locale dependent snprinf

Serguei Katkov via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Thu Apr 20 03:31:41 PDT 2017


skatkov marked 3 inline comments as done.
skatkov added a comment.

Actually I considered the re-writing llvm::write_double() to be locale independent. I decided to go with solution due to:

1. to be consistent with Lexer which also uses APFloat
2. llvm::write_double() is used in raw_ostream which might be widely used and may be someone really want it to be locale specific.
3. Actually re-writing llvm::write_double() will require me to just re-use printf functionality for double just only remove locale specific code. I'm not sure about licensing but it is a big piece of code to write it from scratch. However most of the code should look like APFloat::toString.

So I decided to go with this solution. Does it make sense?


https://reviews.llvm.org/D32276





More information about the llvm-commits mailing list