Skip to content

Commit

Permalink
[ConstantRange] Use APInt::getOneBitSet to shorten some code. NFC
Browse files Browse the repository at this point in the history
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@301753 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
topperc committed Apr 29, 2017
1 parent ecc4d60 commit 8f3c59a
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/IR/ConstantRange.cpp
Original file line number Diff line number Diff line change
@@ -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);

0 comments on commit 8f3c59a

Please sign in to comment.