+ introduced the is_wasm_reference_type(tdef) helper

This commit is contained in:
Nikolay Nikolov 2023-06-05 05:00:31 +03:00
parent 5cc4096f41
commit 1f76366125

View File

@ -211,6 +211,9 @@ const
{# Returns true if p is a WebAssembly externref reference type }
function is_wasm_externref(p : tdef): boolean;
{# Returns true if p is a WebAssembly reference type (funcref or externref) }
function is_wasm_reference_type(p : tdef): boolean;
implementation
uses
@ -233,6 +236,11 @@ implementation
result:=(p.typ=pointerdef) and (tcpupointerdef(p).is_wasm_externref);
end;
function is_wasm_reference_type(p: tdef): boolean;
begin
result:=is_wasm_funcref(p) or is_wasm_externref(p);
end;
{****************************************************************************
tcpuproptertysym