Răsfoiți Sursa

* assignn check in exitnode changed to use a separate boolean as the
assignn can be changed to a calln

peter 23 ani în urmă
părinte
comite
274624f2f6
2 a modificat fișierele cu 31 adăugiri și 4 ștergeri
  1. 6 2
      compiler/ncgflw.pas
  2. 25 2
      compiler/nflw.pas

+ 6 - 2
compiler/ncgflw.pas

@@ -465,7 +465,7 @@ implementation
          include(flowcontrol,fc_exit);
          if assigned(left) then
            begin
-             if left.nodetype=assignn then
+             if onlyassign then
                begin
                   { just do a normal assignment followed by exit }
                   secondpass(left);
@@ -1238,7 +1238,11 @@ begin
 end.
 {
   $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
 
   Revision 1.39  2002/08/24 18:41:52  peter

+ 25 - 2
compiler/nflw.pas

@@ -82,7 +82,10 @@ interface
        tfornodeclass = class of tfornode;
 
        texitnode = class(tunarynode)
+          onlyassign : boolean;
           constructor create(l:tnode);virtual;
+          constructor ppuload(t:tnodetype;ppufile:tcompilerppufile);override;
+          procedure ppuwrite(ppufile:tcompilerppufile);override;
           function det_resulttype:tnode;override;
           function pass_1 : tnode;override;
        end;
@@ -656,7 +659,7 @@ implementation
          {Can we spare the first comparision?}
          if (right.nodetype=ordconstn) and (Tassignmentnode(left).right.nodetype=ordconstn) then
             if (
-                (nf_backward in flags) and 
+                (nf_backward in flags) and
                 (Tordconstnode(Tassignmentnode(left).right).value>=Tordconstnode(right).value)
                )
              or not(
@@ -789,6 +792,21 @@ implementation
     constructor texitnode.create(l:tnode);
       begin
         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;
 
 
@@ -809,6 +827,7 @@ implementation
                begin
                  pt:=cfuncretnode.create(aktprocdef.funcretsym);
                  left:=cassignmentnode.create(pt,left);
+                 onlyassign:=true;
                end;
             end;
          end;
@@ -1386,7 +1405,11 @@ begin
 end.
 {
   $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
    + Added read/write notifications of variables. These will be usefull
      for providing information for several optimizations. For example