public:
static AnnotationID AID; // AnnotationID for this class
- // Unary Operators...
- virtual Constant *op_not(const Constant *V) const = 0;
-
// Binary Operators...
virtual Constant *add(const Constant *V1, const Constant *V2) const = 0;
virtual Constant *sub(const Constant *V1, const Constant *V2) const = 0;
};
-inline Constant *operator~(const Constant &V) {
- return ConstRules::get(V)->op_not(&V);
-}
-
-
// Standard binary operators...
inline Constant *operator+(const Constant &V1, const Constant &V2) {
assert(V1.getType() == V2.getType() && "Constant types must be identical!");
// Shift Instructions...
inline Constant *operator<<(const Constant &V1, const Constant &V2) {
- assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
+ assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
return ConstRules::get(V1)->shl(&V1, &V2);
}
inline Constant *operator>>(const Constant &V1, const Constant &V2) {
- assert(V1.getType()->isIntegral() && V2.getType() == Type::UByteTy);
+ assert(V1.getType()->isInteger() && V2.getType() == Type::UByteTy);
return ConstRules::get(V1)->shr(&V1, &V2);
}
// Constant fold various types of instruction...
Constant *ConstantFoldCastInstruction(const Constant *V, const Type *DestTy);
-Constant *ConstantFoldUnaryInstruction(unsigned Opcode, const Constant *V);
Constant *ConstantFoldBinaryInstruction(unsigned Opcode, const Constant *V1,
const Constant *V2);
Constant *ConstantFoldShiftInstruction(unsigned Opcode, const Constant *V1,