diff options
author | Daniel Dunbar <daniel@zuster.org> | 2009-07-29 06:45:14 +0000 |
---|---|---|
committer | Daniel Dunbar <daniel@zuster.org> | 2009-07-29 06:45:14 +0000 |
commit | 2ece02ff7eb63815c7700dac3fa66326f950f70c (patch) | |
tree | d38160f714e39607feaa710c739be64bd3581f1c /lib | |
parent | e92fc830c78914434432150f56e1532548789043 (diff) | |
download | external_llvm-2ece02ff7eb63815c7700dac3fa66326f950f70c.zip external_llvm-2ece02ff7eb63815c7700dac3fa66326f950f70c.tar.gz external_llvm-2ece02ff7eb63815c7700dac3fa66326f950f70c.tar.bz2 |
raw_ostream: Follow the 32-bit path when printing "small" decimal numbers.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@77444 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Support/raw_ostream.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Support/raw_ostream.cpp b/lib/Support/raw_ostream.cpp index 992c11a..d2d0f4e 100644 --- a/lib/Support/raw_ostream.cpp +++ b/lib/Support/raw_ostream.cpp @@ -89,6 +89,10 @@ raw_ostream &raw_ostream::operator<<(long N) { } raw_ostream &raw_ostream::operator<<(unsigned long long N) { + // Output using 32-bit div/mod when possible. + if (N == static_cast<unsigned long>(N)) + return this->operator<<(static_cast<unsigned long>(N)); + // Zero is a special case. if (N == 0) return *this << '0'; |