+ write procdef for imports

git-svn-id: branches/wasm@47001 -
This commit is contained in:
nickysn 2020-09-29 00:16:10 +00:00
parent fe4f041436
commit da5c9a978e

View File

@ -63,6 +63,7 @@ implementation
fmodule,finput, fmodule,finput,
itcpugas, itcpugas,
cpubase, cpubase,
hlcgobj,hlcgcpu,
verbose; verbose;
{ TLLVMMachineCodePlaygroundAssembler } { TLLVMMachineCodePlaygroundAssembler }
@ -114,9 +115,10 @@ implementation
procedure TLLVMMachineCodePlaygroundAssembler.WriteImports; procedure TLLVMMachineCodePlaygroundAssembler.WriteImports;
var var
i : integer; i : integer;
proc : tprocdef; proc : tprocdef;
list : TAsmList;
begin begin
for i:=0 to current_module.deflist.Count-1 do for i:=0 to current_module.deflist.Count-1 do
if tdef(current_module.deflist[i]).typ = procdef then if tdef(current_module.deflist[i]).typ = procdef then
@ -124,7 +126,11 @@ implementation
proc := tprocdef(current_module.deflist[i]); proc := tprocdef(current_module.deflist[i]);
if (po_external in proc.procoptions) and assigned(proc.import_dll) then if (po_external in proc.procoptions) and assigned(proc.import_dll) then
begin begin
WriteProcDef(proc); //WriteProcDef(proc);
list:=TAsmList.Create;
thlcgwasm(hlcg).g_procdef(list,proc);
WriteTree(list);
list.free;
writer.AsmWrite(#9'.import_module'#9); writer.AsmWrite(#9'.import_module'#9);
writer.AsmWrite(proc.mangledname); writer.AsmWrite(proc.mangledname);
writer.AsmWrite(', '); writer.AsmWrite(', ');