]> Cypherpunks repositories - gostls13.git/commit
cmd/compile/internal/gc: add alternative node dumper for debugging
authorRobert Griesemer <gri@golang.org>
Wed, 19 Sep 2018 23:20:51 +0000 (16:20 -0700)
committerRobert Griesemer <gri@golang.org>
Mon, 1 Oct 2018 21:53:00 +0000 (21:53 +0000)
commit5d444e36a664e7f0c4b6e4e53bb76f964028bd22
tree0eaa0d5779c8c02b95386206e19f604a2ca1fcb5
parentf99fc3a119dbb98fa9dddcb2e31a6c51925fde77
cmd/compile/internal/gc: add alternative node dumper for debugging

dump/fdump is a reflection-based data structure dumper slightly
customized for the compiler's Node data structure. It dumps the
transitivle closure of Node (and other) data structures using a
recursive descent depth first traversal and permits filtering
options (recursion depth limitation, filtering of struct fields).

I have been using it to diagnose compiler bugs and found it more
useful than the existing node printing code in some cases because
field filtering reduces the output to the interesting parts.

No impact on rest of compiler if functions are not called (which
they only should during a debugging session).

Change-Id: I79d7227f10dd78dbd4bbcdf204db236102fc97a7
Reviewed-on: https://go-review.googlesource.com/136397
Reviewed-by: Alan Donovan <adonovan@google.com>
src/cmd/compile/internal/gc/dump.go [new file with mode: 0644]