diff options
author | Thomas Lively <7121787+tlively@users.noreply.github.com> | 2022-09-22 18:00:50 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-22 16:00:50 -0700 |
commit | 58bedde3ac54f82657d5de092e7142ffb2ff735c (patch) | |
tree | e486638a92aeca615439bbcd11b540f4913b98a1 /src/ir/module-utils.cpp | |
parent | b1ba25732c1a02ae3da726c4b01ca3825ef969ef (diff) | |
download | binaryen-58bedde3ac54f82657d5de092e7142ffb2ff735c.tar.gz binaryen-58bedde3ac54f82657d5de092e7142ffb2ff735c.tar.bz2 binaryen-58bedde3ac54f82657d5de092e7142ffb2ff735c.zip |
Add a type annotation to return_call_ref (#5068)
The GC spec has been updated to have heap type annotations on call_ref and
return_call_ref. To avoid breaking users, we will have a graceful, multi-step
upgrade to the annotated version of call_ref, but since return_call_ref has no
users yet, update it in a single step.
Diffstat (limited to 'src/ir/module-utils.cpp')
-rw-r--r-- | src/ir/module-utils.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/ir/module-utils.cpp b/src/ir/module-utils.cpp index 33f8ac926..84cd66c60 100644 --- a/src/ir/module-utils.cpp +++ b/src/ir/module-utils.cpp @@ -53,6 +53,10 @@ struct CodeScanner void visitExpression(Expression* curr) { if (auto* call = curr->dynCast<CallIndirect>()) { counts.note(call->heapType); + } else if (auto* call = curr->dynCast<CallRef>()) { + if (call->isReturn && call->target->type.isFunction()) { + counts.note(call->target->type); + } } else if (curr->is<RefNull>()) { counts.note(curr->type); } else if (auto* make = curr->dynCast<StructNew>()) { |