mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-17 03:59:13 +02:00
* WriteWasmBasicType and WriteWasmResultType converted to global functions to allow reuse in the exe writer
This commit is contained in:
parent
5583781f47
commit
a387accf81
@ -184,8 +184,6 @@ interface
|
||||
procedure WriteWasmCustomSection(wcst: TWasmCustomSectionType);
|
||||
procedure CopyDynamicArray(src, dest: tdynamicarray; size: QWord);
|
||||
procedure WriteZeros(dest: tdynamicarray; size: QWord);
|
||||
procedure WriteWasmResultType(dest: tdynamicarray; wrt: TWasmResultType);
|
||||
procedure WriteWasmBasicType(dest: tdynamicarray; wbt: TWasmBasicType);
|
||||
function IsExternalFunction(sym: TObjSymbol): Boolean;
|
||||
function IsExportedFunction(sym: TWasmObjSymbol): Boolean;
|
||||
procedure WriteFunctionLocals(dest: tdynamicarray; ed: TWasmObjSymbolExtraData);
|
||||
@ -365,6 +363,20 @@ implementation
|
||||
d.writestr(s);
|
||||
end;
|
||||
|
||||
procedure WriteWasmBasicType(dest: tdynamicarray; wbt: TWasmBasicType);
|
||||
begin
|
||||
WriteByte(dest,encode_wasm_basic_type(wbt));
|
||||
end;
|
||||
|
||||
procedure WriteWasmResultType(dest: tdynamicarray; wrt: TWasmResultType);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
WriteUleb(dest,Length(wrt));
|
||||
for i:=low(wrt) to high(wrt) do
|
||||
WriteWasmBasicType(dest,wrt[i]);
|
||||
end;
|
||||
|
||||
function ReadUleb(d: tdynamicarray): uint64;
|
||||
var
|
||||
b: byte;
|
||||
@ -1048,20 +1060,6 @@ implementation
|
||||
end;
|
||||
end;
|
||||
|
||||
procedure TWasmObjOutput.WriteWasmResultType(dest: tdynamicarray; wrt: TWasmResultType);
|
||||
var
|
||||
i: Integer;
|
||||
begin
|
||||
WriteUleb(dest,Length(wrt));
|
||||
for i:=low(wrt) to high(wrt) do
|
||||
WriteWasmBasicType(dest,wrt[i]);
|
||||
end;
|
||||
|
||||
procedure TWasmObjOutput.WriteWasmBasicType(dest: tdynamicarray; wbt: TWasmBasicType);
|
||||
begin
|
||||
WriteByte(dest,encode_wasm_basic_type(wbt));
|
||||
end;
|
||||
|
||||
function TWasmObjOutput.IsExternalFunction(sym: TObjSymbol): Boolean;
|
||||
var
|
||||
ExtraData: TWasmObjSymbolExtraData;
|
||||
|
Loading…
Reference in New Issue
Block a user