[llvm-commits] CVS: llvm/lib/VMCore/AsmWriter.cpp ConstantFolding.cpp Constants.cpp Instructions.cpp Type.cpp Verifier.cpp
Chris Lattner
clattner at apple.com
Fri Jan 12 14:40:36 PST 2007
On Jan 11, 2007, at 11:06 PM, Reid Spencer wrote:
> +//
> ===-------------------------------------------------------------------
> ---===//
> +// Integer Type Factory...
> +//
> +namespace llvm {
> +class IntegerValType {
> + uint16_t bits;
> +public:
> + IntegerValType(uint16_t numbits) : bits(numbits) {}
> +
> + static IntegerValType get(const IntegerType *Ty) {
> + return IntegerValType(Ty->getBitWidth());
> + }
> +
> + static unsigned hashTypeStructure(const IntegerType *Ty) {
> + return (unsigned)Ty->getBitWidth();
> + }
> +
> + inline bool operator<(const IntegerValType &IVT) const {
> + return bits < IVT.bits;
> + }
> +};
> +}
uint16_t is not sufficient here. You need at least uint23_t :)
-Chris
More information about the llvm-commits
mailing list