+ assert(S1 && S2 && S1->getType() == S2->getType());
+
+#ifndef NDEBUG
+ switch (iType) {
+ case Add: case Sub:
+ case Mul: case Div:
+ case Rem:
+ assert(Ty == S1->getType() &&
+ "Arithmetic operation should return same type as operands!");
+ assert((Ty->isInteger() || Ty->isFloatingPoint()) &&
+ "Tried to create an arithmetic operation on a non-arithmetic type!");
+ break;
+ case And: case Or:
+ case Xor:
+ assert(Ty == S1->getType() &&
+ "Logical operation should return same type as operands!");
+ assert(Ty->isIntegral() &&
+ "Tried to create an logical operation on a non-integral type!");
+ break;
+ case SetLT: case SetGT: case SetLE:
+ case SetGE: case SetEQ: case SetNE:
+ assert(Ty == Type::BoolTy && "Setcc must return bool!");
+ default:
+ break;
+ }
+#endif