mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 05:09:07 +02:00
* Added the thlcgobj.a_load_undefined_cgpara() method to pass an undefined value as a parameter to a routine. The generic version passes the 0/nil value if the parameter's location is not a register.
* Use a_load_undefined_cgpara() to load values for unused parameters. git-svn-id: trunk@45439 -
This commit is contained in:
parent
30e61067a0
commit
9d1c814387
@ -197,6 +197,11 @@ unit hlcgobj;
|
|||||||
@param(r reference to get address from)
|
@param(r reference to get address from)
|
||||||
}
|
}
|
||||||
procedure a_loadaddr_ref_cgpara(list : TAsmList;fromsize : tdef;const r : treference;const cgpara : TCGPara);virtual;
|
procedure a_loadaddr_ref_cgpara(list : TAsmList;fromsize : tdef;const r : treference;const cgpara : TCGPara);virtual;
|
||||||
|
{# Pass an undefined value as a parameter to a routine.
|
||||||
|
A generic version is provided and passes the 0/nil value
|
||||||
|
if the parameter's location is not a register.
|
||||||
|
}
|
||||||
|
procedure a_load_undefined_cgpara(list : TAsmList;size : tdef;const cgpara : TCGPara);virtual;
|
||||||
|
|
||||||
{ Remarks:
|
{ Remarks:
|
||||||
* If a method specifies a size you have only to take care
|
* If a method specifies a size you have only to take care
|
||||||
@ -1125,6 +1130,12 @@ implementation
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
procedure thlcgobj.a_load_undefined_cgpara(list: TAsmList; size: tdef; const cgpara: TCGPara);
|
||||||
|
begin
|
||||||
|
if not (cgpara.Location^.Loc in [LOC_REGISTER,LOC_CREGISTER]) then
|
||||||
|
a_load_const_cgpara(list,size,0,cgpara);
|
||||||
|
end;
|
||||||
|
|
||||||
function thlcgobj.a_call_name_static(list: TAsmList; pd: tprocdef; const s: TSymStr; const paras: array of pcgpara; forceresdef: tdef): tcgpara;
|
function thlcgobj.a_call_name_static(list: TAsmList; pd: tprocdef; const s: TSymStr; const paras: array of pcgpara; forceresdef: tdef): tcgpara;
|
||||||
begin
|
begin
|
||||||
result:=a_call_name(list,pd,s,paras,forceresdef,false);
|
result:=a_call_name(list,pd,s,paras,forceresdef,false);
|
||||||
|
@ -314,8 +314,8 @@ implementation
|
|||||||
tempcgpara.Location^.Loc:=LOC_VOID;
|
tempcgpara.Location^.Loc:=LOC_VOID;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{ Load the dummy nil/0 value }
|
{ Load an undefined dummy value }
|
||||||
hlcg.a_load_const_cgpara(current_asmdata.CurrAsmList,left.resultdef,0,tempcgpara);
|
hlcg.a_load_undefined_cgpara(current_asmdata.CurrAsmList,left.resultdef,tempcgpara);
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user