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:
322e2db
)
[ConstantRange] Add assertion for KnownBits validity; NFC
author
Nikita Popov
<nikita.ppv@gmail.com>
Sun, 17 Mar 2019 21:25:32 +0000
(21:25 +0000)
committer
Nikita Popov
<nikita.ppv@gmail.com>
Sun, 17 Mar 2019 21:25:32 +0000
(21:25 +0000)
Following the suggestion in D59475.
llvm-svn: 356346
llvm/lib/IR/ConstantRange.cpp
patch
|
blob
|
history
diff --git
a/llvm/lib/IR/ConstantRange.cpp
b/llvm/lib/IR/ConstantRange.cpp
index
d41914b
..
16def8b
100644
(file)
--- a/
llvm/lib/IR/ConstantRange.cpp
+++ b/
llvm/lib/IR/ConstantRange.cpp
@@
-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);