Provide a getOpcode() method on CmpInst to ensure the opcode is returned
as the right type. Use this to shorten some code.
llvm-svn: 32300
diff --git a/llvm/lib/VMCore/Constants.cpp b/llvm/lib/VMCore/Constants.cpp
index f927117..5f1aaea 100644
--- a/llvm/lib/VMCore/Constants.cpp
+++ b/llvm/lib/VMCore/Constants.cpp
@@ -378,8 +378,7 @@
Use Ops[2];
CompareConstantExpr(Instruction::OtherOps opc, unsigned short pred,
Constant* LHS, Constant* RHS)
- : ConstantExpr(Type::BoolTy, Instruction::OtherOps(opc), Ops, 2),
- predicate(pred) {
+ : ConstantExpr(Type::BoolTy, opc, Ops, 2), predicate(pred) {
OperandList[0].init(LHS, this);
OperandList[1].init(RHS, this);
}
diff --git a/llvm/lib/VMCore/Instructions.cpp b/llvm/lib/VMCore/Instructions.cpp
index 1cc0433..57dd5a5 100644
--- a/llvm/lib/VMCore/Instructions.cpp
+++ b/llvm/lib/VMCore/Instructions.cpp
@@ -2252,8 +2252,7 @@
}
CmpInst* CmpInst::clone() const {
- return create(Instruction::OtherOps(getOpcode()), getPredicate(),
- Ops[0], Ops[1]);
+ return create(getOpcode(), getPredicate(), Ops[0], Ops[1]);
}
MallocInst *MallocInst::clone() const { return new MallocInst(*this); }