From a1ed717d81c39881ae1618842b44cb2dd6dbb48b Mon Sep 17 00:00:00 2001 From: Nikolay Nikolov Date: Sun, 4 Jun 2023 05:44:32 +0300 Subject: [PATCH] + added wasm32-specific flag tai_label.is_pascal_goto_target --- compiler/aasmtai.pas | 3 +++ compiler/wasm32/cgcpu.pas | 11 +++++++++++ 2 files changed, 14 insertions(+) diff --git a/compiler/aasmtai.pas b/compiler/aasmtai.pas index 682e825f39..271119154d 100644 --- a/compiler/aasmtai.pas +++ b/compiler/aasmtai.pas @@ -656,6 +656,9 @@ interface pc relative offsets are allowed } inserted : boolean; {$endif arm} +{$ifdef wasm32} + is_pascal_goto_target: boolean; +{$endif wasm32} constructor Create(_labsym : tasmlabel); constructor ppuload(t:taitype;ppufile:tcompilerppufile);override; procedure ppuwrite(ppufile:tcompilerppufile);override; diff --git a/compiler/wasm32/cgcpu.pas b/compiler/wasm32/cgcpu.pas index 8aca061b58..1211bca64c 100644 --- a/compiler/wasm32/cgcpu.pas +++ b/compiler/wasm32/cgcpu.pas @@ -42,6 +42,7 @@ interface function getfpuregister(list:TAsmList;size:Tcgsize):Tregister;override; function getaddressregister(list:TAsmList):Tregister;override; procedure do_register_allocation(list:TAsmList;headertai:tai);override; + procedure a_label_pascal_goto_target(list : TAsmList;l : tasmlabel);override; end; procedure create_codegen; @@ -121,6 +122,16 @@ implementation end; + procedure tcgwasm.a_label_pascal_goto_target(list : TAsmList;l : tasmlabel); + var + lbl: tai_label; + begin + lbl:=tai_label.create(l); + lbl.is_pascal_goto_target:=true; + list.concat(lbl); + end; + + procedure create_codegen; begin cg:=tcgwasm.Create;