Skip to content

Commit 22982a4

Browse files
committed
address pr feedback
1 parent cb40adc commit 22982a4

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

clang/lib/CodeGen/CGExprScalar.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3964,10 +3964,13 @@ Value *ScalarExprEmitter::EmitRem(const BinOpInfo &Ops) {
39643964

39653965
if (Ops.Ty->hasUnsignedIntegerRepresentation())
39663966
return Builder.CreateURem(Ops.LHS, Ops.RHS, "rem");
3967-
else if (CGF.getLangOpts().HLSL && Ops.Ty->hasFloatingRepresentation())
3967+
3968+
if (CGF.getLangOpts().HLSL && Ops.Ty->hasFloatingRepresentation())
39683969
return Builder.CreateFRem(Ops.LHS, Ops.RHS, "rem");
3969-
else
3970-
return Builder.CreateSRem(Ops.LHS, Ops.RHS, "rem");
3970+
3971+
assert(Ops.Ty->hasSignedIntegerRepresentation() &&
3972+
"Srem expected a signed integer representation.");
3973+
return Builder.CreateSRem(Ops.LHS, Ops.RHS, "rem");
39713974
}
39723975

39733976
Value *ScalarExprEmitter::EmitOverflowCheckedBinOp(const BinOpInfo &Ops) {

0 commit comments

Comments
 (0)