[llvm-commits] [llvm] r77444 - /llvm/trunk/lib/Support/raw_ostream.cpp

Daniel Dunbar daniel at zuster.org
Tue Jul 28 23:45:15 PDT 2009


Author: ddunbar
Date: Wed Jul 29 01:45:14 2009
New Revision: 77444

URL: http://llvm.org/viewvc/llvm-project?rev=77444&view=rev
Log:
raw_ostream: Follow the 32-bit path when printing "small" decimal numbers.

Modified:
    llvm/trunk/lib/Support/raw_ostream.cpp

Modified: llvm/trunk/lib/Support/raw_ostream.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/raw_ostream.cpp?rev=77444&r1=77443&r2=77444&view=diff

==============================================================================
--- llvm/trunk/lib/Support/raw_ostream.cpp (original)
+++ llvm/trunk/lib/Support/raw_ostream.cpp Wed Jul 29 01:45:14 2009
@@ -89,6 +89,10 @@
 }
 
 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';





More information about the llvm-commits mailing list