[IR] Use Instruction::isBinaryOp helper instead of raw enum range tests. NFCI.
llvm-svn: 335335
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp
index bd65aed..157473f 100644
--- a/llvm/lib/IR/ConstantRange.cpp
+++ b/llvm/lib/IR/ConstantRange.cpp
@@ -191,8 +191,7 @@
return CR0.inverse().unionWith(CR1.inverse()).inverse();
};
- assert(BinOp >= Instruction::BinaryOpsBegin &&
- BinOp < Instruction::BinaryOpsEnd && "Binary operators only!");
+ assert(Instruction::isBinaryOp(BinOp) && "Binary operators only!");
assert((NoWrapKind == OBO::NoSignedWrap ||
NoWrapKind == OBO::NoUnsignedWrap ||
@@ -665,8 +664,7 @@
ConstantRange ConstantRange::binaryOp(Instruction::BinaryOps BinOp,
const ConstantRange &Other) const {
- assert(BinOp >= Instruction::BinaryOpsBegin &&
- BinOp < Instruction::BinaryOpsEnd && "Binary operators only!");
+ assert(Instruction::isBinaryOp(BinOp) && "Binary operators only!");
switch (BinOp) {
case Instruction::Add: