mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-14 08:51:10 +02:00
* group tai_local directives, so that they are output as a single directive with comma separated types
git-svn-id: branches/wasm@46714 -
This commit is contained in:
parent
b3a4f160bc
commit
35e83d5524
@ -1587,14 +1587,13 @@ implementation
|
|||||||
{$ifdef WASM}
|
{$ifdef WASM}
|
||||||
ait_local:
|
ait_local:
|
||||||
begin
|
begin
|
||||||
writer.AsmWrite(#9'.local'#9);
|
if tai_local(hp).first then
|
||||||
|
writer.AsmWrite(#9'.local'#9)
|
||||||
|
else
|
||||||
|
writer.AsmWrite(', ');
|
||||||
writer.AsmWrite(gas_wasm_basic_type_str[tai_local(hp).bastyp]);
|
writer.AsmWrite(gas_wasm_basic_type_str[tai_local(hp).bastyp]);
|
||||||
if tai_local(hp).name<>'' then
|
if tai_local(hp).last then
|
||||||
begin
|
writer.AsmLn;
|
||||||
writer.AsmWrite(#9+asminfo^.comment);
|
|
||||||
writer.AsmWrite(tai_local(hp).name);
|
|
||||||
end;
|
|
||||||
writer.AsmLn;
|
|
||||||
end;
|
end;
|
||||||
ait_functype:
|
ait_functype:
|
||||||
WriteFuncType(tai_functype(hp));
|
WriteFuncType(tai_functype(hp));
|
||||||
|
@ -105,6 +105,8 @@ uses
|
|||||||
tai_local = class(tai)
|
tai_local = class(tai)
|
||||||
bastyp: TWasmBasicType;
|
bastyp: TWasmBasicType;
|
||||||
name : string;
|
name : string;
|
||||||
|
first: boolean;
|
||||||
|
last: boolean;
|
||||||
constructor create(abasictype: TWasmBasicType; const aname: string = '');
|
constructor create(abasictype: TWasmBasicType; const aname: string = '');
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
@ -71,6 +71,7 @@ implementation
|
|||||||
var
|
var
|
||||||
templist : TAsmList;
|
templist : TAsmList;
|
||||||
l : TWasmLocal;
|
l : TWasmLocal;
|
||||||
|
first_tai_local, last_tai_local: tai_local;
|
||||||
begin
|
begin
|
||||||
templist := TAsmList.create;
|
templist := TAsmList.create;
|
||||||
l := ttgwasm(tg).localvars.first;
|
l := ttgwasm(tg).localvars.first;
|
||||||
@ -81,6 +82,17 @@ implementation
|
|||||||
aktproccode.insertListBefore(findfirst_tai_local(aktproccode),templist);
|
aktproccode.insertListBefore(findfirst_tai_local(aktproccode),templist);
|
||||||
templist.Free;
|
templist.Free;
|
||||||
|
|
||||||
|
first_tai_local:=findfirst_tai_local(aktproccode);
|
||||||
|
if assigned(first_tai_local) then
|
||||||
|
begin
|
||||||
|
first_tai_local.first:=true;
|
||||||
|
{ also find the last tai_local in the group }
|
||||||
|
last_tai_local:=first_tai_local;
|
||||||
|
while assigned(last_tai_local.Next) and (tai(last_tai_local.Next).typ=ait_local) do
|
||||||
|
last_tai_local:=tai_local(last_tai_local.Next);
|
||||||
|
last_tai_local.last:=true;
|
||||||
|
end;
|
||||||
|
|
||||||
inherited postprocess_code;
|
inherited postprocess_code;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user