|
@@ -35,7 +35,8 @@ interface
|
|
function pass_1 : tnode;override;
|
|
function pass_1 : tnode;override;
|
|
end;
|
|
end;
|
|
|
|
|
|
- thnewnode = class(tnode) // fixme
|
|
|
|
|
|
+ thnewnode = class(tnode)
|
|
|
|
+ constructor create;virtual;
|
|
function pass_1 : tnode;override;
|
|
function pass_1 : tnode;override;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -44,10 +45,13 @@ interface
|
|
function pass_1 : tnode;override;
|
|
function pass_1 : tnode;override;
|
|
end;
|
|
end;
|
|
|
|
|
|
- thdisposenode = class(tnode) // fixme
|
|
|
|
|
|
+ thdisposenode = class(tunarynode)
|
|
|
|
+ constructor create(l : tnode);virtual;
|
|
|
|
+ function pass_1 : tnode;override;
|
|
end;
|
|
end;
|
|
|
|
|
|
- tsimplenewdisposenode = class(tnode) // fixme
|
|
|
|
|
|
+ tsimplenewdisposenode = class(tunarynode)
|
|
|
|
+ constructor create(n : tnodetype;l : tnode);
|
|
function pass_1 : tnode;override;
|
|
function pass_1 : tnode;override;
|
|
end;
|
|
end;
|
|
|
|
|
|
@@ -126,7 +130,7 @@ implementation
|
|
globtype,systems,
|
|
globtype,systems,
|
|
cutils,cobjects,verbose,globals,
|
|
cutils,cobjects,verbose,globals,
|
|
symconst,aasm,types,
|
|
symconst,aasm,types,
|
|
- htypechk,pass_1
|
|
|
|
|
|
+ htypechk,pass_1,ncal
|
|
{$ifdef newcg}
|
|
{$ifdef newcg}
|
|
,cgbase
|
|
,cgbase
|
|
{$else newcg}
|
|
{$else newcg}
|
|
@@ -201,6 +205,12 @@ implementation
|
|
THNEWNODE
|
|
THNEWNODE
|
|
*****************************************************************************}
|
|
*****************************************************************************}
|
|
|
|
|
|
|
|
+ constructor thnewnode.create;
|
|
|
|
+
|
|
|
|
+ begin
|
|
|
|
+ inherited create(hnewn);
|
|
|
|
+ end;
|
|
|
|
+
|
|
function thnewnode.pass_1 : tnode;
|
|
function thnewnode.pass_1 : tnode;
|
|
begin
|
|
begin
|
|
pass_1:=nil;
|
|
pass_1:=nil;
|
|
@@ -246,6 +256,12 @@ implementation
|
|
THDISPOSENODE
|
|
THDISPOSENODE
|
|
*****************************************************************************}
|
|
*****************************************************************************}
|
|
|
|
|
|
|
|
+ constructor thdisposenode.create(l : tnode);
|
|
|
|
+
|
|
|
|
+ begin
|
|
|
|
+ inherited create(hdisposen,l);
|
|
|
|
+ end;
|
|
|
|
+
|
|
function thdisposenode.pass_1 : tnode;
|
|
function thdisposenode.pass_1 : tnode;
|
|
begin
|
|
begin
|
|
pass_1:=nil;
|
|
pass_1:=nil;
|
|
@@ -276,6 +292,12 @@ implementation
|
|
TSIMPLENEWDISPOSENODE
|
|
TSIMPLENEWDISPOSENODE
|
|
*****************************************************************************}
|
|
*****************************************************************************}
|
|
|
|
|
|
|
|
+ constructor tsimplenewdisposenode.create(n : tnodetype;l : tnode);
|
|
|
|
+
|
|
|
|
+ begin
|
|
|
|
+ inherited create(n,l);
|
|
|
|
+ end;
|
|
|
|
+
|
|
function tsimplenewdisposenode.pass_1 : tnode;
|
|
function tsimplenewdisposenode.pass_1 : tnode;
|
|
begin
|
|
begin
|
|
pass_1:=nil;
|
|
pass_1:=nil;
|
|
@@ -334,18 +356,19 @@ implementation
|
|
if (m_tp_procvar in aktmodeswitches) then
|
|
if (m_tp_procvar in aktmodeswitches) then
|
|
begin
|
|
begin
|
|
hp:=left;
|
|
hp:=left;
|
|
- case hp.treetype of
|
|
|
|
|
|
+ case hp.nodetype of
|
|
calln :
|
|
calln :
|
|
begin
|
|
begin
|
|
{ is it a procvar? }
|
|
{ is it a procvar? }
|
|
- hp:=hp.right;
|
|
|
|
|
|
+ hp:=tcallnode(hp).right;
|
|
if assigned(hp) then
|
|
if assigned(hp) then
|
|
begin
|
|
begin
|
|
{ remove calln node }
|
|
{ remove calln node }
|
|
- putnode(left);
|
|
|
|
|
|
+ tcallnode(left).right:=nil;
|
|
|
|
+ left.free;
|
|
left:=hp;
|
|
left:=hp;
|
|
firstpass(hp);
|
|
firstpass(hp);
|
|
- procvarload:=true;
|
|
|
|
|
|
+ include(flags,nf_procvarload);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
loadn,
|
|
loadn,
|
|
@@ -358,13 +381,11 @@ implementation
|
|
if codegenerror then
|
|
if codegenerror then
|
|
exit;
|
|
exit;
|
|
if hp.resulttype^.deftype=procvardef then
|
|
if hp.resulttype^.deftype=procvardef then
|
|
- begin
|
|
|
|
- procvarload:=true;
|
|
|
|
- end;
|
|
|
|
|
|
+ include(flags,nf_procvarload);
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
end;
|
|
- if procvarload then
|
|
|
|
|
|
+ if nf_procvarload in flags then
|
|
begin
|
|
begin
|
|
registers32:=left.registers32;
|
|
registers32:=left.registers32;
|
|
registersfpu:=left.registersfpu;
|
|
registersfpu:=left.registersfpu;
|
|
@@ -379,22 +400,22 @@ implementation
|
|
end;
|
|
end;
|
|
|
|
|
|
{ proc 2 procvar ? }
|
|
{ proc 2 procvar ? }
|
|
- if left.treetype=calln then
|
|
|
|
|
|
+ if left.nodetype=calln then
|
|
begin
|
|
begin
|
|
{ generate a methodcallnode or proccallnode }
|
|
{ generate a methodcallnode or proccallnode }
|
|
{ we shouldn't convert things like @tcollection.load }
|
|
{ we shouldn't convert things like @tcollection.load }
|
|
- if (left.symtableprocentry^.owner^.symtabletype=objectsymtable) and
|
|
|
|
- not(assigned(left.methodpointer) and (left.methodpointer^.treetype=typen)) then
|
|
|
|
|
|
+ if (tcallnode(left).symtableprocentry^.owner^.symtabletype=objectsymtable) and
|
|
|
|
+ not(assigned(tcallnode(left).methodpointer) and (tcallnode(left).methodpointer.nodetype=typen)) then
|
|
begin
|
|
begin
|
|
- hp:=genloadmethodcallnode(pprocsym(left.symtableprocentry),left.symtableproc,
|
|
|
|
- getcopy(left.methodpointer));
|
|
|
|
- disposetree(p);
|
|
|
|
|
|
+ hp:=genloadmethodcallnode(pprocsym(tcallnode(left).symtableprocentry),tcallnode(left).symtableproc,
|
|
|
|
+ tcallnode(left).methodpointer.getcopy);
|
|
firstpass(hp);
|
|
firstpass(hp);
|
|
- p:=hp;
|
|
|
|
|
|
+ pass_1:=hp;
|
|
exit;
|
|
exit;
|
|
end
|
|
end
|
|
else
|
|
else
|
|
- hp:=genloadcallnode(pprocsym(left.symtableprocentry),left.symtableproc);
|
|
|
|
|
|
+ hp:=genloadcallnode(pprocsym(tcallnode(left).symtableprocentry),
|
|
|
|
+ tcallnode(left).symtableproc);
|
|
|
|
|
|
{ result is a procedure variable }
|
|
{ result is a procedure variable }
|
|
{ No, to be TP compatible, you must return a pointer to
|
|
{ No, to be TP compatible, you must return a pointer to
|
|
@@ -404,10 +425,10 @@ implementation
|
|
resulttype:=new(pprocvardef,init);
|
|
resulttype:=new(pprocvardef,init);
|
|
|
|
|
|
{ it could also be a procvar, not only pprocsym ! }
|
|
{ it could also be a procvar, not only pprocsym ! }
|
|
- if left.symtableprocentry^.typ=varsym then
|
|
|
|
- hp3:=pabstractprocdef(pvarsym(left.symtableentry)^.vartype.def)
|
|
|
|
|
|
+ if tcallnode(left).symtableprocentry^.typ=varsym then
|
|
|
|
+ hp3:=pabstractprocdef(pvarsym(tloadnode(left).symtableentry)^.vartype.def)
|
|
else
|
|
else
|
|
- hp3:=pabstractprocdef(pprocsym(left.symtableprocentry)^.definition);
|
|
|
|
|
|
+ hp3:=pabstractprocdef(pprocsym(tcallnode(left).symtableprocentry)^.definition);
|
|
|
|
|
|
pprocvardef(resulttype)^.proctypeoption:=hp3^.proctypeoption;
|
|
pprocvardef(resulttype)^.proctypeoption:=hp3^.proctypeoption;
|
|
pprocvardef(resulttype)^.proccalloptions:=hp3^.proccalloptions;
|
|
pprocvardef(resulttype)^.proccalloptions:=hp3^.proccalloptions;
|
|
@@ -421,7 +442,7 @@ implementation
|
|
include(pprocvardef(resulttype)^.procoptions,po_methodpointer);
|
|
include(pprocvardef(resulttype)^.procoptions,po_methodpointer);
|
|
{ we need to process the parameters reverse so they are inserted
|
|
{ we need to process the parameters reverse so they are inserted
|
|
in the correct right2left order (PFV) }
|
|
in the correct right2left order (PFV) }
|
|
- hp2^.:=pparaitem(hp3^.para^.last);
|
|
|
|
|
|
+ hp2:=pparaitem(hp3^.para^.last);
|
|
while assigned(hp2^.) do
|
|
while assigned(hp2^.) do
|
|
begin
|
|
begin
|
|
pprocvardef(resulttype)^.concatpara(hp2^.paratype,hp2^.paratyp,hp2^.defaultvalue);
|
|
pprocvardef(resulttype)^.concatpara(hp2^.paratype,hp2^.paratyp,hp2^.defaultvalue);
|
|
@@ -863,7 +884,9 @@ implementation
|
|
end.
|
|
end.
|
|
{
|
|
{
|
|
$Log$
|
|
$Log$
|
|
- Revision 1.1 2000-09-25 09:58:22 florian
|
|
|
|
- * first revision for testing purpose
|
|
|
|
|
|
+ Revision 1.2 2000-09-25 15:05:25 florian
|
|
|
|
+ * some updates
|
|
|
|
|
|
|
|
+ Revision 1.1 2000/09/25 09:58:22 florian
|
|
|
|
+ * first revision for testing purpose
|
|
}
|
|
}
|