+ static Constant *getTrunc (Constant *C, const Type *Ty);
+ static Constant *getSExt (Constant *C, const Type *Ty);
+ static Constant *getZExt (Constant *C, const Type *Ty);
+ static Constant *getFPTrunc (Constant *C, const Type *Ty);
+ static Constant *getFPExtend(Constant *C, const Type *Ty);
+ static Constant *getUIToFP (Constant *C, const Type *Ty);
+ static Constant *getSIToFP (Constant *C, const Type *Ty);
+ static Constant *getFPToUI (Constant *C, const Type *Ty);
+ static Constant *getFPToSI (Constant *C, const Type *Ty);
+ static Constant *getPtrToInt(Constant *C, const Type *Ty);
+ static Constant *getIntToPtr(Constant *C, const Type *Ty);
+ static Constant *getBitCast (Constant *C, const Type *Ty);
+
+ // @brief Convenience function for getting one of the casting operations
+ // using a CastOps opcode.
+ static Constant *getCast(
+ unsigned ops, ///< The opcode for the conversion
+ Constant *C, ///< The constant to be converted
+ const Type *Ty ///< The type to which the constant is converted
+ );
+
+ // @brief Create a ZExt or BitCast cast constant expression
+ static Constant *getZExtOrBitCast(
+ Constant *C, ///< The constant to zext or bitcast
+ const Type *Ty ///< The type to zext or bitcast C to
+ );
+
+ // @brief Create a SExt or BitCast cast constant expression
+ static Constant *getSExtOrBitCast(
+ Constant *C, ///< The constant to sext or bitcast
+ const Type *Ty ///< The type to sext or bitcast C to
+ );
+
+ // @brief Create a Trunc or BitCast cast constant expression
+ static Constant *getTruncOrBitCast(
+ Constant *C, ///< The constant to trunc or bitcast
+ const Type *Ty ///< The type to trunc or bitcast C to
+ );
+
+ /// @brief Create a BitCast or a PtrToInt cast constant expression
+ static Constant *getPointerCast(
+ Constant *C, ///< The pointer value to be casted (operand 0)
+ const Type *Ty ///< The type to which cast should be made
+ );
+
+ /// @brief Create a ZExt, Bitcast or Trunc for integer -> integer casts
+ static Constant *getIntegerCast(
+ Constant *C, ///< The integer constant to be casted
+ const Type *Ty, ///< The integer type to cast to
+ bool isSigned ///< Whether C should be treated as signed or not
+ );
+
+ /// @brief Create a FPExt, Bitcast or FPTrunc for fp -> fp casts
+ static Constant *getFPCast(
+ Constant *C, ///< The integer constant to be casted
+ const Type *Ty ///< The integer type to cast to
+ );
+
+ /// @brief Return true if this is a convert constant expression
+ bool isCast() const;
+
+ /// @brief Return true if this is a compare constant expression
+ bool isCompare() const;