mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-22 12:29:23 +02:00
LLVM: only add sret attribute for first parameter on caller side
We already did this when generating the definitions, but not yet when generating the calls
This commit is contained in:
parent
b49d58a9fa
commit
2949d0b548
@ -163,7 +163,12 @@ unit llvmpara;
|
|||||||
paralocs }
|
paralocs }
|
||||||
while assigned(paraloc) do
|
while assigned(paraloc) do
|
||||||
begin
|
begin
|
||||||
if (vo_is_funcret in parasym.varoptions)
|
if (vo_is_funcret in parasym.varoptions) and
|
||||||
|
{ sret attribute is only valid for the first parameter; sometimes
|
||||||
|
FPC will place other parameters first (e.g. self), and then
|
||||||
|
we can't use it; we use other attributes in that case to
|
||||||
|
approximate the optimisations that LLVM can do for sret }
|
||||||
|
(tabstractprocdef(parasym.owner.defowner).paras[0] = parasym)
|
||||||
{$ifdef aarch64}
|
{$ifdef aarch64}
|
||||||
{ see AArch64's tcpuparamanager.create_paraloc_info_intern() }
|
{ see AArch64's tcpuparamanager.create_paraloc_info_intern() }
|
||||||
and not is_managed_type(parasym.vardef)
|
and not is_managed_type(parasym.vardef)
|
||||||
|
Loading…
Reference in New Issue
Block a user