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

Reid Kleckner rnk at mit.edu
Wed Jul 29 09:56:27 PDT 2009


On Tue, Jul 28, 2009 at 11:45 PM, Daniel Dunbar<daniel at zuster.org> wrote:
> 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';

Doesn't the 'if (N == 0)' become dead code with this change?

Reid




More information about the llvm-commits mailing list