[llvm-commits] [llvm] r74494 - in /llvm/trunk: include/llvm/ADT/APInt.h lib/Support/APInt.cpp
Bill Wendling
isanbard at gmail.com
Tue Jun 30 00:06:17 PDT 2009
Dan,
This was causing the unittests to fail. I temporarily reverted it.
Could you take a look please?
-bw
On Jun 29, 2009, at 6:28 PM, Dan Gohman wrote:
> Author: djg
> Date: Mon Jun 29 20:28:08 2009
> New Revision: 74494
>
> URL: http://llvm.org/viewvc/llvm-project?rev=74494&view=rev
> Log:
> Define an operator<< for APInt to be used with std::ostream.
> This will allow it to be used in unittests that use gtest's
> EXPECT_EQ.
>
> Modified:
> llvm/trunk/include/llvm/ADT/APInt.h
> llvm/trunk/lib/Support/APInt.cpp
>
> Modified: llvm/trunk/include/llvm/ADT/APInt.h
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/include/llvm/ADT/APInt.h?rev=74494&r1=74493&r2=74494&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/include/llvm/ADT/APInt.h (original)
> +++ llvm/trunk/include/llvm/ADT/APInt.h Mon Jun 29 20:28:08 2009
> @@ -1426,6 +1426,8 @@
> return OS;
> }
>
> +std::ostream &operator<<(std::ostream &o, const APInt &I);
> +
> namespace APIntOps {
>
> /// @brief Determine the smaller of two APInts considered to be
> signed.
>
> Modified: llvm/trunk/lib/Support/APInt.cpp
> URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/APInt.cpp?rev=74494&r1=74493&r2=74494&view=diff
>
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- llvm/trunk/lib/Support/APInt.cpp (original)
> +++ llvm/trunk/lib/Support/APInt.cpp Mon Jun 29 20:28:08 2009
> @@ -2178,6 +2178,12 @@
> OS << S.c_str();
> }
>
> +std::ostream &operator<<(std::ostream &o, const APInt &I) {
> + raw_os_ostream OS(o);
> + OS << I;
> + return o;
> +}
> +
> // This implements a variety of operations on a representation of
> // arbitrary precision, two's-complement, bignum integer values.
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits
More information about the llvm-commits
mailing list