Commit Graph

7 Commits

Author SHA1 Message Date
Zachary Turner
b53c2b0d14 Resubmit "Add support for advanced number formatting."
This resubmits r284436 and r284437, which were reverted in
r284462 as they were breaking the AArch64 buildbot.

The breakage on AArch64 turned out to be a miscompile which is
still not fixed, but is actively tracked at llvm.org/pr30748.

This resubmission re-writes the code in a way so as to make the
miscompile not happen.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@285483 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-29 00:27:22 +00:00
Renato Golin
8bb4ccc94b Revert "Resubmit "Add support for advanced number formatting.""
This reverts commits 284436 and 284437 because they still break AArch64 bots:

Value of: format_number(-10, IntegerStyle::Integer, 1)
  Actual: "-0"
  Expected: "-10"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284462 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-18 09:30:18 +00:00
Zachary Turner
88bc637ad2 Rename HexStyle -> HexFormatStyle, and remove a constexpr.
This should fix the remaining broken builds.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284437 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 23:08:47 +00:00
Zachary Turner
b3a18516ab Resubmit "Add support for advanced number formatting."
This resubmits commits 284425 and r284428, which were reverted
in r284429 due to some infinite recursion caused by an incorrect
selection of function overloads.  Reproduced the failure on Linux
using GCC 4.8.4, and confirmed that with the new patch the tests
path on GCC as well as MSVC.  So hopefully this fixes everything.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284436 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 22:49:24 +00:00
Zachary Turner
fdfb1c554e Revert formatting changes.
This reverts r288425 and r284428 as they are causing test crashes
on some systems.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284429 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 21:25:41 +00:00
Zachary Turner
d4bb10c270 Try to fix build after invalid pointer conversion.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284428 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 21:14:27 +00:00
Zachary Turner
0a7eca8829 [Support] Add support for "advanced" number formatting.
raw_ostream has not afforded a lot of flexibility in terms of
how to format numbers when outputting.  Wrap this all up into
a set of low level helper functions that can be used to output
numbers with arbitrary precision, alignment, format, etc and
then update raw_ostream to use these functions.

This will be useful for upcoming improvements to llvm's string
formatting libraries, but are still useful independently.

Differential Revision: https://reviews.llvm.org/D25497

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@284425 91177308-0d34-0410-b5e6-96231b3b80d8
2016-10-17 20:57:45 +00:00