|
@@ -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)
|