Skip to content

Commit

Permalink
[IR] Use Instruction::isBinaryOp to simplify code. NFC
Browse files Browse the repository at this point in the history
  • Loading branch information
topperc committed Jan 5, 2025
1 parent 267ab1c commit 6f69f8c
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions llvm/lib/IR/ConstantsContext.h
Original file line number Diff line number Diff line change
Expand Up @@ -491,8 +491,7 @@ struct ConstantExprKeyType {
default:
if (Instruction::isCast(Opcode))
return new CastConstantExpr(Opcode, Ops[0], Ty);
if ((Opcode >= Instruction::BinaryOpsBegin &&
Opcode < Instruction::BinaryOpsEnd))
if (Instruction::isBinaryOp(Opcode))
return new BinaryConstantExpr(Opcode, Ops[0], Ops[1],
SubclassOptionalData);
llvm_unreachable("Invalid ConstantExpr!");
Expand Down

0 comments on commit 6f69f8c

Please sign in to comment.