]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: make -W and -w headers and footers clearer
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 24 May 2018 20:31:40 +0000 (13:31 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 25 May 2018 13:09:29 +0000 (13:09 +0000)
-W and -w turn on printing of Nodes for both order and walk.
I have found their output mildly incomprehensible for years.
Improve it, at long last.

Change-Id: Ia05d77e59aa741c2dfc9fcca07f45019420b655e
Reviewed-on: https://go-review.googlesource.com/114520
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
src/cmd/compile/internal/gc/walk.go

index 7ae0a1707b4b51cee8b31480e484f5ef3f2aab2e..f42d1e43db6eaffd2a74406dbaf87d9714e53895 100644 (file)
@@ -20,7 +20,7 @@ func walk(fn *Node) {
        Curfn = fn
 
        if Debug['W'] != 0 {
-               s := fmt.Sprintf("\nbefore %v", Curfn.Func.Nname.Sym)
+               s := fmt.Sprintf("\nbefore walk %v", Curfn.Func.Nname.Sym)
                dumplist(s, Curfn.Nbody)
        }
 
@@ -473,7 +473,7 @@ func walkexpr(n *Node, init *Nodes) *Node {
        lno := setlineno(n)
 
        if Debug['w'] > 1 {
-               Dump("walk-before", n)
+               Dump("before walk expr", n)
        }
 
        if n.Typecheck() != 1 {
@@ -1763,7 +1763,7 @@ opswitch:
        updateHasCall(n)
 
        if Debug['w'] != 0 && n != nil {
-               Dump("walk", n)
+               Dump("after walk expr", n)
        }
 
        lineno = lno