Add a method to get the bit width of a packed type.

llvm-svn: 31750
This commit is contained in:
Reid Spencer 2006-11-15 03:02:41 +00:00
parent 1396961e85
commit 8f73ba7e05
1 changed files with 6 additions and 0 deletions

View File

@ -299,8 +299,14 @@ public:
///
static PackedType *get(const Type *ElementType, unsigned NumElements);
/// @brief Return the number of elements in the Packed type.
inline unsigned getNumElements() const { return NumElements; }
/// @brief Return the number of bits in the Packed type.
inline unsigned getBitWidth() const {
return NumElements *getElementType()->getPrimitiveSizeInBits();
}
// Implement the AbstractTypeUser interface.
virtual void refineAbstractType(const DerivedType *OldTy, const Type *NewTy);
virtual void typeBecameConcrete(const DerivedType *AbsTy);