summaryrefslogtreecommitdiff
path: root/src/ir/module-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/module-utils.h')
-rw-r--r--src/ir/module-utils.h9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/ir/module-utils.h b/src/ir/module-utils.h
index de37e0875..64f04da31 100644
--- a/src/ir/module-utils.h
+++ b/src/ir/module-utils.h
@@ -425,10 +425,12 @@ inline void collectHeapTypes(Module& wasm,
TypeCounter(Counts& counts) : counts(counts) {}
void visitExpression(Expression* curr) {
- if (curr->is<RefNull>()) {
- counts.maybeNote(curr->type);
- } else if (auto* call = curr->dynCast<CallIndirect>()) {
+ if (auto* call = curr->dynCast<CallIndirect>()) {
counts.note(call->sig);
+ } else if (curr->is<RefNull>()) {
+ counts.maybeNote(curr->type);
+ } else if (auto* get = curr->dynCast<StructGet>()) {
+ counts.maybeNote(get->value->type);
} else if (Properties::isControlFlowStructure(curr)) {
counts.maybeNote(curr->type);
if (curr->type.isTuple()) {
@@ -436,7 +438,6 @@ inline void collectHeapTypes(Module& wasm,
counts.note(Signature(Type::none, curr->type));
}
}
- // TODO struct.get and others contain a type index
}
};
TypeCounter(counts).walk(func->body);