getLimitedValue now just forward to APInt's getLimitedValue. Mark it const.
authorChris Lattner <sabre@nondot.org>
Tue, 10 Apr 2007 06:44:12 +0000 (06:44 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 10 Apr 2007 06:44:12 +0000 (06:44 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@35861 91177308-0d34-0410-b5e6-96231b3b80d8

include/llvm/Constants.h

index e09fc84c929a15ef8b4629ffeb5ea8d141ec5aaa..0659f3b5133560594ec6b3e1d4f25122a82a27e3 100644 (file)
@@ -189,9 +189,8 @@ public:
   /// @returns the 64-bit value of this constant if its active bits number is 
   /// not greater than 64, otherwise, just return the given uint64_t number.
   /// @brief Get the constant's value if possible.
-  uint64_t getLimitedValue(uint64_t Limit) {
-    return (Val.getActiveBits() > 64 || Val.getZExtValue() > Limit) ? 
-           Limit : Val.getZExtValue();
+  uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
+    return Val.getLimitedValue(Limit);
   }
 
   /// @returns the value for an integer constant of the given type that has all