[llvm-commits] CVS: llvm/include/llvm/DerivedTypes.h
Chris Lattner
clattner at apple.com
Wed Feb 28 19:46:41 PST 2007
> Add an IntegerType::getMask() method to get an APInt mask for the
> type.
Please move this method out of line, forward declare APInt, and
remove the #include,
Thanks,
-Chris
>
> ---
> Diffs of the changes: (+8 -0)
>
> DerivedTypes.h | 8 ++++++++
> 1 files changed, 8 insertions(+)
>
>
> Index: llvm/include/llvm/DerivedTypes.h
> diff -u llvm/include/llvm/DerivedTypes.h:1.84 llvm/include/llvm/
> DerivedTypes.h:1.85
> --- llvm/include/llvm/DerivedTypes.h:1.84 Wed Feb 14 21:39:17 2007
> +++ llvm/include/llvm/DerivedTypes.h Wed Feb 28 20:25:03 2007
> @@ -19,6 +19,7 @@
> #define LLVM_DERIVED_TYPES_H
>
> #include "llvm/Type.h"
> +#include "llvm/ADT/APInt.h"
>
> namespace llvm {
>
> @@ -108,6 +109,13 @@
> return ~uint64_t(0UL) >> (64-getPrimitiveSizeInBits());
> }
>
> + /// For example, this is 0xFF for an 8 bit integer, 0xFFFF for
> i16, etc.
> + /// @returns a bit mask with ones set for all the bits of this
> type.
> + /// @brief Get a bit mask for this type.
> + APInt getMask() const {
> + return APInt::getAllOnesValue(getBitWidth());
> + }
> +
> /// This method determines if the width of this IntegerType is a
> power-of-2
> /// in terms of 8 bit bytes.
> /// @returns true if this is a power-of-2 byte width.
>
>
>
> _______________________________________________
> 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