+ insert tai_locals as a continuous block, next to each other

git-svn-id: branches/wasm@46713 -
This commit is contained in:
nickysn 2020-08-26 23:19:11 +00:00
parent 893e08489d
commit b3a4f160bc

View File

@ -28,7 +28,7 @@ interface
uses uses
cutils, cutils,
procinfo,cpuinfo, symtype, procinfo,cpuinfo, symtype,
psub; psub, cclasses;
type type
@ -44,10 +44,30 @@ interface
implementation implementation
uses uses
systems,globals, tgcpu, aasmdata, aasmcpu, systems,globals, tgcpu,aasmdata,aasmcpu,aasmtai,
tgobj,paramgr,symconst; tgobj,paramgr,symconst;
procedure tcpuprocinfo.postprocess_code; procedure tcpuprocinfo.postprocess_code;
function findfirst_tai_local(asmlist: TAsmList): tai_local;
var
hp: tai;
begin
result:=nil;
if not assigned(asmlist) then
exit;
hp:=tai(asmlist.first);
while assigned(hp) do
begin
if hp.typ=ait_local then
begin
result:=tai_local(hp);
exit;
end;
hp:=tai(hp.Next);
end;
end;
var var
templist : TAsmList; templist : TAsmList;
l : TWasmLocal; l : TWasmLocal;
@ -58,7 +78,7 @@ implementation
templist.Concat( tai_local.create(l.typ)); templist.Concat( tai_local.create(l.typ));
l := l.nextseq; l := l.nextseq;
end; end;
aktproccode.insertListBefore(nil, templist); aktproccode.insertListBefore(findfirst_tai_local(aktproccode),templist);
templist.Free; templist.Free;
inherited postprocess_code; inherited postprocess_code;