mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-20 13:29:14 +02:00
* Added trgobj.remove_ai(), call it instead of code duplication.
No functional changes.
This commit is contained in:
parent
b96057adeb
commit
213a0a704a
@ -297,6 +297,8 @@ unit rgobj;
|
|||||||
procedure set_live_end(reg : tsuperregister;t : tai);
|
procedure set_live_end(reg : tsuperregister;t : tai);
|
||||||
function get_live_end(reg : tsuperregister) : tai;
|
function get_live_end(reg : tsuperregister) : tai;
|
||||||
procedure alloc_spillinfo(max_reg: Tsuperregister);
|
procedure alloc_spillinfo(max_reg: Tsuperregister);
|
||||||
|
{ Remove p from the list and set p to the next element in the list }
|
||||||
|
procedure remove_ai(list:TAsmList; var p:Tai);
|
||||||
{$ifdef DEBUG_SPILLCOALESCE}
|
{$ifdef DEBUG_SPILLCOALESCE}
|
||||||
procedure write_spill_stats;
|
procedure write_spill_stats;
|
||||||
{$endif DEBUG_SPILLCOALESCE}
|
{$endif DEBUG_SPILLCOALESCE}
|
||||||
@ -2182,7 +2184,7 @@ unit rgobj;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
var
|
var
|
||||||
hp,p,q:Tai;
|
hp,p:Tai;
|
||||||
i:shortint;
|
i:shortint;
|
||||||
u:longint;
|
u:longint;
|
||||||
s:string;
|
s:string;
|
||||||
@ -2208,10 +2210,7 @@ unit rgobj;
|
|||||||
other regalloc }
|
other regalloc }
|
||||||
if not(ratype in [ra_alloc,ra_dealloc]) then
|
if not(ratype in [ra_alloc,ra_dealloc]) then
|
||||||
begin
|
begin
|
||||||
q:=Tai(next);
|
remove_ai(list,p);
|
||||||
list.remove(p);
|
|
||||||
p.free;
|
|
||||||
p:=q;
|
|
||||||
continue;
|
continue;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -2245,10 +2244,7 @@ unit rgobj;
|
|||||||
if tai_varloc(p).newlocationhi<>NR_NO then
|
if tai_varloc(p).newlocationhi<>NR_NO then
|
||||||
setsupreg(tai_varloc(p).newlocationhi,reginfo[getsupreg(tai_varloc(p).newlocationhi)].colour);
|
setsupreg(tai_varloc(p).newlocationhi,reginfo[getsupreg(tai_varloc(p).newlocationhi)].colour);
|
||||||
end;
|
end;
|
||||||
q:=tai(p.next);
|
remove_ai(list,p);
|
||||||
list.remove(p);
|
|
||||||
p.free;
|
|
||||||
p:=q;
|
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2334,10 +2330,7 @@ unit rgobj;
|
|||||||
it is a move and both arguments are the same }
|
it is a move and both arguments are the same }
|
||||||
if is_same_reg_move(regtype) then
|
if is_same_reg_move(regtype) then
|
||||||
begin
|
begin
|
||||||
q:=Tai(p.next);
|
remove_ai(list,p);
|
||||||
list.remove(p);
|
|
||||||
p.free;
|
|
||||||
p:=q;
|
|
||||||
continue;
|
continue;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -2355,7 +2348,7 @@ unit rgobj;
|
|||||||
var
|
var
|
||||||
i : cardinal;
|
i : cardinal;
|
||||||
t : tsuperregister;
|
t : tsuperregister;
|
||||||
p,q : Tai;
|
p : Tai;
|
||||||
regs_to_spill_set:Tsuperregisterset;
|
regs_to_spill_set:Tsuperregisterset;
|
||||||
spill_temps : ^Tspill_temp_list;
|
spill_temps : ^Tspill_temp_list;
|
||||||
supreg,x,y : tsuperregister;
|
supreg,x,y : tsuperregister;
|
||||||
@ -2483,10 +2476,7 @@ unit rgobj;
|
|||||||
dec(reginfo[supreg].weight,100);
|
dec(reginfo[supreg].weight,100);
|
||||||
end;
|
end;
|
||||||
{ Remove the regalloc }
|
{ Remove the regalloc }
|
||||||
q:=Tai(p.next);
|
remove_ai(list,p);
|
||||||
list.remove(p);
|
|
||||||
p.free;
|
|
||||||
p:=q;
|
|
||||||
continue;
|
continue;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
@ -2918,6 +2908,17 @@ unit rgobj;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure trgobj.remove_ai(list:TAsmList; var p:Tai);
|
||||||
|
var
|
||||||
|
q:Tai;
|
||||||
|
begin
|
||||||
|
q:=tai(p.next);
|
||||||
|
list.remove(p);
|
||||||
|
p.free;
|
||||||
|
p:=q;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
{$ifdef DEBUG_SPILLCOALESCE}
|
{$ifdef DEBUG_SPILLCOALESCE}
|
||||||
procedure trgobj.write_spill_stats;
|
procedure trgobj.write_spill_stats;
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user