|
@@ -35,8 +35,7 @@ interface
|
|
|
|
|
|
type
|
|
|
tcgcallparanode = class(tcallparanode)
|
|
|
- procedure secondcallparan(defcoll : TParaItem;
|
|
|
- push_from_left_to_right:boolean;calloption:tproccalloption;
|
|
|
+ procedure secondcallparan(push_from_left_to_right:boolean;calloption:tproccalloption;
|
|
|
para_alignment,para_offset : longint);override;
|
|
|
end;
|
|
|
|
|
@@ -82,20 +81,19 @@ implementation
|
|
|
TCGCALLPARANODE
|
|
|
*****************************************************************************}
|
|
|
|
|
|
- procedure tcgcallparanode.secondcallparan(defcoll : TParaItem;
|
|
|
- push_from_left_to_right:boolean;calloption:tproccalloption;para_alignment,para_offset : longint);
|
|
|
+ procedure tcgcallparanode.secondcallparan(push_from_left_to_right:boolean;calloption:tproccalloption;para_alignment,para_offset : longint);
|
|
|
|
|
|
{ goes to pass 1 }
|
|
|
procedure maybe_push_high;
|
|
|
begin
|
|
|
{ open array ? }
|
|
|
{ defcoll.data can be nil for read/write }
|
|
|
- if assigned(defcoll.paratype.def) and
|
|
|
+ if assigned(paraitem.paratype.def) and
|
|
|
assigned(hightree) then
|
|
|
begin
|
|
|
secondpass(hightree);
|
|
|
{ this is a longint anyway ! }
|
|
|
- push_value_para(hightree,calloption,para_offset,4,defcoll.paraloc);
|
|
|
+ push_value_para(hightree,calloption,para_offset,4,paraitem.paraloc);
|
|
|
end;
|
|
|
end;
|
|
|
|
|
@@ -112,10 +110,10 @@ implementation
|
|
|
if push_from_left_to_right and assigned(right) then
|
|
|
begin
|
|
|
if (nf_varargs_para in flags) then
|
|
|
- tcallparanode(right).secondcallparan(defcoll,push_from_left_to_right,
|
|
|
+ tcallparanode(right).secondcallparan(push_from_left_to_right,
|
|
|
calloption,para_alignment,para_offset)
|
|
|
else
|
|
|
- tcallparanode(right).secondcallparan(TParaItem(defcoll.next),push_from_left_to_right,
|
|
|
+ tcallparanode(right).secondcallparan(push_from_left_to_right,
|
|
|
calloption,para_alignment,para_offset);
|
|
|
end;
|
|
|
|
|
@@ -130,23 +128,23 @@ implementation
|
|
|
if paramanager.push_addr_param(left.resulttype.def,calloption) then
|
|
|
begin
|
|
|
inc(pushedparasize,4);
|
|
|
- cg.a_paramaddr_ref(exprasmlist,left.location.reference,defcoll.paraloc);
|
|
|
+ cg.a_paramaddr_ref(exprasmlist,left.location.reference,paraitem.paraloc);
|
|
|
location_release(exprasmlist,left.location);
|
|
|
end
|
|
|
else
|
|
|
- push_value_para(left,calloption,para_offset,para_alignment,defcoll.paraloc);
|
|
|
+ push_value_para(left,calloption,para_offset,para_alignment,paraitem.paraloc);
|
|
|
end
|
|
|
{ filter array constructor with c styled args }
|
|
|
else if is_array_constructor(left.resulttype.def) and (nf_cargs in left.flags) then
|
|
|
begin
|
|
|
{ nothing, everything is already pushed }
|
|
|
end
|
|
|
- { in codegen.handleread.. defcoll.data is set to nil }
|
|
|
- else if assigned(defcoll.paratype.def) and
|
|
|
- (defcoll.paratype.def.deftype=formaldef) then
|
|
|
+ { in codegen.handleread.. paraitem.data is set to nil }
|
|
|
+ else if assigned(paraitem.paratype.def) and
|
|
|
+ (paraitem.paratype.def.deftype=formaldef) then
|
|
|
begin
|
|
|
{ allow passing of a constant to a const formaldef }
|
|
|
- if (defcoll.paratyp=vs_const) and
|
|
|
+ if (paraitem.paratyp=vs_const) and
|
|
|
(left.location.loc=LOC_CONSTANT) then
|
|
|
location_force_mem(exprasmlist,left.location);
|
|
|
|
|
@@ -161,7 +159,7 @@ implementation
|
|
|
cg.a_load_loc_ref(exprasmlist,left.location,href);
|
|
|
end
|
|
|
else
|
|
|
- cg.a_param_loc(exprasmlist,left.location,defcoll.paraloc);
|
|
|
+ cg.a_param_loc(exprasmlist,left.location,paraitem.paraloc);
|
|
|
location_release(exprasmlist,left.location);
|
|
|
end
|
|
|
else
|
|
@@ -181,13 +179,13 @@ implementation
|
|
|
cg.free_scratch_reg(exprasmlist,tmpreg);
|
|
|
end
|
|
|
else
|
|
|
- cg.a_paramaddr_ref(exprasmlist,left.location.reference,defcoll.paraloc);
|
|
|
+ cg.a_paramaddr_ref(exprasmlist,left.location.reference,paraitem.paraloc);
|
|
|
location_release(exprasmlist,left.location);
|
|
|
end;
|
|
|
end;
|
|
|
end
|
|
|
{ handle call by reference parameter }
|
|
|
- else if (defcoll.paratyp in [vs_var,vs_out]) then
|
|
|
+ else if (paraitem.paratyp in [vs_var,vs_out]) then
|
|
|
begin
|
|
|
if (left.location.loc<>LOC_REFERENCE) then
|
|
|
begin
|
|
@@ -201,11 +199,11 @@ implementation
|
|
|
if not push_from_left_to_right then
|
|
|
{$endif unused}
|
|
|
maybe_push_high;
|
|
|
- if (defcoll.paratyp=vs_out) and
|
|
|
- assigned(defcoll.paratype.def) and
|
|
|
- not is_class(defcoll.paratype.def) and
|
|
|
- defcoll.paratype.def.needs_inittable then
|
|
|
- cg.g_finalize(exprasmlist,defcoll.paratype.def,left.location.reference,false);
|
|
|
+ if (paraitem.paratyp=vs_out) and
|
|
|
+ assigned(paraitem.paratype.def) and
|
|
|
+ not is_class(paraitem.paratype.def) and
|
|
|
+ paraitem.paratype.def.needs_inittable then
|
|
|
+ cg.g_finalize(exprasmlist,paraitem.paratype.def,left.location.reference,false);
|
|
|
inc(pushedparasize,4);
|
|
|
if calloption=pocall_inline then
|
|
|
begin
|
|
@@ -216,7 +214,7 @@ implementation
|
|
|
cg.free_scratch_reg(exprasmlist,tmpreg);
|
|
|
end
|
|
|
else
|
|
|
- cg.a_paramaddr_ref(exprasmlist,left.location.reference,defcoll.paraloc);
|
|
|
+ cg.a_paramaddr_ref(exprasmlist,left.location.reference,paraitem.paraloc);
|
|
|
location_release(exprasmlist,left.location);
|
|
|
{$ifdef unused}
|
|
|
if push_from_left_to_right then
|
|
@@ -231,9 +229,9 @@ implementation
|
|
|
{ open array must always push the address, this is needed to
|
|
|
also push addr of small open arrays and with cdecl functions (PFV) }
|
|
|
if (
|
|
|
- assigned(defcoll.paratype.def) and
|
|
|
- (is_open_array(defcoll.paratype.def) or
|
|
|
- is_array_of_const(defcoll.paratype.def))
|
|
|
+ assigned(paraitem.paratype.def) and
|
|
|
+ (is_open_array(paraitem.paratype.def) or
|
|
|
+ is_array_of_const(paraitem.paratype.def))
|
|
|
) or
|
|
|
(
|
|
|
paramanager.push_addr_param(resulttype.def,calloption)
|
|
@@ -274,7 +272,7 @@ implementation
|
|
|
cg.free_scratch_reg(exprasmlist,tmpreg);
|
|
|
end
|
|
|
else
|
|
|
- cg.a_paramaddr_ref(exprasmlist,left.location.reference,defcoll.paraloc);
|
|
|
+ cg.a_paramaddr_ref(exprasmlist,left.location.reference,paraitem.paraloc);
|
|
|
location_release(exprasmlist,left.location);
|
|
|
{$ifdef unused}
|
|
|
if push_from_left_to_right then
|
|
@@ -284,7 +282,7 @@ implementation
|
|
|
else
|
|
|
begin
|
|
|
push_value_para(left,calloption,
|
|
|
- para_offset,para_alignment,defcoll.paraloc);
|
|
|
+ para_offset,para_alignment,paraitem.paraloc);
|
|
|
end;
|
|
|
end;
|
|
|
truelabel:=otlabel;
|
|
@@ -293,10 +291,10 @@ implementation
|
|
|
if not push_from_left_to_right and assigned(right) then
|
|
|
begin
|
|
|
if (nf_varargs_para in flags) then
|
|
|
- tcallparanode(right).secondcallparan(defcoll,push_from_left_to_right,
|
|
|
+ tcallparanode(right).secondcallparan(push_from_left_to_right,
|
|
|
calloption,para_alignment,para_offset)
|
|
|
else
|
|
|
- tcallparanode(right).secondcallparan(TParaItem(defcoll.next),push_from_left_to_right,
|
|
|
+ tcallparanode(right).secondcallparan(push_from_left_to_right,
|
|
|
calloption,para_alignment,para_offset);
|
|
|
end;
|
|
|
end;
|
|
@@ -664,11 +662,13 @@ implementation
|
|
|
para_offset:=0;
|
|
|
if not(inlined) and
|
|
|
assigned(right) then
|
|
|
- tcallparanode(params).secondcallparan(TParaItem(tabstractprocdef(right.resulttype.def).Para.first),
|
|
|
+ tcallparanode(params).secondcallparan(
|
|
|
+ { TParaItem(tabstractprocdef(right.resulttype.def).Para.first), }
|
|
|
(po_leftright in procdefinition.procoptions),procdefinition.proccalloption,
|
|
|
para_alignment,para_offset)
|
|
|
else
|
|
|
- tcallparanode(params).secondcallparan(TParaItem(procdefinition.Para.first),
|
|
|
+ tcallparanode(params).secondcallparan(
|
|
|
+ { TParaItem(procdefinition.Para.first), }
|
|
|
(po_leftright in procdefinition.procoptions),procdefinition.proccalloption,
|
|
|
para_alignment,para_offset);
|
|
|
end;
|
|
@@ -1549,7 +1549,10 @@ begin
|
|
|
end.
|
|
|
{
|
|
|
$Log$
|
|
|
- Revision 1.30 2002-11-27 20:04:39 peter
|
|
|
+ Revision 1.31 2002-12-15 21:30:12 florian
|
|
|
+ * tcallnode.paraitem introduced, all references to defcoll removed
|
|
|
+
|
|
|
+ Revision 1.30 2002/11/27 20:04:39 peter
|
|
|
* cdecl array of const fixes
|
|
|
|
|
|
Revision 1.29 2002/11/25 17:43:17 peter
|