OpNum+1 != Record.size())
return Error("Invalid CMP record");
- if (LHS->getType()->isInteger())
+ if (LHS->getType()->isInteger() || isa<PointerType>(LHS->getType()))
I = new ICmpInst((ICmpInst::Predicate)Record[OpNum], LHS, RHS);
else if (LHS->getType()->isFloatingPoint())
I = new FCmpInst((FCmpInst::Predicate)Record[OpNum], LHS, RHS);
CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate,
Value *LHS, Value *RHS, const std::string &Name,
Instruction *InsertBefore)
- : Instruction(Type::Int1Ty, op,
+ : Instruction(ty, op,
OperandTraits<CmpInst>::op_begin(this),
OperandTraits<CmpInst>::operands(this),
InsertBefore) {
CmpInst::CmpInst(const Type *ty, OtherOps op, unsigned short predicate,
Value *LHS, Value *RHS, const std::string &Name,
BasicBlock *InsertAtEnd)
- : Instruction(Type::Int1Ty, op,
+ : Instruction(ty, op,
OperandTraits<CmpInst>::op_begin(this),
OperandTraits<CmpInst>::operands(this),
InsertAtEnd) {