diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-06-25 17:33:48 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-06-25 17:33:48 +0000 |
commit | d1fbb38475cf5318e78b47d27f13147e4ce3ae17 (patch) | |
tree | 247ad7db84da780dc916b002d0be954f15bef734 /llvm/lib/IR/Instructions.cpp | |
parent | e3bd1a859823f36dcbedb3b4910c1ae051ddd1ac (diff) | |
download | bcm5719-llvm-d1fbb38475cf5318e78b47d27f13147e4ce3ae17.tar.gz bcm5719-llvm-d1fbb38475cf5318e78b47d27f13147e4ce3ae17.zip |
[IR] Use isIntOrIntVectorTy instead of writing it out the long way. NFC
llvm-svn: 306250
Diffstat (limited to 'llvm/lib/IR/Instructions.cpp')
-rw-r--r-- | llvm/lib/IR/Instructions.cpp | 14 |
1 files changed, 4 insertions, 10 deletions
diff --git a/llvm/lib/IR/Instructions.cpp b/llvm/lib/IR/Instructions.cpp index 023a0b178a1..44b6d6a99ad 100644 --- a/llvm/lib/IR/Instructions.cpp +++ b/llvm/lib/IR/Instructions.cpp @@ -2038,8 +2038,7 @@ void BinaryOperator::init(BinaryOps iType) { case SDiv: assert(getType() == LHS->getType() && "Arithmetic operation should return same type as operands!"); - assert((getType()->isIntegerTy() || (getType()->isVectorTy() && - cast<VectorType>(getType())->getElementType()->isIntegerTy())) && + assert(getType()->isIntOrIntVectorTy() && "Incorrect operand type (not integer) for S/UDIV"); break; case FDiv: @@ -2052,8 +2051,7 @@ void BinaryOperator::init(BinaryOps iType) { case SRem: assert(getType() == LHS->getType() && "Arithmetic operation should return same type as operands!"); - assert((getType()->isIntegerTy() || (getType()->isVectorTy() && - cast<VectorType>(getType())->getElementType()->isIntegerTy())) && + assert(getType()->isIntOrIntVectorTy() && "Incorrect operand type (not integer) for S/UREM"); break; case FRem: @@ -2067,18 +2065,14 @@ void BinaryOperator::init(BinaryOps iType) { case AShr: assert(getType() == LHS->getType() && "Shift operation should return same type as operands!"); - assert((getType()->isIntegerTy() || - (getType()->isVectorTy() && - cast<VectorType>(getType())->getElementType()->isIntegerTy())) && + assert(getType()->isIntOrIntVectorTy() && "Tried to create a shift operation on a non-integral type!"); break; case And: case Or: case Xor: assert(getType() == LHS->getType() && "Logical operation should return same type as operands!"); - assert((getType()->isIntegerTy() || - (getType()->isVectorTy() && - cast<VectorType>(getType())->getElementType()->isIntegerTy())) && + assert(getType()->isIntOrIntVectorTy() && "Tried to create a logical operation on a non-integral type!"); break; default: |