summaryrefslogtreecommitdiff
path: root/src/ir/struct-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/struct-utils.h')
-rw-r--r--src/ir/struct-utils.h10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/ir/struct-utils.h b/src/ir/struct-utils.h
index ba5617de6..9d02bb779 100644
--- a/src/ir/struct-utils.h
+++ b/src/ir/struct-utils.h
@@ -191,7 +191,10 @@ struct StructScanner
// (otherwise, we'd need to consider both the type actually written and the
// type of the fallthrough, somehow).
auto* fallthrough = Properties::getFallthrough(
- expr, this->getPassOptions(), *this->getModule());
+ expr,
+ this->getPassOptions(),
+ *this->getModule(),
+ static_cast<SubType*>(this)->getFallthroughBehavior());
if (fallthrough->type == expr->type) {
expr = fallthrough;
}
@@ -205,6 +208,11 @@ struct StructScanner
static_cast<SubType*>(this)->noteExpression(expr, type, index, info);
}
+ Properties::FallthroughBehavior getFallthroughBehavior() {
+ // By default, look at and use tee&br_if fallthrough values.
+ return Properties::FallthroughBehavior::AllowTeeBrIf;
+ }
+
FunctionStructValuesMap<T>& functionNewInfos;
FunctionStructValuesMap<T>& functionSetGetInfos;
};