Value* only has 2 bits free as well.
[oota-llvm.git] / include / llvm / Constants.h
index efae25525d26b5e57f6053bc3e71a9e490d148d9..f25d010f4ac45bdb0a1beaffa04488d5ceea6706 100644 (file)
@@ -7,7 +7,8 @@
 //
 //===----------------------------------------------------------------------===//
 //
-/// @file This file contains the declarations for the subclasses of Constant, 
+/// @file
+/// This file contains the declarations for the subclasses of Constant, 
 /// which represent the different flavors of constant values that live in LLVM.
 /// Note that Constants are immutable (once created they never change) and are 
 /// fully shared by structural equivalence.  This means that two structurally
@@ -75,7 +76,7 @@ public:
   }
 
   /// Return the constant as a 64-bit integer value after it has been sign
-  /// sign extended as appropriate for the type of this constant. Note that
+  /// extended as appropriate for the type of this constant. Note that
   /// this method can assert if the value does not fit in 64 bits.
   /// @deprecated
   /// @brief Return the sign extended value.
@@ -195,9 +196,11 @@ public:
     return Val.getActiveBits() > 64 || Val.getZExtValue() >= Num;
   }
 
-  /// @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.
+  /// getLimitedValue - If the value is smaller than the specified limit,
+  /// return it, otherwise return the limit value.  This causes the value
+  /// to saturate to the limit.
+  /// @returns the min of the value of the constant and the specified value
+  /// @brief Get the constant's value with a saturation limit
   uint64_t getLimitedValue(uint64_t Limit = ~0ULL) const {
     return Val.getLimitedValue(Limit);
   }
@@ -262,11 +265,12 @@ public:
   bool isExactlyValue(const APFloat& V) const;
 
   bool isExactlyValue(double V) const {
+    bool ignored;
     // convert is not supported on this type
     if (&Val.getSemantics() == &APFloat::PPCDoubleDouble)
       return false;
     APFloat FV(V);
-    FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven);
+    FV.convert(Val.getSemantics(), APFloat::rmNearestTiesToEven, &ignored);
     return isExactlyValue(FV);
   }
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
@@ -294,7 +298,7 @@ protected:
 public:
   /// get() - static factory method for creating a null aggregate.  It is
   /// illegal to call this method with a non-aggregate type.
-  static Constant *get(const Type *Ty);
+  static ConstantAggregateZero *get(const Type *Ty);
 
   /// isNullValue - Return true if this is the value that would be returned by
   /// getNullValue.
@@ -753,7 +757,7 @@ public:
   /// operands replaced with the specified values.  The specified operands must
   /// match count and type with the existing ones.
   Constant *getWithOperands(const std::vector<Constant*> &Ops) const {
-    return getWithOperands(&Ops[0], Ops.size());
+    return getWithOperands(&Ops[0], (unsigned)Ops.size());
   }
   Constant *getWithOperands(Constant* const *Ops, unsigned NumOps) const;