mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-12 21:49:09 +02:00
* fix for broken TP-style constructor handling in the compiler
This commit is contained in:
parent
d30ced66a1
commit
563f7ba253
@ -43,10 +43,11 @@ unit cpupara;
|
|||||||
function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
|
function create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;override;
|
||||||
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargspara):longint;override;
|
function create_varargs_paraloc_info(p : tabstractprocdef; varargspara:tvarargspara):longint;override;
|
||||||
private
|
private
|
||||||
procedure init_values(var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword);
|
procedure init_values(var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword);
|
||||||
function create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; firstpara: tparaitem;
|
procedure create_funcret_paraloc_info(p : tabstractprocdef; side: tcallercallee);
|
||||||
var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword):longint;
|
function create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; firstpara: tparaitem;
|
||||||
function parseparaloc(p : tparaitem;const s : string) : boolean;override;
|
var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword):longint;
|
||||||
|
function parseparaloc(p : tparaitem;const s : string) : boolean;override;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
implementation
|
implementation
|
||||||
@ -155,6 +156,7 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tppcparamanager.push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;
|
function tppcparamanager.push_addr_param(varspez:tvarspez;def : tdef;calloption : tproccalloption) : boolean;
|
||||||
begin
|
begin
|
||||||
{ var,out always require address }
|
{ var,out always require address }
|
||||||
@ -199,24 +201,24 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
function tppcparamanager.create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;
|
|
||||||
|
|
||||||
|
procedure tppcparamanager.create_funcret_paraloc_info(p : tabstractprocdef; side: tcallercallee);
|
||||||
var
|
var
|
||||||
paraloc : tparalocation;
|
paraloc : tparalocation;
|
||||||
cur_stack_offset: aword;
|
|
||||||
curintreg, curfloatreg, curmmreg: tsuperregister;
|
|
||||||
begin
|
begin
|
||||||
init_values(curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
|
||||||
|
|
||||||
result := create_paraloc_info_intern(p,side,tparaitem(p.para.first),curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
|
||||||
|
|
||||||
{ Function return }
|
|
||||||
fillchar(paraloc,sizeof(tparalocation),0);
|
fillchar(paraloc,sizeof(tparalocation),0);
|
||||||
paraloc.alignment:= std_param_align;
|
|
||||||
paraloc.size:=def_cgsize(p.rettype.def);
|
paraloc.size:=def_cgsize(p.rettype.def);
|
||||||
paraloc.lochigh:=LOC_INVALID;
|
paraloc.Alignment:= std_param_align;
|
||||||
{ Return in FPU register? }
|
{ Constructors return self }
|
||||||
if p.rettype.def.deftype=floatdef then
|
if (p.proctypeoption=potype_constructor) then
|
||||||
|
begin
|
||||||
|
paraloc.size:=OS_ADDR;
|
||||||
|
paraloc.loc:=LOC_REGISTER;
|
||||||
|
paraloc.register:=NR_FUNCTION_RESULT_REG;
|
||||||
|
end
|
||||||
|
else
|
||||||
|
{ Return in FPU register? }
|
||||||
|
if p.rettype.def.deftype=floatdef then
|
||||||
begin
|
begin
|
||||||
paraloc.loc:=LOC_FPUREGISTER;
|
paraloc.loc:=LOC_FPUREGISTER;
|
||||||
paraloc.register:=NR_FPU_RESULT_REG;
|
paraloc.register:=NR_FPU_RESULT_REG;
|
||||||
@ -229,13 +231,15 @@ unit cpupara;
|
|||||||
{$ifndef cpu64bit}
|
{$ifndef cpu64bit}
|
||||||
if paraloc.size in [OS_64,OS_S64] then
|
if paraloc.size in [OS_64,OS_S64] then
|
||||||
begin
|
begin
|
||||||
paraloc.register64.reglo:=NR_FUNCTION_RETURN64_LOW_REG;
|
|
||||||
paraloc.register64.reghi:=NR_FUNCTION_RETURN64_HIGH_REG;
|
|
||||||
paraloc.lochigh:=LOC_REGISTER;
|
paraloc.lochigh:=LOC_REGISTER;
|
||||||
|
paraloc.register64.reglo:=NR_FUNCTION_RESULT64_LOW_REG;
|
||||||
|
paraloc.register64.reghi:=NR_FUNCTION_RESULT64_HIGH_REG
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
{$endif cpu64bit}
|
{$endif cpu64bit}
|
||||||
paraloc.register:=NR_FUNCTION_RETURN_REG;
|
begin
|
||||||
|
paraloc.register:=NR_FUNCTION_RESULT_REG
|
||||||
|
end;
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
begin
|
begin
|
||||||
@ -245,6 +249,21 @@ unit cpupara;
|
|||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
function tppcparamanager.create_paraloc_info(p : tabstractprocdef; side: tcallercallee):longint;
|
||||||
|
|
||||||
|
var
|
||||||
|
paraloc : tparalocation;
|
||||||
|
cur_stack_offset: aword;
|
||||||
|
curintreg, curfloatreg, curmmreg: tsuperregister;
|
||||||
|
begin
|
||||||
|
init_values(curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
||||||
|
|
||||||
|
result := create_paraloc_info_intern(p,side,tparaitem(p.para.first),curintreg,curfloatreg,curmmreg,cur_stack_offset);
|
||||||
|
|
||||||
|
create_funcret_paraloc_info(p,side);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
function tppcparamanager.create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; firstpara: tparaitem;
|
function tppcparamanager.create_paraloc_info_intern(p : tabstractprocdef; side: tcallercallee; firstpara: tparaitem;
|
||||||
var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword):longint;
|
var curintreg, curfloatreg, curmmreg: tsuperregister; var cur_stack_offset: aword):longint;
|
||||||
@ -514,7 +533,10 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.63 2004-06-20 08:55:32 florian
|
Revision 1.64 2004-07-01 18:00:37 jonas
|
||||||
|
* fix for broken TP-style constructor handling in the compiler
|
||||||
|
|
||||||
|
Revision 1.63 2004/06/20 08:55:32 florian
|
||||||
* logs truncated
|
* logs truncated
|
||||||
|
|
||||||
Revision 1.62 2004/05/01 22:05:02 florian
|
Revision 1.62 2004/05/01 22:05:02 florian
|
||||||
|
Loading…
Reference in New Issue
Block a user