diff options
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
| -rw-r--r-- | llvm/lib/IR/Instructions.cpp | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 3b8d8d0c690..7d4b6df18d9 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -3149,15 +3149,18 @@ AddrSpaceCastInst::AddrSpaceCastInst( //===----------------------------------------------------------------------===// CmpInst::CmpInst(Type *ty, OtherOps op, Predicate predicate, Value *LHS, - Value *RHS, const Twine &Name, Instruction *InsertBefore) + Value *RHS, const Twine &Name, Instruction *InsertBefore, + Instruction *FlagsSource) : Instruction(ty, op, OperandTraits<CmpInst>::op_begin(this), OperandTraits<CmpInst>::operands(this), InsertBefore) { - Op<0>() = LHS; - Op<1>() = RHS; + Op<0>() = LHS; + Op<1>() = RHS; setPredicate((Predicate)predicate); setName(Name); + if (FlagsSource) + copyIRFlags(FlagsSource); } CmpInst::CmpInst(Type *ty, OtherOps op, Predicate predicate, Value *LHS, |

