mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-29 14:40:25 +02:00
* also specify sret attribute at the caller side
git-svn-id: trunk@34302 -
This commit is contained in:
parent
819f0c39fa
commit
7ebbb744e9
@ -184,7 +184,8 @@ interface
|
|||||||
tllvmcallpara = record
|
tllvmcallpara = record
|
||||||
def: tdef;
|
def: tdef;
|
||||||
valueext: tllvmvalueextension;
|
valueext: tllvmvalueextension;
|
||||||
byval: boolean;
|
byval,
|
||||||
|
sret: boolean;
|
||||||
case loc: tcgloc of
|
case loc: tcgloc of
|
||||||
LOC_REFERENCE,
|
LOC_REFERENCE,
|
||||||
LOC_REGISTER,
|
LOC_REGISTER,
|
||||||
|
@ -246,6 +246,8 @@ implementation
|
|||||||
result:=result+llvmvalueextension2str[para^.valueext];
|
result:=result+llvmvalueextension2str[para^.valueext];
|
||||||
if para^.byval then
|
if para^.byval then
|
||||||
result:=result+' byval';
|
result:=result+' byval';
|
||||||
|
if para^.sret then
|
||||||
|
result:=result+' sret';
|
||||||
case para^.loc of
|
case para^.loc of
|
||||||
LOC_REGISTER,
|
LOC_REGISTER,
|
||||||
LOC_FPUREGISTER,
|
LOC_FPUREGISTER,
|
||||||
|
@ -442,7 +442,16 @@ implementation
|
|||||||
callpara^.def:=paraloc^.def;
|
callpara^.def:=paraloc^.def;
|
||||||
{ if the paraloc doesn't contain the value itself, it's a byval
|
{ if the paraloc doesn't contain the value itself, it's a byval
|
||||||
parameter }
|
parameter }
|
||||||
callpara^.byval:=not paraloc^.llvmvalueloc;
|
if paraloc^.retvalloc then
|
||||||
|
begin
|
||||||
|
callpara^.sret:=true;
|
||||||
|
callpara^.byval:=false;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
begin
|
||||||
|
callpara^.sret:=false;
|
||||||
|
callpara^.byval:=not paraloc^.llvmvalueloc;
|
||||||
|
end;
|
||||||
llvmextractvalueextinfo(paras[i]^.def, callpara^.def, callpara^.valueext);
|
llvmextractvalueextinfo(paras[i]^.def, callpara^.def, callpara^.valueext);
|
||||||
if paraloc^.llvmloc.loc=LOC_CONSTANT then
|
if paraloc^.llvmloc.loc=LOC_CONSTANT then
|
||||||
begin
|
begin
|
||||||
|
@ -99,6 +99,8 @@ unit llvmpara;
|
|||||||
paralocs }
|
paralocs }
|
||||||
while assigned(paraloc) do
|
while assigned(paraloc) do
|
||||||
begin
|
begin
|
||||||
|
if vo_is_funcret in parasym.varoptions then
|
||||||
|
paraloc^.retvalloc:=true;
|
||||||
{ varargs parameters do not have a parasym.owner, but they're always
|
{ varargs parameters do not have a parasym.owner, but they're always
|
||||||
by value }
|
by value }
|
||||||
if (assigned(parasym.owner) and
|
if (assigned(parasym.owner) and
|
||||||
|
@ -49,7 +49,8 @@ unit parabase;
|
|||||||
|
|
||||||
{ true if the llvmloc symbol is the value itself, rather than a
|
{ true if the llvmloc symbol is the value itself, rather than a
|
||||||
pointer to the value (~ named register) }
|
pointer to the value (~ named register) }
|
||||||
llvmvalueloc: boolean;
|
llvmvalueloc,
|
||||||
|
retvalloc: boolean;
|
||||||
llvmloc: record
|
llvmloc: record
|
||||||
case loc: TCGLoc of
|
case loc: TCGLoc of
|
||||||
{ nil if none corresponding to this particular paraloc }
|
{ nil if none corresponding to this particular paraloc }
|
||||||
|
Loading…
Reference in New Issue
Block a user