Add BasicBlock level dominates(A,B) interface.
[oota-llvm.git] / include / llvm / Constants.h
index e09fc84c929a15ef8b4629ffeb5ea8d141ec5aaa..c14d25d67657997e7246fe586c37acda08f0f683 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
@@ -202,7 +201,7 @@ public:
   /// @brief Methods to support type inquiry through isa, cast, and dyn_cast.
   static inline bool classof(const ConstantInt *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == ConstantIntVal;
+    return V->getValueID() == ConstantIntVal;
   }
   static void ResetTrueFalse() { TheTrueVal = TheFalseVal = 0; }
 private:
@@ -240,7 +239,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ConstantFP *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == ConstantFPVal;
+    return V->getValueID() == ConstantFPVal;
   }
 };
 
@@ -268,7 +267,7 @@ public:
   ///
   static bool classof(const ConstantAggregateZero *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == ConstantAggregateZeroVal;
+    return V->getValueID() == ConstantAggregateZeroVal;
   }
 };
 
@@ -332,7 +331,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ConstantArray *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == ConstantArrayVal;
+    return V->getValueID() == ConstantArrayVal;
   }
 };
 
@@ -377,7 +376,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ConstantStruct *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == ConstantStructVal;
+    return V->getValueID() == ConstantStructVal;
   }
 };
 
@@ -400,14 +399,14 @@ public:
     return get(std::vector<Constant*>(Vals, Vals+NumVals));
   }
   
-  /// getType - Specialize the getType() method to always return an VectorType,
+  /// getType - Specialize the getType() method to always return a VectorType,
   /// which reduces the amount of casting needed in parts of the compiler.
   ///
   inline const VectorType *getType() const {
     return reinterpret_cast<const VectorType*>(Value::getType());
   }
 
-  /// @returns the value for an packed integer constant of the given type that
+  /// @returns the value for a vector integer constant of the given type that
   /// has all its bits set to true.
   /// @brief Get the all ones value
   static ConstantVector *getAllOnesValue(const VectorType *Ty);
@@ -417,7 +416,7 @@ public:
   /// created as ConstantAggregateZero objects.
   virtual bool isNullValue() const { return false; }
 
-  /// This function will return true iff every element in this packed constant
+  /// This function will return true iff every element in this vector constant
   /// is set to all ones.
   /// @returns true iff this constant's emements are all set to all ones.
   /// @brief Determine if the value is all ones.
@@ -429,7 +428,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ConstantVector *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == ConstantVectorVal;
+    return V->getValueID() == ConstantVectorVal;
   }
 };
 
@@ -465,7 +464,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ConstantPointerNull *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == ConstantPointerNullVal;
+    return V->getValueID() == ConstantPointerNullVal;
   }
 };
 
@@ -632,7 +631,7 @@ public:
   static Constant *getShuffleVector(Constant *V1, Constant *V2, Constant *Mask);
 
   /// Floating point negation must be implemented with f(x) = -0.0 - x. This
-  /// method returns the negative zero constant for floating point or packed
+  /// method returns the negative zero constant for floating point or vector
   /// floating point types; for all other types, it returns the null value.
   static Constant *getZeroValueForNegationExpr(const Type *Ty);
 
@@ -674,7 +673,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const ConstantExpr *) { return true; }
   static inline bool classof(const Value *V) {
-    return V->getValueType() == ConstantExprVal;
+    return V->getValueID() == ConstantExprVal;
   }
 };
 
@@ -705,7 +704,7 @@ public:
   /// Methods for support type inquiry through isa, cast, and dyn_cast:
   static inline bool classof(const UndefValue *) { return true; }
   static bool classof(const Value *V) {
-    return V->getValueType() == UndefValueVal;
+    return V->getValueID() == UndefValueVal;
   }
 };