mirror of
https://gitlab.com/freepascal.org/fpc/source.git
synced 2025-08-19 23:14:02 +02:00
* assignn check in exitnode changed to use a separate boolean as the
assignn can be changed to a calln
This commit is contained in:
parent
76bd75ed4a
commit
274624f2f6
@ -465,7 +465,7 @@ implementation
|
|||||||
include(flowcontrol,fc_exit);
|
include(flowcontrol,fc_exit);
|
||||||
if assigned(left) then
|
if assigned(left) then
|
||||||
begin
|
begin
|
||||||
if left.nodetype=assignn then
|
if onlyassign then
|
||||||
begin
|
begin
|
||||||
{ just do a normal assignment followed by exit }
|
{ just do a normal assignment followed by exit }
|
||||||
secondpass(left);
|
secondpass(left);
|
||||||
@ -1238,7 +1238,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.40 2002-09-01 14:41:47 peter
|
Revision 1.41 2002-09-01 18:47:00 peter
|
||||||
|
* assignn check in exitnode changed to use a separate boolean as the
|
||||||
|
assignn can be changed to a calln
|
||||||
|
|
||||||
|
Revision 1.40 2002/09/01 14:41:47 peter
|
||||||
* increase refcount in exit(arg) for arg
|
* increase refcount in exit(arg) for arg
|
||||||
|
|
||||||
Revision 1.39 2002/08/24 18:41:52 peter
|
Revision 1.39 2002/08/24 18:41:52 peter
|
||||||
|
@ -82,7 +82,10 @@ interface
|
|||||||
tfornodeclass = class of tfornode;
|
tfornodeclass = class of tfornode;
|
||||||
|
|
||||||
texitnode = class(tunarynode)
|
texitnode = class(tunarynode)
|
||||||
|
onlyassign : boolean;
|
||||||
constructor create(l:tnode);virtual;
|
constructor create(l:tnode);virtual;
|
||||||
|
constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
|
||||||
|
procedure ppuwrite(ppufile:tcompilerppufile);override;
|
||||||
function det_resulttype:tnode;override;
|
function det_resulttype:tnode;override;
|
||||||
function pass_1 : tnode;override;
|
function pass_1 : tnode;override;
|
||||||
end;
|
end;
|
||||||
@ -656,7 +659,7 @@ implementation
|
|||||||
{Can we spare the first comparision?}
|
{Can we spare the first comparision?}
|
||||||
if (right.nodetype=ordconstn) and (Tassignmentnode(left).right.nodetype=ordconstn) then
|
if (right.nodetype=ordconstn) and (Tassignmentnode(left).right.nodetype=ordconstn) then
|
||||||
if (
|
if (
|
||||||
(nf_backward in flags) and
|
(nf_backward in flags) and
|
||||||
(Tordconstnode(Tassignmentnode(left).right).value>=Tordconstnode(right).value)
|
(Tordconstnode(Tassignmentnode(left).right).value>=Tordconstnode(right).value)
|
||||||
)
|
)
|
||||||
or not(
|
or not(
|
||||||
@ -789,6 +792,21 @@ implementation
|
|||||||
constructor texitnode.create(l:tnode);
|
constructor texitnode.create(l:tnode);
|
||||||
begin
|
begin
|
||||||
inherited create(exitn,l);
|
inherited create(exitn,l);
|
||||||
|
onlyassign:=false;
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
constructor texitnode.ppuload(t:tnodetype;ppufile:tcompilerppufile);
|
||||||
|
begin
|
||||||
|
inherited ppuload(t,ppufile);
|
||||||
|
onlyassign:=boolean(ppufile.getbyte);
|
||||||
|
end;
|
||||||
|
|
||||||
|
|
||||||
|
procedure texitnode.ppuwrite(ppufile:tcompilerppufile);
|
||||||
|
begin
|
||||||
|
inherited ppuwrite(ppufile);
|
||||||
|
ppufile.putbyte(byte(onlyassign));
|
||||||
end;
|
end;
|
||||||
|
|
||||||
|
|
||||||
@ -809,6 +827,7 @@ implementation
|
|||||||
begin
|
begin
|
||||||
pt:=cfuncretnode.create(aktprocdef.funcretsym);
|
pt:=cfuncretnode.create(aktprocdef.funcretsym);
|
||||||
left:=cassignmentnode.create(pt,left);
|
left:=cassignmentnode.create(pt,left);
|
||||||
|
onlyassign:=true;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
end;
|
end;
|
||||||
@ -1386,7 +1405,11 @@ begin
|
|||||||
end.
|
end.
|
||||||
{
|
{
|
||||||
$Log$
|
$Log$
|
||||||
Revision 1.49 2002-09-01 08:01:16 daniel
|
Revision 1.50 2002-09-01 18:47:00 peter
|
||||||
|
* assignn check in exitnode changed to use a separate boolean as the
|
||||||
|
assignn can be changed to a calln
|
||||||
|
|
||||||
|
Revision 1.49 2002/09/01 08:01:16 daniel
|
||||||
* Removed sets from Tcallnode.det_resulttype
|
* Removed sets from Tcallnode.det_resulttype
|
||||||
+ Added read/write notifications of variables. These will be usefull
|
+ Added read/write notifications of variables. These will be usefull
|
||||||
for providing information for several optimizations. For example
|
for providing information for several optimizations. For example
|
||||||
|
Loading…
Reference in New Issue
Block a user