|
|
@@ -117,24 +117,24 @@ Done:
|
|
|
below.)
|
|
|
|
|
|
Still to do:
|
|
|
-4. **Expressions / `Fact` / `Term` / `SimExpr` / `Expr`: BLOCKED.**
|
|
|
- Their `QbeGen` calls are not (only) inline emit — they are the
|
|
|
- front-end **constant evaluator**. `Expr`'s `q` is handed to
|
|
|
- `SymTab.SetSymVal` and `Lower.NoteConstVal` for a CONST, and
|
|
|
- `Lower` re-emits the constant from it (`Lower.mod:2499`,
|
|
|
- `IsImm(qv)` → `DeclConst`); `QbeGen.ConstInt` likewise needs a
|
|
|
- folded literal for BY/THEN/array bounds. Removing `Fold2`/`CopyOp`/
|
|
|
- `Op3`/`NewTemp` there would break constants and constant-bound
|
|
|
- checks. Deleting them requires first teaching `Lower` to fold
|
|
|
- constants itself from the AST (a real change, not cleanup), then
|
|
|
- dropping the grammar's value layer.
|
|
|
- **Designators are fused the same way, confirmed 2026-10-08:**
|
|
|
- `Fact` calls `Design<…, qd, …>` then records `NoteAddr(q, qd)` /
|
|
|
- `AddrOf(qn, qa)`, and `ActParam` recovers the VAR-actual address with
|
|
|
- `AddrOfVal(qe, qa)`; `q`/`qd` also feed `IsImm`/`ConstInt` for CASE
|
|
|
- labels, bounds and BY. So dropping `LoadVar`/`ElemLoad`/`FieldAddr`/
|
|
|
- `AddrOf` from `Design` breaks the grammar's own value/note chain, not
|
|
|
- just output.
|
|
|
+4. **Expressions: PARTIALLY DONE (2026-10-08).** The runtime emit
|
|
|
+ has been removed from `SimExpr`, `Term`, `Expr` and `Fact`'s
|
|
|
+ always-runtime branches; a runtime result is the non-constant
|
|
|
+ sentinel `"@"` (which `IsImm`/`ConstInt` reject), while constant
|
|
|
+ folding (`NegFold`/`Fold2`/`StrFold`) and every check stay. This
|
|
|
+ works because those productions' values only feed further value ops
|
|
|
+ and constant checks.
|
|
|
+ **The rest is one coupled change:** `Design` → `Fact` → `ArgList` →
|
|
|
+ `ActParam` plus the `NoteAddr`/`AddrOfVal` chain. `Fact` records
|
|
|
+ `NoteAddr(q, qd)`/`AddrOf(qn, qa)` and `ActParam` recovers the
|
|
|
+ VAR-actual address with `AddrOfVal(qe, qa)` — and the note key is the
|
|
|
+ actual's *emitted* value, so dropping `ArgList`'s `CallBegin` alone
|
|
|
+ (fewer `NewTemp`s) shifts the keys and breaks calls (verified: 75
|
|
|
+ suite failures). To finish: `Design` emits nothing (literal for a
|
|
|
+ constant, `"@"` otherwise), `Fact` drops the notes, `ActParam`
|
|
|
+ replaces `AddrOfVal` with an AST-kind addressability check and drops
|
|
|
+ `CallArg`, then `ArgList` drops `CallBegin`/`CallEnd`; afterwards
|
|
|
+ `NoteAddr`/`AddrOfVal`/`AddrOf` in `QbeGen` are dead.
|
|
|
5. **Calls, proc headings, imports, classes: BLOCKED too, by fused
|
|
|
validation.** The `QbeGen` emit functions double as semantic
|
|
|
checks and the grammar depends on their result: `QbeGen.CallArg`
|