[llvm-commits] [llvm] r160223 - in /llvm/trunk/include/llvm/ADT: APInt.h APSInt.h

Duncan Sands baldrick at free.fr
Sat Jul 14 23:26:45 PDT 2012


Hi Eric,

 > Move IsSameValue from clang's ASTImporter to be methods on the
> APInt/APSInt classes.
...
> --- llvm/trunk/include/llvm/ADT/APInt.h (original)
> +++ llvm/trunk/include/llvm/ADT/APInt.h Sat Jul 14 19:23:36 2012
> @@ -511,6 +511,18 @@
>       return getAllOnesValue(numBits).lshr(numBits - loBitsSet);
>     }
>
> +  /// \brief Determine if two APInts have the same value, after zero-extending
> +  /// one of them (if needed!) to ensure that the bit-widths match.
> +  static bool isSameValue(const APInt &I1, const APInt &I2) {

maybe this should be called isSameZExtValue or isSameUnsignedValue since it is
really an unsigned operation (eg you can easily imagine a signed version of
this).

Ciao, Duncan.



More information about the llvm-commits mailing list