mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-15 13:59:29 +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
|
||||
def: tdef;
|
||||
valueext: tllvmvalueextension;
|
||||
byval: boolean;
|
||||
byval,
|
||||
sret: boolean;
|
||||
case loc: tcgloc of
|
||||
LOC_REFERENCE,
|
||||
LOC_REGISTER,
|
||||
|
@ -246,6 +246,8 @@ implementation
|
||||
result:=result+llvmvalueextension2str[para^.valueext];
|
||||
if para^.byval then
|
||||
result:=result+' byval';
|
||||
if para^.sret then
|
||||
result:=result+' sret';
|
||||
case para^.loc of
|
||||
LOC_REGISTER,
|
||||
LOC_FPUREGISTER,
|
||||
|
@ -442,7 +442,16 @@ implementation
|
||||
callpara^.def:=paraloc^.def;
|
||||
{ if the paraloc doesn't contain the value itself, it's a byval
|
||||
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);
|
||||
if paraloc^.llvmloc.loc=LOC_CONSTANT then
|
||||
begin
|
||||
|
@ -99,6 +99,8 @@ unit llvmpara;
|
||||
paralocs }
|
||||
while assigned(paraloc) do
|
||||
begin
|
||||
if vo_is_funcret in parasym.varoptions then
|
||||
paraloc^.retvalloc:=true;
|
||||
{ varargs parameters do not have a parasym.owner, but they're always
|
||||
by value }
|
||||
if (assigned(parasym.owner) and
|
||||
|
@ -49,7 +49,8 @@ unit parabase;
|
||||
|
||||
{ true if the llvmloc symbol is the value itself, rather than a
|
||||
pointer to the value (~ named register) }
|
||||
llvmvalueloc: boolean;
|
||||
llvmvalueloc,
|
||||
retvalloc: boolean;
|
||||
llvmloc: record
|
||||
case loc: TCGLoc of
|
||||
{ nil if none corresponding to this particular paraloc }
|
||||
|
Loading…
Reference in New Issue
Block a user