projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
335597f
)
[ConstantRange] Use APInt::getOneBitSet to shorten some code. NFC
author
Craig Topper
<craig.topper@gmail.com>
Sat, 29 Apr 2017 17:59:41 +0000
(17:59 +0000)
committer
Craig Topper
<craig.topper@gmail.com>
Sat, 29 Apr 2017 17:59:41 +0000
(17:59 +0000)
llvm-svn: 301753
llvm/lib/IR/ConstantRange.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/IR/ConstantRange.cpp
b/llvm/lib/IR/ConstantRange.cpp
index 8b595a69ad37a0b21cacae16cc302b8951a4960a..4d7e73eb07faa68dec1c7bda12ce8ff1aa38d7d0 100644
(file)
--- 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);