diff options
author | Thomas Lively <tlively@google.com> | 2022-11-16 14:27:43 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 22:27:43 +0000 |
commit | a8d9bfd4f207d1a234c2ab7d28cd4ee763c535e0 (patch) | |
tree | 4e242ba97db33272b5917c2bcc9a10686ebe0625 /src/wasm-builder.h | |
parent | 570007dbecf86db5ddba8d303896d841fc2b2d27 (diff) | |
download | binaryen-a8d9bfd4f207d1a234c2ab7d28cd4ee763c535e0.tar.gz binaryen-a8d9bfd4f207d1a234c2ab7d28cd4ee763c535e0.tar.bz2 binaryen-a8d9bfd4f207d1a234c2ab7d28cd4ee763c535e0.zip |
Revert "Revert "Make `call_ref` type annotations mandatory (#5246)" (#5265)" (#5266)
This reverts commit 570007dbecf86db5ddba8d303896d841fc2b2d27.
Diffstat (limited to 'src/wasm-builder.h')
-rw-r--r-- | src/wasm-builder.h | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/src/wasm-builder.h b/src/wasm-builder.h index 1eb31157d..a29867e55 100644 --- a/src/wasm-builder.h +++ b/src/wasm-builder.h @@ -1342,35 +1342,6 @@ public: } return makeBrOn(op, name, ref); } - - template<typename T> - Expression* validateAndMakeCallRef(Expression* target, - const T& args, - bool isReturn = false) { - if (target->type != Type::unreachable && !target->type.isRef()) { - throw ParseException("Non-reference type for a call_ref", line, col); - } - // TODO: This won't be necessary once type annotations are mandatory on - // call_ref. - if (target->type == Type::unreachable || - target->type.getHeapType() == HeapType::nofunc) { - // An unreachable target is not supported. Similiar to br_on_cast, just - // emit an unreachable sequence, since we don't have enough information - // to create a full call_ref. - std::vector<Expression*> children; - for (auto* arg : args) { - children.push_back(makeDrop(arg)); - } - children.push_back(makeDrop(target)); - children.push_back(makeUnreachable()); - return makeBlock(children, Type::unreachable); - } - auto heapType = target->type.getHeapType(); - if (!heapType.isSignature()) { - throw ParseException("Invalid reference type for a call_ref", line, col); - } - return makeCallRef(target, args, heapType.getSignature().results, isReturn); - } }; } // namespace wasm |