compiler.cfg.debugger: also print the instruction number
it's useful to see when debugging some compiler passeschar-rename
parent
d73666b9d0
commit
79dcce8f39
|
@ -6,9 +6,8 @@ compiler.cfg.instructions compiler.cfg.linearization
|
||||||
compiler.cfg.optimizer compiler.cfg.registers
|
compiler.cfg.optimizer compiler.cfg.registers
|
||||||
compiler.cfg.representations compiler.cfg.save-contexts
|
compiler.cfg.representations compiler.cfg.save-contexts
|
||||||
compiler.cfg.utilities compiler.tree.builder compiler.tree.optimizer
|
compiler.cfg.utilities compiler.tree.builder compiler.tree.optimizer
|
||||||
formatting fry io kernel namespaces prettyprint quotations sequences
|
formatting fry io kernel math namespaces prettyprint quotations
|
||||||
strings words ;
|
sequences strings words ;
|
||||||
FROM: compiler.cfg.linearization => number-blocks ;
|
|
||||||
IN: compiler.cfg.debugger
|
IN: compiler.cfg.debugger
|
||||||
|
|
||||||
GENERIC: test-builder ( quot -- cfgs )
|
GENERIC: test-builder ( quot -- cfgs )
|
||||||
|
@ -48,11 +47,13 @@ M: ##phi insn.
|
||||||
|
|
||||||
! XXX: pprint on a string prints the double quotes.
|
! XXX: pprint on a string prints the double quotes.
|
||||||
! This will cause graphviz to choke, so print without quotes.
|
! This will cause graphviz to choke, so print without quotes.
|
||||||
M: insn insn. tuple>array but-last [
|
: insn-number. ( n -- )
|
||||||
bl
|
dup integer? [ "%4d " printf ] [ drop " " printf ] if ;
|
||||||
] [
|
|
||||||
dup string? [ write ] [ pprint ] if
|
M: insn insn. ( insn -- )
|
||||||
] interleave nl ;
|
tuple>array unclip-last insn-number. [
|
||||||
|
dup string? [ ] [ unparse ] if
|
||||||
|
] map " " join write nl ;
|
||||||
|
|
||||||
: block-header. ( bb -- )
|
: block-header. ( bb -- )
|
||||||
[ number>> ] [ kill-block?>> "(k)" "" ? ] bi
|
[ number>> ] [ kill-block?>> "(k)" "" ? ] bi
|
||||||
|
|
Loading…
Reference in New Issue