From 58bedde3ac54f82657d5de092e7142ffb2ff735c Mon Sep 17 00:00:00 2001 From: Thomas Lively <7121787+tlively@users.noreply.github.com> Date: Thu, 22 Sep 2022 18:00:50 -0500 Subject: 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. --- src/ir/module-utils.cpp | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/ir/module-utils.cpp') 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()) { counts.note(call->heapType); + } else if (auto* call = curr->dynCast()) { + if (call->isReturn && call->target->type.isFunction()) { + counts.note(call->target->type); + } } else if (curr->is()) { counts.note(curr->type); } else if (auto* make = curr->dynCast()) { -- cgit v1.2.3