add a helper function to constantint.
authorChris Lattner <sabre@nondot.org>
Tue, 3 Apr 2007 01:41:34 +0000 (01:41 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 3 Apr 2007 01:41:34 +0000 (01:41 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35610 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Constants.h

index a36ac6e74749adfef3ad922937d6ee1a72244509..e09fc84c929a15ef8b4629ffeb5ea8d141ec5aaa 100644 (file)
@@ -52,6 +52,9 @@ public:
   inline const APInt& getValue() const {
     return Val;
   }
+  
+  /// getBitWidth - Return the bitwidth of this constant.
+  unsigned getBitWidth() const { return Val.getBitWidth(); }
 
   /// Return the constant as a 64-bit unsigned integer value after it
   /// has been zero extended as appropriate for the type of this constant. Note