forked from OSchip/llvm-project
[ConstantRange] Add assertion for KnownBits validity; NFC
Following the suggestion in D59475. llvm-svn: 356346
This commit is contained in:
parent
322e2dbee1
commit
5e7b62de05
|
@ -56,6 +56,8 @@ ConstantRange::ConstantRange(APInt L, APInt U)
|
|||
|
||||
ConstantRange ConstantRange::fromKnownBits(const KnownBits &Known,
|
||||
bool IsSigned) {
|
||||
assert(!Known.hasConflict() && "Expected valid KnownBits");
|
||||
|
||||
if (Known.isUnknown())
|
||||
return ConstantRange(Known.getBitWidth(), /* full */ true);
|
||||
|
||||
|
|
Loading…
Reference in New Issue