aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorReid Spencer <rspencer@reidspencer.com>2006-12-07 04:18:31 +0000
committerReid Spencer <rspencer@reidspencer.com>2006-12-07 04:18:31 +0000
commit6b538cfc5c758edc8e05070ab8794bd6c3e8ffb9 (patch)
tree73cc069842d000f0bbfefa116154100f20a7f3ab /lib
parent7d3223eef2982d7acdfb24facde6605fd9a8b5e8 (diff)
Provide a getOpcode() method on CmpInst to ensure the opcode is returned
as the right type. Use this to shorten some code. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32300 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib')
-rw-r--r--lib/VMCore/Constants.cpp3
-rw-r--r--lib/VMCore/Instructions.cpp3
2 files changed, 2 insertions, 4 deletions
diff --git a/lib/VMCore/Constants.cpp b/lib/VMCore/Constants.cpp
index f9271178a4..5f1aaea909 100644
--- a/lib/VMCore/Constants.cpp
+++ b/lib/VMCore/Constants.cpp
@@ -378,8 +378,7 @@ struct VISIBILITY_HIDDEN CompareConstantExpr : public ConstantExpr {
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/lib/VMCore/Instructions.cpp b/lib/VMCore/Instructions.cpp
index 1cc04334cd..57dd5a56b8 100644
--- a/lib/VMCore/Instructions.cpp
+++ b/lib/VMCore/Instructions.cpp
@@ -2252,8 +2252,7 @@ BinaryOperator *BinaryOperator::clone() const {
}
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); }