Bladeren bron

lower L7: drop inline emit from the declarations/lifecycle

Third slice of the inline-emit deletion: remove the pure emission from
the declaration and module-lifecycle productions, keeping the AST and
the semantic checks:

- VarDecl: drop DeclVar; ConstDecl: drop DeclConst.
- ImplUnit/NestedModule/Class BEGIN: drop BeginInit/EndInit.
- ProgModule: drop BeginBody and EndModule.
- FlushPend: drop the deferred DeclVar; FwdVarFlush: drop FwdPatch.

This slice only became green after the RestoreSession note-ring fix:
before it, dropping DeclVar shifted the grammar's parse-time NoteAddr
keys and Lower mis-resolved Strings.Replace's `src` to $Strings_nl,
breaking Showcase11's link.

Suite 204/204; FIXPOINT OK (3,538,557 bytes).
Eric Streit 3 dagen geleden
bovenliggende
commit
acc4e9158b
2 gewijzigde bestanden met toevoegingen van 3588 en 3598 verwijderingen
  1. 7 12
      compiler/src/M2.atg
  2. 3581 3586
      compiler/src/M2.lst

+ 7 - 12
compiler/src/M2.atg

@@ -127,7 +127,6 @@ PROCEDURE FlushPend;
   BEGIN
   BEGIN
     k := 0;
     k := 0;
     WHILE k < nPendVar DO
     WHILE k < nPendVar DO
-      QbeGen.DeclVar(pendVarName[k], pendVarT[k]);
       INC(k)
       INC(k)
     END;
     END;
     nPendVar := 0
     nPendVar := 0
@@ -162,7 +161,6 @@ PROCEDURE FwdVarFlush;
           ELSE oper := "w"
           ELSE oper := "w"
           END;
           END;
           ok := SymTab.GlobalRef(nm, g);
           ok := SymTab.GlobalRef(nm, g);
-          QbeGen.FwdPatch(fvarSlot[k], fvarSlot[k], nm, oper, ok)
         END
         END
       END;
       END;
       INC(k)
       INC(k)
@@ -337,8 +335,8 @@ PRODUCTIONS
                                            END;
                                            END;
                                            SymTab.FwdClear;
                                            SymTab.FwdClear;
                                            FwdVarFlush;
                                            FwdVarFlush;
-                                           QbeGen.BeginInit(m1); .)
-        [ StatSeq ]                       (. QbeGen.EndInit; .) ]
+                                           .)
+        [ StatSeq ] ]
       "END"
       "END"
       GetIdent<m2>                      (. FlushPend;
       GetIdent<m2>                      (. FlushPend;
                                            k := 0;
                                            k := 0;
@@ -387,7 +385,7 @@ PRODUCTIONS
                                            END;
                                            END;
                                            SymTab.FwdClear;
                                            SymTab.FwdClear;
                                            FwdVarFlush;
                                            FwdVarFlush;
-                                           QbeGen.BeginBody; .)
+                                           .)
         [ StatSeq ] ]
         [ StatSeq ] ]
       "END"
       "END"
       GetIdent<m2>                      (. FlushPend;
       GetIdent<m2>                      (. FlushPend;
@@ -408,7 +406,6 @@ PRODUCTIONS
                                            AST.SetChild(astNode, 2, astStmt);
                                            AST.SetChild(astNode, 2, astStmt);
                                            AST.SetChild(astNode, 3, astImp);
                                            AST.SetChild(astNode, 3, astImp);
                                            astUnit := astNode;
                                            astUnit := astNode;
-                                           QbeGen.EndModule(m1);
                                            SymTab.EndUnit; .) .
                                            SymTab.EndUnit; .) .
   DeclSeq                               (. VAR astSeq, astTail: AST.Node; .)
   DeclSeq                               (. VAR astSeq, astTail: AST.Node; .)
     =                                   (. astSeq := AST.NoNode;
     =                                   (. astSeq := AST.NoNode;
@@ -452,8 +449,8 @@ PRODUCTIONS
         ";" ]
         ";" ]
       DeclSeq                           (. astStmt := AST.NoNode; .)
       DeclSeq                           (. astStmt := AST.NoNode; .)
       [ "BEGIN"                         (. astStmt := AST.NoNode;
       [ "BEGIN"                         (. astStmt := AST.NoNode;
-                                           QbeGen.BeginInit(m1); .)
-        [ StatSeq ]                     (. QbeGen.EndInit; .) ]
+                                           .)
+        [ StatSeq ] ]
       "END"
       "END"
       GetIdent<m2>                      (. AST.SetChild(astNode, 1, astDecl);
       GetIdent<m2>                      (. AST.SetChild(astNode, 1, astDecl);
                                            AST.SetChild(astNode, 2, astStmt);
                                            AST.SetChild(astNode, 2, astStmt);
@@ -995,8 +992,8 @@ PRODUCTIONS
       ";" { MethodImpl<ct> ";" }
       ";" { MethodImpl<ct> ";" }
                                         (. astStmt := AST.NoNode; .)
                                         (. astStmt := AST.NoNode; .)
       [ "BEGIN"                         (. astStmt := AST.MakeNode(AST.NkBlock);
       [ "BEGIN"                         (. astStmt := AST.MakeNode(AST.NkBlock);
-                                           QbeGen.BeginInit(cn); .)
-        [ StatSeq ]                     (. QbeGen.EndInit; .) ]
+                                           .)
+        [ StatSeq ] ]
       "END"
       "END"
       GetIdent<m2>                      (. IF NOT SymTab.Equal(cn, m2) THEN
       GetIdent<m2>                      (. IF NOT SymTab.Equal(cn, m2) THEN
                                              SemError(202) END;
                                              SemError(202) END;
@@ -1071,7 +1068,6 @@ PRODUCTIONS
                                              SemError(230)
                                              SemError(230)
                                            ELSE
                                            ELSE
                                              SymTab.SetSymVal(n, qv);
                                              SymTab.SetSymVal(n, qv);
-                                             QbeGen.DeclConst(n, qv, t)
                                            END; .) .
                                            END; .) .
   VarBlock                              (. VAR astSeq, astTail: AST.Node; .)
   VarBlock                              (. VAR astSeq, astTail: AST.Node; .)
     = "VAR"                             (. astSeq := AST.NoNode;
     = "VAR"                             (. astSeq := AST.NoNode;
@@ -1140,7 +1136,6 @@ PRODUCTIONS
                                            ELSE
                                            ELSE
                                              WHILE i < SymTab.PendCount() DO
                                              WHILE i < SymTab.PendCount() DO
                                                SymTab.PendName(i, nm);
                                                SymTab.PendName(i, nm);
-                                               QbeGen.DeclVar(nm, t);
                                                INC(i)
                                                INC(i)
                                              END
                                              END
                                            END;
                                            END;

File diff suppressed because it is too large
+ 3581 - 3586
compiler/src/M2.lst


Some files were not shown because too many files changed in this diff