* keep track of required stack frame alignment (this information is however

not yet actually used for anything)

git-svn-id: trunk@22280 -
This commit is contained in:
Jonas Maebe 2012-09-02 14:32:26 +00:00
parent b1dc518ac4
commit 56378f907f
2 changed files with 15 additions and 0 deletions

View File

@ -56,6 +56,8 @@ unit procinfo;
private
{ list to store the procinfo's of the nested procedures }
nestedprocs : tlinkedlist;
{ required alignment for this stackframe }
fstackalignment : longint;
procedure addnestedproc(child: tprocinfo);
public
{ pointer to parent in nested procedures }
@ -159,6 +161,12 @@ unit procinfo;
{ Add to parent's list of nested procedures even if parent is a 'main' procedure }
procedure force_nested;
{ Get the required alignment for the current stack frame }
property stackalignment: longint read fstackalignment;
{ Update the resuired alignment for the current stack frame based
on the current value and the new required alignment }
procedure updatestackalignment(alignment: longint);
end;
tcprocinfo = class of tprocinfo;
@ -185,6 +193,7 @@ implementation
parent:=aparent;
procdef:=nil;
para_stack_size:=0;
fstackalignment:=target_info.stackalign;
flags:=[];
init_framepointer;
framepointer:=NR_FRAME_POINTER_REG;
@ -234,6 +243,11 @@ implementation
nestedprocs.insert(child);
end;
procedure tprocinfo.updatestackalignment(alignment: longint);
begin
fstackalignment:=max(fstackalignment,alignment);
end;
function tprocinfo.get_first_nestedproc: tprocinfo;
begin
if assigned(nestedprocs) then

View File

@ -252,6 +252,7 @@ implementation
bestslot:=nil;
tl:=nil;
bestatend:=false;
current_procinfo.updatestackalignment(alignment);
if size=0 then
begin