mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-23 08:29:35 +02:00
+ insert tai_locals as a continuous block, next to each other
git-svn-id: branches/wasm@46713 -
This commit is contained in:
parent
893e08489d
commit
b3a4f160bc
@ -28,7 +28,7 @@ interface
|
||||
uses
|
||||
cutils,
|
||||
procinfo,cpuinfo, symtype,
|
||||
psub;
|
||||
psub, cclasses;
|
||||
|
||||
type
|
||||
|
||||
@ -44,10 +44,30 @@ interface
|
||||
implementation
|
||||
|
||||
uses
|
||||
systems,globals, tgcpu, aasmdata, aasmcpu,
|
||||
systems,globals, tgcpu,aasmdata,aasmcpu,aasmtai,
|
||||
tgobj,paramgr,symconst;
|
||||
|
||||
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
|
||||
templist : TAsmList;
|
||||
l : TWasmLocal;
|
||||
@ -58,7 +78,7 @@ implementation
|
||||
templist.Concat( tai_local.create(l.typ));
|
||||
l := l.nextseq;
|
||||
end;
|
||||
aktproccode.insertListBefore(nil, templist);
|
||||
aktproccode.insertListBefore(findfirst_tai_local(aktproccode),templist);
|
||||
templist.Free;
|
||||
|
||||
inherited postprocess_code;
|
||||
|
Loading…
Reference in New Issue
Block a user