diff --git a/src/cmd/compile/internal/ir/fmt.go b/src/cmd/compile/internal/ir/fmt.go index 29505357cc..033188547b 100644 --- a/src/cmd/compile/internal/ir/fmt.go +++ b/src/cmd/compile/internal/ir/fmt.go @@ -1061,8 +1061,8 @@ func dumpNodeHeader(w io.Writer, n Node) { } } - if n.Typecheck() != 0 { - fmt.Fprintf(w, " tc(%d)", n.Typecheck()) + if n.Sym() != nil && n.Op() != ONAME && n.Op() != ONONAME && n.Op() != OTYPE { + fmt.Fprintf(w, " %+v", n.Sym()) } // Print Node-specific fields of basic type in header line. @@ -1132,6 +1132,9 @@ func dumpNodeHeader(w io.Writer, n Node) { } fmt.Fprintf(w, " %+v", n.Type()) } + if n.Typecheck() != 0 { + fmt.Fprintf(w, " tc(%d)", n.Typecheck()) + } if n.Pos().IsKnown() { fmt.Fprint(w, " # ") @@ -1248,13 +1251,6 @@ func dumpNode(w io.Writer, n Node, depth int) { return } - if n.Sym() != nil { - fmt.Fprintf(w, " %+v", n.Sym()) - } - if n.Type() != nil { - fmt.Fprintf(w, " %+v", n.Type()) - } - v := reflect.ValueOf(n).Elem() t := reflect.TypeOf(n).Elem() nf := t.NumField()