mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-21 21:51:42 +02:00
+ paramgr.pas: provide generic implementation of getintparaloc(). Once this method has been changed to use the procdef, it can reuse 'regular' parameter locations created by create_paraloc_info, so separate cpu-specific implementations of getintparaloc are no longer necessary.
* parabase.pas: fixed tcgpara.getcopy, it should not modify the source object. git-svn-id: trunk@24716 -
This commit is contained in:
parent
14ded034f6
commit
4714dc2218
@ -168,15 +168,16 @@ implementation
|
||||
|
||||
function tcgpara.getcopy:tcgpara;
|
||||
var
|
||||
hlocation : pcgparalocation;
|
||||
srcloc,hlocation : pcgparalocation;
|
||||
begin
|
||||
result.init;
|
||||
while assigned(location) do
|
||||
srcloc:=location;
|
||||
while assigned(srcloc) do
|
||||
begin
|
||||
hlocation:=result.add_location;
|
||||
hlocation^:=location^;
|
||||
hlocation^:=srcloc^;
|
||||
hlocation^.next:=nil;
|
||||
location:=location^.next;
|
||||
srcloc:=srcloc^.next;
|
||||
end;
|
||||
result.alignment:=alignment;
|
||||
result.size:=size;
|
||||
|
@ -80,7 +80,7 @@ unit paramgr;
|
||||
function get_volatile_registers_flags(calloption : tproccalloption):tcpuregisterset;virtual;
|
||||
function get_volatile_registers_mm(calloption : tproccalloption):tcpuregisterset;virtual;
|
||||
|
||||
procedure getintparaloc(pd: tabstractprocdef; nr : longint; var cgpara: tcgpara);virtual;abstract;
|
||||
procedure getintparaloc(pd: tabstractprocdef; nr : longint; var cgpara: tcgpara);virtual;
|
||||
|
||||
{# allocate an individual pcgparalocation that's part of a tcgpara
|
||||
|
||||
@ -602,6 +602,15 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
procedure tparamanager.getintparaloc(pd: tabstractprocdef; nr : longint; var cgpara: tcgpara);
|
||||
begin
|
||||
if (nr<1) or (nr>pd.paras.count) then
|
||||
InternalError(2013060101);
|
||||
pd.init_paraloc_info(callerside);
|
||||
cgpara:=tparavarsym(pd.paras[nr-1]).paraloc[callerside].getcopy;
|
||||
end;
|
||||
|
||||
|
||||
initialization
|
||||
;
|
||||
finalization
|
||||
|
Loading…
Reference in New Issue
Block a user