[llvm] r356346 - [ConstantRange] Add assertion for KnownBits validity; NFC
Nikita Popov via llvm-commits
llvm-commits at lists.llvm.org
Sun Mar 17 14:25:32 PDT 2019
Author: nikic
Date: Sun Mar 17 14:25:32 2019
New Revision: 356346
URL: http://llvm.org/viewvc/llvm-project?rev=356346&view=rev
Log:
[ConstantRange] Add assertion for KnownBits validity; NFC
Following the suggestion in D59475.
Modified:
llvm/trunk/lib/IR/ConstantRange.cpp
Modified: llvm/trunk/lib/IR/ConstantRange.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/IR/ConstantRange.cpp?rev=356346&r1=356345&r2=356346&view=diff
==============================================================================
--- llvm/trunk/lib/IR/ConstantRange.cpp (original)
+++ llvm/trunk/lib/IR/ConstantRange.cpp Sun Mar 17 14:25:32 2019
@@ -56,6 +56,8 @@ ConstantRange::ConstantRange(APInt L, AP
ConstantRange ConstantRange::fromKnownBits(const KnownBits &Known,
bool IsSigned) {
+ assert(!Known.hasConflict() && "Expected valid KnownBits");
+
if (Known.isUnknown())
return ConstantRange(Known.getBitWidth(), /* full */ true);
More information about the llvm-commits
mailing list