From 9149ea7a50c564856bd09633f38d980e8230c34f Mon Sep 17 00:00:00 2001 From: Cliff Click Date: Sat, 3 Oct 2026 15:08:55 -0700 Subject: Cleanup ch18 readme --- chapter18/docs/Makefile | 13 +- chapter18/docs/inline-after.json | 101 ++++++++++++++ chapter18/docs/inline-after.svg | 81 +++++++++++ chapter18/docs/inline-before.json | 276 ++++++++++++++++++++++++++++++++++++++ chapter18/docs/inline-before.svg | 117 ++++++++++++++++ 5 files changed, 576 insertions(+), 12 deletions(-) create mode 100644 chapter18/docs/inline-after.json create mode 100644 chapter18/docs/inline-after.svg create mode 100644 chapter18/docs/inline-before.json create mode 100644 chapter18/docs/inline-before.svg (limited to 'chapter18/docs') diff --git a/chapter18/docs/Makefile b/chapter18/docs/Makefile index 12659b8f..6fa0f057 100644 --- a/chapter18/docs/Makefile +++ b/chapter18/docs/Makefile @@ -1,12 +1 @@ -GV := $(wildcard *.gv) -SVG := $(patsubst %.gv,%.svg,$(GV)) - -.PHONY: all -all: $(SVG) - -%.svg: %.gv - dot -Tsvg $< > $@ - -.PHONY: clean -clean: - @rm -f $(SVG) +include ../../graph/docs.mk diff --git a/chapter18/docs/inline-after.json b/chapter18/docs/inline-after.json new file mode 100644 index 00000000..64e36e97 --- /dev/null +++ b/chapter18/docs/inline-after.json @@ -0,0 +1,101 @@ +{ + "ver": 1, + "comp": "inline", + "step": 2, + "roots": [ + 12 + ], + "scope": 0, + "nodes": [ + { + "id": 1, + "label": "Parm_arg", + "type": "int", + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 0, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 2, + "label": "Con", + "type": "1", + "kind": "DATA", + "edges": [], + "proj": null + }, + { + "id": 8, + "label": "Add", + "type": "int", + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 1, + "role": "DATA", + "label": null + }, + { + "idx": 2, + "def": 2, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 12, + "label": "Return main", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 0, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 8, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 0, + "role": "DATA", + "label": null + } + ], + "proj": null + } + ], + "groups": [] +} diff --git a/chapter18/docs/inline-after.svg b/chapter18/docs/inline-after.svg new file mode 100644 index 00000000..f376ce7f --- /dev/null +++ b/chapter18/docs/inline-after.svg @@ -0,0 +1,81 @@ +#8[1] → #1 · DATA#8[2] → #2 · DATA#12[2] → #8 · DATAParm_arg  #1int#1 Parm_arg +int + +[0] → — ASSOC +[1] → — DATA01Con  #21#2 Con +1 + +Add  #8int#8 Add +int + +[0] → — CTRL +[1] → #1 DATA +[2] → #2 DATA012Return main  #12#12 Return main +Type not computed + +[0] → — CTRL +[1] → — MEM +[2] → #8 DATA +[3] → — DATA0123 diff --git a/chapter18/docs/inline-before.json b/chapter18/docs/inline-before.json new file mode 100644 index 00000000..243aff79 --- /dev/null +++ b/chapter18/docs/inline-before.json @@ -0,0 +1,276 @@ +{ + "ver": 1, + "comp": "inline", + "step": 1, + "roots": [ + 12 + ], + "scope": 0, + "nodes": [ + { + "id": 1, + "label": "Parm_arg", + "type": "int", + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 0, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 2, + "label": "Con", + "type": "1", + "kind": "DATA", + "edges": [], + "proj": null + }, + { + "id": 3, + "label": "Con inc", + "type": "{int -> int}", + "kind": "DATA", + "edges": [], + "proj": null + }, + { + "id": 4, + "label": "Call", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 0, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 1, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 3, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 5, + "label": "inc", + "type": null, + "kind": "FUN", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 2, + "def": 4, + "role": "CTRL", + "label": null + } + ], + "proj": null + }, + { + "id": 6, + "label": "Con", + "type": "int", + "kind": "DATA", + "edges": [], + "proj": null + }, + { + "id": 7, + "label": "Parm_x", + "type": "int", + "kind": "PHI", + "edges": [ + { + "idx": 0, + "def": 5, + "role": "ASSOC", + "label": null + }, + { + "idx": 1, + "def": 6, + "role": "DATA", + "label": null + }, + { + "idx": 2, + "def": 1, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 8, + "label": "Add", + "type": "int", + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 7, + "role": "DATA", + "label": null + }, + { + "idx": 2, + "def": 2, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 9, + "label": "Return inc", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 0, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 8, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 0, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 10, + "label": "CallEnd", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 4, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 9, + "role": "DATA", + "label": null + } + ], + "proj": null + }, + { + "id": 11, + "label": "result", + "type": "int", + "kind": "DATA", + "edges": [ + { + "idx": 0, + "def": 10, + "role": "DATA", + "label": null + } + ], + "proj": { + "par": 10, + "idx": 2 + } + }, + { + "id": 12, + "label": "Return main", + "type": null, + "kind": "CTRL", + "edges": [ + { + "idx": 0, + "def": 0, + "role": "CTRL", + "label": null + }, + { + "idx": 1, + "def": 0, + "role": "MEM", + "label": null + }, + { + "idx": 2, + "def": 11, + "role": "DATA", + "label": null + }, + { + "idx": 3, + "def": 0, + "role": "DATA", + "label": null + } + ], + "proj": null + } + ], + "groups": [] +} diff --git a/chapter18/docs/inline-before.svg b/chapter18/docs/inline-before.svg new file mode 100644 index 00000000..8e15f6ea --- /dev/null +++ b/chapter18/docs/inline-before.svg @@ -0,0 +1,117 @@ +#4[2] → #1 · DATA#4[3] → #3 · DATA#5[2] → #4 · CTRL#7[1] → #6 · DATA#7[2] → #1 · DATA#8[1] → #7 · DATA#8[2] → #2 · DATA#9[2] → #8 · DATA#10[0] → #4 · CTRL#10[1] → #9 · DATA#12[2] → #11 · DATAParm_arg  #1int#1 Parm_arg +int + +[0] → — ASSOC +[1] → — DATA01Con  #21#2 Con +1 + +Con inc  #3{int -> int}#3 Con inc +{int -> int} + +Call  #4#4 Call +Type not computed + +[0] → — CTRL +[1] → — MEM +[2] → #1 DATA +[3] → #3 DATA0123inc  #5#5 inc +Type not computed + +[0] → — ASSOC +[1] → — CTRL +[2] → #4 CTRL012Con  #6int#6 Con +int + +Parm_x  #7int#7 Parm_x +int + +[0] → #5 ASSOC +[1] → #6 DATA +[2] → #1 DATA[0] → #5012Add  #8int#8 Add +int + +[0] → — CTRL +[1] → #7 DATA +[2] → #2 DATA012Return inc  #9#9 Return inc +Type not computed + +[0] → — CTRL +[1] → — MEM +[2] → #8 DATA +[3] → — DATA0123CallEnd  #10#10 CallEnd +Type not computed + +[0] → #4 CTRL +[1] → #9 DATA01result  #11/2int#11 result +Projection 2 of #10 +int + +[0] → #10 DATAReturn main  #12#12 Return main +Type not computed + +[0] → — CTRL +[1] → — MEM +[2] → #11 DATA +[3] → — DATA0123 -- cgit v1.2.3