mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-04-22 00:29:33 +02:00
* "push" zero-sized value parameters for LLVM and JVM, because all parameters
are part of the signature on those platforms (fixes e.g. tbs/tb0408.pp for LLVM) git-svn-id: trunk@34128 -
This commit is contained in:
parent
c0ff55e95a
commit
f5e4265b1e
@ -33,6 +33,8 @@ interface
|
||||
type
|
||||
tjvmcallparanode = class(tcgcallparanode)
|
||||
protected
|
||||
function push_zero_sized_value_para: boolean; override;
|
||||
|
||||
procedure push_formal_para; override;
|
||||
procedure push_copyout_para; override;
|
||||
|
||||
@ -72,6 +74,13 @@ implementation
|
||||
TJVMCALLPARANODE
|
||||
*****************************************************************************}
|
||||
|
||||
function tjvmcallparanode.push_zero_sized_value_para: boolean;
|
||||
begin
|
||||
{ part of the signature -> need to be pushed }
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
|
||||
procedure tjvmcallparanode.push_formal_para;
|
||||
begin
|
||||
{ primitive values are boxed, so in all cases this is a pointer to
|
||||
|
@ -31,6 +31,11 @@ interface
|
||||
cgutils;
|
||||
|
||||
type
|
||||
tllvmcallparanode = class(tcgcallparanode)
|
||||
protected
|
||||
function push_zero_sized_value_para: boolean; override;
|
||||
end;
|
||||
|
||||
tllvmcallnode = class(tcgcallnode)
|
||||
protected
|
||||
function can_call_ref(var ref: treference): boolean; override;
|
||||
@ -44,6 +49,20 @@ implementation
|
||||
verbose,
|
||||
ncal;
|
||||
|
||||
{*****************************************************************************
|
||||
TLLVMCALLPARANODE
|
||||
*****************************************************************************}
|
||||
|
||||
function tllvmcallparanode.push_zero_sized_value_para: boolean;
|
||||
begin
|
||||
{ part of the signature -> need to be pushed }
|
||||
result:=true;
|
||||
end;
|
||||
|
||||
|
||||
{*****************************************************************************
|
||||
TLLVMCALLNODE
|
||||
*****************************************************************************}
|
||||
|
||||
function tllvmcallnode.can_call_ref(var ref: treference): boolean;
|
||||
begin
|
||||
|
@ -35,6 +35,8 @@ interface
|
||||
type
|
||||
tcgcallparanode = class(tcallparanode)
|
||||
protected
|
||||
function push_zero_sized_value_para: boolean; virtual;
|
||||
|
||||
procedure push_addr_para;
|
||||
procedure push_value_para;virtual;
|
||||
procedure push_formal_para;virtual;
|
||||
@ -153,6 +155,13 @@ implementation
|
||||
end;
|
||||
|
||||
|
||||
function tcgcallparanode.push_zero_sized_value_para: boolean;
|
||||
begin
|
||||
{ nothing to push by default }
|
||||
result:=false;
|
||||
end;
|
||||
|
||||
|
||||
procedure tcgcallparanode.push_addr_para;
|
||||
begin
|
||||
if not(left.location.loc in [LOC_CREFERENCE,LOC_REFERENCE]) then
|
||||
@ -234,10 +243,10 @@ implementation
|
||||
procedure tcgcallparanode.push_value_para;
|
||||
begin
|
||||
{ we've nothing to push when the size of the parameter is 0
|
||||
-- except in case of the self parameter of an emptry record on e.g.
|
||||
the JVM target }
|
||||
-- except on platforms where the parameters are part of the signature
|
||||
and checked by the runtime/backend compiler (e.g. JVM, LLVM) }
|
||||
if (left.resultdef.size=0) and
|
||||
not(vo_is_self in parasym.varoptions) then
|
||||
not push_zero_sized_value_para then
|
||||
exit;
|
||||
|
||||
{ Move flags and jump in register to make it less complex }
|
||||
|
Loading…
Reference in New Issue
Block a user