summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Support
diff options
context:
space:
mode:
authorDaniel Dunbar <daniel@zuster.org>2009-07-29 06:45:14 +0000
committerDaniel Dunbar <daniel@zuster.org>2009-07-29 06:45:14 +0000
commita94f58aee5c813d0bd8f2da4788043ce42c1d475 (patch)
tree2038f20eab621ac4aab02d6a29559a2899f4b7f7 /llvm/lib/Support
parenta40b912352ef1d722f220bbc28b3de7273f90ac4 (diff)
downloadbcm5719-llvm-a94f58aee5c813d0bd8f2da4788043ce42c1d475.tar.gz
bcm5719-llvm-a94f58aee5c813d0bd8f2da4788043ce42c1d475.zip
raw_ostream: Follow the 32-bit path when printing "small" decimal numbers.
llvm-svn: 77444
Diffstat (limited to 'llvm/lib/Support')
-rw-r--r--llvm/lib/Support/raw_ostream.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/llvm/lib/Support/raw_ostream.cpp b/llvm/lib/Support/raw_ostream.cpp
index 992c11a8220..d2d0f4ef2a2 100644
--- a/llvm/lib/Support/raw_ostream.cpp
+++ b/llvm/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';
OpenPOWER on IntegriCloud