diff --git a/clang/lib/CodeGen/CGExprScalar.cpp b/clang/lib/CodeGen/CGExprScalar.cpp --- a/clang/lib/CodeGen/CGExprScalar.cpp +++ b/clang/lib/CodeGen/CGExprScalar.cpp @@ -65,20 +65,14 @@ const auto &LHSAP = LHS->getValue(); const auto &RHSAP = RHS->getValue(); if (Opcode == BO_Add) { - if (Signed) - Result = LHSAP.sadd_ov(RHSAP, Overflow); - else - Result = LHSAP.uadd_ov(RHSAP, Overflow); + Result = Signed ? LHSAP.sadd_ov(RHSAP, Overflow) + : LHSAP.uadd_ov(RHSAP, Overflow); } else if (Opcode == BO_Sub) { - if (Signed) - Result = LHSAP.ssub_ov(RHSAP, Overflow); - else - Result = LHSAP.usub_ov(RHSAP, Overflow); + Result = Signed ? LHSAP.ssub_ov(RHSAP, Overflow) + : LHSAP.usub_ov(RHSAP, Overflow); } else if (Opcode == BO_Mul) { - if (Signed) - Result = LHSAP.smul_ov(RHSAP, Overflow); - else - Result = LHSAP.umul_ov(RHSAP, Overflow); + Result = Signed ? LHSAP.smul_ov(RHSAP, Overflow) + : LHSAP.umul_ov(RHSAP, Overflow); } else if (Opcode == BO_Div || Opcode == BO_Rem) { if (Signed && !RHS->isZero()) Result = LHSAP.sdiv_ov(RHSAP, Overflow);