1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-24 11:42:57 +01:00

[ConstantRange] Add assertion for KnownBits validity; NFC

Following the suggestion in D59475.

llvm-svn: 356346
This commit is contained in:
Nikita Popov 2019-03-17 21:25:32 +00:00
parent d423c075d2
commit 1135cfa6a7

View File

@ -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);