* emit a tai_tagtype for __FPC_exception instead of hardcoding the asm output

directly when wasm native exceptions are enabled
This commit is contained in:
Nikolay Nikolov 2021-09-27 00:33:57 +03:00
parent 10db5ea5dc
commit a1c8e92904
3 changed files with 7 additions and 6 deletions

View File

@ -840,6 +840,8 @@ implementation
writer.AsmWrite(gas_wasm_basic_type_str[wasm_basic_typ]);
end;
writer.AsmLn;
writer.AsmWrite(hp.tagname);
writer.AsmWriteLn(':');
end;
{$endif WASM}

View File

@ -83,11 +83,6 @@ implementation
procedure TLLVMMachineCodePlaygroundAssembler.WriteAsmList;
begin
writer.AsmWriteLn(#9'.globaltype'#9+STACK_POINTER_SYM+', i32');
if ts_wasm_native_exceptions in current_settings.targetswitches then
begin
writer.AsmWriteLn(#9'.tagtype'#9'__FPC_exception');
writer.AsmWriteLn('__FPC_exception:');
end;
inherited;
end;

View File

@ -40,7 +40,7 @@ interface
implementation
uses
globtype,
globtype,globals,
cpubase,
aasmdata,aasmcpu,
hlcgobj,hlcgcpu,
@ -68,6 +68,10 @@ implementation
inherited;
list:=current_asmdata.asmlists[al_start];
if ts_wasm_native_exceptions in current_settings.targetswitches then
list.Concat(tai_tagtype.create('__FPC_exception', []));
for i:=0 to current_module.deflist.Count-1 do
begin
def:=tdef(current_module.deflist[i]);