Changes in directory llvm/include/llvm:

DerivedTypes.h updated: 1.71 -> 1.72
---
Log message:

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


---
Diffs of the changes:  (+6 -0)

 DerivedTypes.h |    6 ++++++
 1 files changed, 6 insertions(+)


Index: llvm/include/llvm/DerivedTypes.h
diff -u llvm/include/llvm/DerivedTypes.h:1.71 
llvm/include/llvm/DerivedTypes.h:1.72
--- llvm/include/llvm/DerivedTypes.h:1.71       Tue Feb  7 00:17:10 2006
+++ llvm/include/llvm/DerivedTypes.h    Tue Nov 14 21:02:41 2006
@@ -299,8 +299,14 @@
   ///
   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);



_______________________________________________
llvm-commits mailing list
llvm-commits@cs.uiuc.edu
http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits

Reply via email to