Use assume
It works now that we fell back to the __builtin_unreachable based implementation for gcc.
This commit is contained in:
@@ -374,10 +374,8 @@ inline void Node16::copyChildrenAndKeyFrom(const Node48 &other) {
|
||||
other.bitSet.forEachInRange(
|
||||
[&](int c) {
|
||||
// Suppress a false positive -Waggressive-loop-optimizations warning
|
||||
// in gcc. `assume` doesn't work for some reason.
|
||||
if (!(i < Node16::kMaxNodes)) {
|
||||
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
||||
}
|
||||
// in gcc
|
||||
assume(i < Node16::kMaxNodes);
|
||||
index[i] = c;
|
||||
children[i] = other.children[other.index[c]];
|
||||
assert(children[i].child->parent == &other);
|
||||
@@ -430,10 +428,8 @@ inline void Node48::copyChildrenAndKeyFrom(const Node256 &other) {
|
||||
bitSet.forEachInRange(
|
||||
[&](int c) {
|
||||
// Suppress a false positive -Waggressive-loop-optimizations warning
|
||||
// in gcc. `assume` doesn't work for some reason.
|
||||
if (!(i < Node48::kMaxNodes)) {
|
||||
__builtin_unreachable(); // GCOVR_EXCL_LINE
|
||||
}
|
||||
// in gcc.
|
||||
assume(i < Node48::kMaxNodes);
|
||||
index[c] = i;
|
||||
children[i] = other.children[c];
|
||||
assert(children[i].child->parent == &other);
|
||||
|
Reference in New Issue
Block a user