Преглед изворни кода

lower L7: split ProcHeading — drop Mangled/SetFuncRes/EndFuncHeader

Keep the lifecycle that maintains parser state for the checks
(BeginFunc resets nPar/funcDepth/opens the scope; FuncParam is a check;
EndFunc/AbortFunc close it), but drop the pure-output parts: the header
name mangling (BeginFunc now gets ""), SetFuncRes, and the two
EndFuncHeader flushes.

Note: an empty `(. .)` action in ProcDecl generated a bare `;` that gm2
accepts but the V3 self-host grammar rejects, so the action is removed
outright rather than emptied.

Suite 204/204; FIXPOINT OK (3,377,935 bytes).
Eric Streit пре 5 дана
родитељ
комит
02f2526f12
2 измењених фајлова са 2031 додато и 2049 уклоњено
  1. 3 12
      compiler/src/M2.atg
  2. 2028 2037
      compiler/src/M2.lst

+ 3 - 12
compiler/src/M2.atg

@@ -1006,7 +1006,7 @@ PRODUCTIONS
                                            QbeGen.AbortFunc;
                                            Lower.ScopeLeave;
                                            SymTab.CloseProc; .)
-      |                                 (. QbeGen.EndFuncHeader;
+      |                                 (.
                                            (* bind the receiver: bare
                                               field names resolve
                                               against THIS *)
@@ -1174,15 +1174,7 @@ PRODUCTIONS
                                              SymTab.InvalidType,
                                              SymTab.ProcDepthOf(pn),
                                              FALSE);
-                                           IF methCls #
-                                              SymTab.InvalidType THEN
-                                             QbeGen.Mangled(pn,
-                                               SymTab.MethUid(), mg)
-                                           ELSE
-                                             QbeGen.Mangled(pn,
-                                               SymTab.ProcUid(pn), mg)
-                                           END;
-                                           QbeGen.BeginFunc(mg);
+                                           QbeGen.BeginFunc("");
                                            IF methCls #
                                               SymTab.InvalidType THEN
                                              (* hidden THIS receiver:
@@ -1201,7 +1193,6 @@ PRODUCTIONS
       [ ":" TypeIdent<t>                (. IF NOT SymTab.SetProcRes(t) THEN
                                              SemError(235) END;
                                            Lower.SetProcRes(t);
-                                           QbeGen.SetFuncRes(t);
                                            IF (t #
                                               SymTab.InvalidType)
  AND ((SymTab.ClassOf(t)
@@ -1264,7 +1255,7 @@ PRODUCTIONS
                                            SymTab.MarkExternal("");
                                            SymTab.CloseProc;
                                            QbeGen.AbortFunc; .)
-      |                                 (. QbeGen.EndFuncHeader; .)
+      |                                 
         Block<pn>                       (. AST.SetChild(astNode, 1, astStmt);
                                            AST.SetChild(astNode, 2, astBlkDecls);
                                            astDecl := astNode;

Разлика између датотеке није приказан због своје велике величине
+ 2028 - 2037
compiler/src/M2.lst


Неке датотеке нису приказане због велике количине промена