diff options
author | Craig Topper <craig.topper@gmail.com> | 2017-04-29 17:59:41 +0000 |
---|---|---|
committer | Craig Topper <craig.topper@gmail.com> | 2017-04-29 17:59:41 +0000 |
commit | 8c5c6fe48ea63cc2bb33ccd4af4007690c5a5938 (patch) | |
tree | 03ebd2f69e4df07abae8825fe389c117b476dadd /llvm/lib/IR/ConstantRange.cpp | |
parent | 335597f31b7359b17a9429f049589226db523398 (diff) | |
download | bcm5719-llvm-8c5c6fe48ea63cc2bb33ccd4af4007690c5a5938.tar.gz bcm5719-llvm-8c5c6fe48ea63cc2bb33ccd4af4007690c5a5938.zip |
[ConstantRange] Use APInt::getOneBitSet to shorten some code. NFC
llvm-svn: 301753
Diffstat (limited to 'llvm/lib/IR/ConstantRange.cpp')
-rw-r--r-- | llvm/lib/IR/ConstantRange.cpp | 7 |
1 files changed, 2 insertions, 5 deletions
diff --git a/llvm/lib/IR/ConstantRange.cpp b/llvm/lib/IR/ConstantRange.cpp index 8b595a69ad3..4d7e73eb07f 100644 --- a/llvm/lib/IR/ConstantRange.cpp +++ b/llvm/lib/IR/ConstantRange.cpp @@ -243,11 +243,8 @@ bool ConstantRange::isSignWrappedSet() const { } APInt ConstantRange::getSetSize() const { - if (isFullSet()) { - APInt Size(getBitWidth()+1, 0); - Size.setBit(getBitWidth()); - return Size; - } + if (isFullSet()) + return APInt::getOneBitSet(getBitWidth()+1, getBitWidth()); // This is also correct for wrapped sets. return (Upper - Lower).zext(getBitWidth()+1); |