diff options
author | Vedant Kumar <vsk@apple.com> | 2018-07-06 20:17:42 +0000 |
---|---|---|
committer | Vedant Kumar <vsk@apple.com> | 2018-07-06 20:17:42 +0000 |
commit | b3091da3af7911bc0c6f59d44d215a84c9625213 (patch) | |
tree | bd2eebfa82d3168bbfaf75575a80b604815d31d0 /llvm/lib/IR/ConstantFold.cpp | |
parent | 2bd02db943adcb56e9fa90f316dac6036eae18c8 (diff) | |
download | llvm-b3091da3af7911bc0c6f59d44d215a84c9625213.zip llvm-b3091da3af7911bc0c6f59d44d215a84c9625213.tar.gz llvm-b3091da3af7911bc0c6f59d44d215a84c9625213.tar.bz2 |
Use Type::isIntOrPtrTy where possible, NFC
It's a bit neater to write T.isIntOrPtrTy() over `T.isIntegerTy() ||
T.isPointerTy()`.
I used Python's re.sub with this regex to update users:
r'([\w.\->()]+)isIntegerTy\(\)\s*\|\|\s*\1isPointerTy\(\)'
llvm-svn: 336462
Diffstat (limited to 'llvm/lib/IR/ConstantFold.cpp')
-rw-r--r-- | llvm/lib/IR/ConstantFold.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/llvm/lib/IR/ConstantFold.cpp b/llvm/lib/IR/ConstantFold.cpp index 9da6075..9be9d3a 100644 --- a/llvm/lib/IR/ConstantFold.cpp +++ b/llvm/lib/IR/ConstantFold.cpp @@ -1553,8 +1553,7 @@ static ICmpInst::Predicate evaluateICmpRelation(Constant *V1, Constant *V2, // If the cast is not actually changing bits, and the second operand is a // null pointer, do the comparison with the pre-casted value. - if (V2->isNullValue() && - (CE1->getType()->isPointerTy() || CE1->getType()->isIntegerTy())) { + if (V2->isNullValue() && CE1->getType()->isIntOrPtrTy()) { if (CE1->getOpcode() == Instruction::ZExt) isSigned = false; if (CE1->getOpcode() == Instruction::SExt) isSigned = true; return evaluateICmpRelation(CE1Op0, |