diff options
author | Renato Golin <renato.golin@linaro.org> | 2016-10-18 09:30:18 +0000 |
---|---|---|
committer | Renato Golin <renato.golin@linaro.org> | 2016-10-18 09:30:18 +0000 |
commit | 9ce5074d29c8fb65d362476a6eef600baae07d39 (patch) | |
tree | f98e51a9d5f96e54f6568ab603436c3fd473d21d /llvm/lib/Support/raw_ostream.cpp | |
parent | 33f138b5668000df732e74150b3dd0cc827f9389 (diff) | |
download | llvm-9ce5074d29c8fb65d362476a6eef600baae07d39.zip llvm-9ce5074d29c8fb65d362476a6eef600baae07d39.tar.gz llvm-9ce5074d29c8fb65d362476a6eef600baae07d39.tar.bz2 |
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"
llvm-svn: 284462
Diffstat (limited to 'llvm/lib/Support/raw_ostream.cpp')
-rw-r--r-- | llvm/lib/Support/raw_ostream.cpp | 28 |
1 files changed, 9 insertions, 19 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp index eb89535..8101bc1 100644 --- a/llvm/lib/Support/raw_ostream.cpp +++ b/llvm/lib/Support/raw_ostream.cpp @@ -114,27 +114,27 @@ void raw_ostream::SetBufferAndMode(char *BufferStart, size_t Size, } raw_ostream &raw_ostream::operator<<(unsigned long N) { - write_integer(*this, static_cast<uint64_t>(N), IntegerStyle::Integer); + write_ulong(*this, N, 0); return *this; } raw_ostream &raw_ostream::operator<<(long N) { - write_integer(*this, static_cast<int64_t>(N), IntegerStyle::Integer); + write_long(*this, N, 0); return *this; } raw_ostream &raw_ostream::operator<<(unsigned long long N) { - write_integer(*this, static_cast<uint64_t>(N), IntegerStyle::Integer); + write_ulonglong(*this, N, 0); return *this; } raw_ostream &raw_ostream::operator<<(long long N) { - write_integer(*this, static_cast<int64_t>(N), IntegerStyle::Integer); + write_longlong(*this, N, 0); return *this; } raw_ostream &raw_ostream::write_hex(unsigned long long N) { - llvm::write_hex(*this, N, HexPrintStyle::Lower); + llvm::write_hex(*this, N, 0, false, false); return *this; } @@ -179,12 +179,12 @@ raw_ostream &raw_ostream::write_escaped(StringRef Str, } raw_ostream &raw_ostream::operator<<(const void *P) { - llvm::write_hex(*this, (uintptr_t)P, HexPrintStyle::PrefixLower); + llvm::write_hex(*this, (uintptr_t)P, 0, false, true); return *this; } raw_ostream &raw_ostream::operator<<(double N) { - llvm::write_double(*this, N, FloatStyle::Exponent); + llvm::write_double(*this, N, 0, 0, FloatStyle::Exponent); return *this; } @@ -331,19 +331,9 @@ raw_ostream &raw_ostream::operator<<(const FormattedString &FS) { raw_ostream &raw_ostream::operator<<(const FormattedNumber &FN) { if (FN.Hex) { - HexPrintStyle Style; - if (FN.Upper && FN.HexPrefix) - Style = HexPrintStyle::PrefixUpper; - else if (FN.Upper && !FN.HexPrefix) - Style = HexPrintStyle::Upper; - else if (!FN.Upper && FN.HexPrefix) - Style = HexPrintStyle::PrefixLower; - else - Style = HexPrintStyle::Lower; - llvm::write_hex(*this, FN.HexValue, Style, FN.Width, None); + llvm::write_hex(*this, FN.HexValue, FN.Width, FN.Upper, FN.HexPrefix); } else { - llvm::write_integer(*this, FN.DecValue, IntegerStyle::Integer, None, - FN.Width); + llvm::write_longlong(*this, FN.DecValue, FN.Width); } return *this; } |