ソースを参照

lower L7: remove four QbeGen procedures orphaned by the emit deletion

CloseModule, FwdPatch, FwdElemPatch and Remark are no longer called by
the grammar (their call sites went with the inline emit) nor by Lower.
Drop them from QbeGen.def/.mod.

Suite 204/204; FIXPOINT OK (3,443,593 bytes).
Eric Streit 3 日 前
親
コミット
e2698286e4
2 ファイル変更、1 行追加、53 行削除
  1. 1 14
      compiler/src/QbeGen.def
  2. 0 39
      compiler/src/QbeGen.mod

+ 1 - 14
compiler/src/QbeGen.def

@@ -38,11 +38,6 @@ PROCEDURE EndModule (name: ARRAY OF CHAR);
 (* Return sequence, hoisted data, then writes the whole image to
 (* Return sequence, hoisted data, then writes the whole image to
    gen_ssa/<name>.ssa (name = program module). *)
    gen_ssa/<name>.ssa (name = program module). *)
 
 
-PROCEDURE CloseModule;
-(* Closes the .ssa without emitting a function (units whose
-   lowering waits for step 4: definitions, implementations,
-   and any unit containing nested modules). *)
-
 PROCEDURE DelayBegin;
 PROCEDURE DelayBegin;
 PROCEDURE DelayEnd;
 PROCEDURE DelayEnd;
 PROCEDURE DelayFlush;
 PROCEDURE DelayFlush;
@@ -285,8 +280,7 @@ PROCEDURE Fold2 (kind: INTEGER; a, b: ARRAY OF CHAR; VAR r: QVal): BOOLEAN;
    decimal literals: kind 0=+ 1=- 2=* 3=DIV 4=MOD. r gets the result
    decimal literals: kind 0=+ 1=- 2=* 3=DIV 4=MOD. r gets the result
    and TRUE is returned; otherwise r is untouched and FALSE. *)
    and TRUE is returned; otherwise r is untouched and FALSE. *)
 
 
-PROCEDURE Remark (s: ARRAY OF CHAR);
-(* Emits a "# s" comment line. *)
+
 
 
 (* ---------------- arrays (step 3.1: length-prefixed layout) ---------------- *)
 (* ---------------- arrays (step 3.1: length-prefixed layout) ---------------- *)
 (* Every array value: LONGCARD count + packed elements. Indexes and
 (* Every array value: LONGCARD count + packed elements. Indexes and
@@ -491,13 +485,6 @@ PROCEDURE FwdDesignator (): INTEGER;
    (%t =l copy 0).  Returns its id (0 when full). *)
    (%t =l copy 0).  Returns its id (0 when full). *)
 PROCEDURE FwdAddrOper (id: INTEGER; VAR q: QVal);
 PROCEDURE FwdAddrOper (id: INTEGER; VAR q: QVal);
 (* The address operand of patch site id. *)
 (* The address operand of patch site id. *)
-PROCEDURE FwdPatch (site, id: INTEGER; name: ARRAY OF CHAR;
-                    oper: CHAR; global: BOOLEAN);
-(* Fills in a patch site: the getaddr's source and the load/store
-   operand (oper = the QBE class letter d/l/w for the final load). *)
-PROCEDURE FwdElemPatch (id: INTEGER; oper: CHAR);
-(* Re-classes patch site id after it was indexed (the designator is now
-   an element address rather than an array). *)
 PROCEDURE HApp (s: ARRAY OF CHAR);
 PROCEDURE HApp (s: ARRAY OF CHAR);
 PROCEDURE UpAddrOf (flat: INTEGER; levels: CARDINAL; VAR q: QVal);
 PROCEDURE UpAddrOf (flat: INTEGER; levels: CARDINAL; VAR q: QVal);
 PROCEDURE Revive;
 PROCEDURE Revive;

+ 0 - 39
compiler/src/QbeGen.mod

@@ -377,31 +377,6 @@ PROCEDURE FwdAddrOper (id: INTEGER; VAR q: QVal);
     FwdMangle(id, q)
     FwdMangle(id, q)
   END FwdAddrOper;
   END FwdAddrOper;
 
 
-PROCEDURE FwdPatch (site, id: INTEGER; name: ARRAY OF CHAR;
-                    oper: CHAR; global: BOOLEAN);
-(* Records the resolved designator for placeholder id.  The class
-   letter (`oper`) re-classes the load whose operand is the
-   placeholder; the symbol replaces the placeholder everywhere. *)
-  VAR k: INTEGER; nm: QVal;
-  BEGIN
-    k := id - 1;
-    IF (k < 0) OR (k > VAL(INTEGER, HIGH(fwdSite))) THEN RETURN END;
-    IF global THEN SymRef(name, nm); Cpy(fwdSite[k], nm)
-    ELSE Cpy(fwdSite[k], name)
-    END;
-    fwdOper[k][0] := oper; fwdOper[k][1] := CHR(0);
-    fwdGlob[k] := global
-  END FwdPatch;
-
-PROCEDURE FwdElemPatch (id: INTEGER; oper: CHAR);
-  VAR k: INTEGER;
-  BEGIN
-    k := id - 1;
-    IF (k >= 0) AND (k <= VAL(INTEGER, HIGH(fwdSite))) THEN
-      fwdOper[k][0] := oper; fwdOper[k][1] := CHR(0)
-    END
-  END FwdElemPatch;
-
 PROCEDURE FixLoadClass (ph: ARRAY OF CHAR; cls: CHAR);
 PROCEDURE FixLoadClass (ph: ARRAY OF CHAR; cls: CHAR);
 (* Re-class "<tmp> =<x> load<x> <ph>" -> "<tmp> =<cls> load<cls> <ph>".
 (* Re-class "<tmp> =<x> load<x> <ph>" -> "<tmp> =<cls> load<cls> <ph>".
    The default emit for an unresolved alias is `l` (pointer-like). *)
    The default emit for an unresolved alias is `l` (pointer-like). *)
@@ -926,14 +901,6 @@ PROCEDURE BeginBody;
     END
     END
   END BeginBody;
   END BeginBody;
 
 
-PROCEDURE CloseModule;
-  BEGIN
-    IF NOT opened THEN RETURN END;
-    WL("# no code: unit lowering waits for step 4");
-    FileIO.Close(out);
-    opened := FALSE
-  END CloseModule;
-
 PROCEDURE EndModule (name: ARRAY OF CHAR);
 PROCEDURE EndModule (name: ARRAY OF CHAR);
   VAR i : CARDINAL;
   VAR i : CARDINAL;
     fname : ARRAY [0 .. 127] OF CHAR;
     fname : ARRAY [0 .. 127] OF CHAR;
@@ -3794,12 +3761,6 @@ PROCEDURE CmpL (op: INTEGER; l, r: ARRAY OF CHAR; VAR q: QVal);
     Op3(mn, q, l, r, FALSE)
     Op3(mn, q, l, r, FALSE)
   END CmpL;
   END CmpL;
 
 
-PROCEDURE Remark (s: ARRAY OF CHAR);
-  BEGIN
-    Revive;
-    W("# "); WL(s)
-  END Remark;
-
 (* ---------------- heap (step 3.6: extern malloc/free) ---------------- *)
 (* ---------------- heap (step 3.6: extern malloc/free) ---------------- *)
 (* Only the object skeleton is initialized (array counts); elements
 (* Only the object skeleton is initialized (array counts); elements
    and members stay garbage per Wirth, except nested objects which
    and members stay garbage per Wirth, except nested objects which