[dev.regabi] cmd/compile: remove "short" node header mode

This is unreachable code - the only way short can be true is
if verb == 'S', but jconv is only called when verb == 'j'.
Simplify by removing.

Passes buildall w/ toolstash -cmp.

Change-Id: I27bd38319f72215069e940b320b5c82608e2651a
Reviewed-on: https://go-review.googlesource.com/c/go/+/275772
Trust: Russ Cox <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Russ Cox 2020-12-04 18:40:24 -05:00
parent ef5964dd6b
commit a79742f39a
2 changed files with 10 additions and 14 deletions

View file

@ -148,7 +148,7 @@ func init() {
} }
// escFmt is called from node printing to print information about escape analysis results. // escFmt is called from node printing to print information about escape analysis results.
func escFmt(n ir.Node, short bool) string { func escFmt(n ir.Node) string {
text := "" text := ""
switch n.Esc() { switch n.Esc() {
case EscUnknown: case EscUnknown:
@ -161,9 +161,7 @@ func escFmt(n ir.Node, short bool) string {
text = "esc(no)" text = "esc(no)"
case EscNever: case EscNever:
if !short { text = "esc(N)"
text = "esc(N)"
}
default: default:
text = fmt.Sprintf("esc(%d)", n.Esc()) text = fmt.Sprintf("esc(%d)", n.Esc())

View file

@ -339,21 +339,19 @@ func nodeFormat(n Node, s fmt.State, verb rune, mode FmtMode) {
} }
// EscFmt is set by the escape analysis code to add escape analysis details to the node print. // EscFmt is set by the escape analysis code to add escape analysis details to the node print.
var EscFmt func(n Node, short bool) string var EscFmt func(n Node) string
// *Node details // *Node details
func jconvFmt(n Node, s fmt.State, flag FmtFlag) { func jconvFmt(n Node, s fmt.State, flag FmtFlag) {
short := flag&FmtShort != 0
// Useful to see which nodes in an AST printout are actually identical // Useful to see which nodes in an AST printout are actually identical
if base.Debug.DumpPtrs != 0 { if base.Debug.DumpPtrs != 0 {
fmt.Fprintf(s, " p(%p)", n) fmt.Fprintf(s, " p(%p)", n)
} }
if !short && n.Name() != nil && n.Name().Vargen != 0 { if n.Name() != nil && n.Name().Vargen != 0 {
fmt.Fprintf(s, " g(%d)", n.Name().Vargen) fmt.Fprintf(s, " g(%d)", n.Name().Vargen)
} }
if base.Debug.DumpPtrs != 0 && !short && n.Name() != nil && n.Name().Defn != nil { if base.Debug.DumpPtrs != 0 && n.Name() != nil && n.Name().Defn != nil {
// Useful to see where Defn is set and what node it points to // Useful to see where Defn is set and what node it points to
fmt.Fprintf(s, " defn(%p)", n.Name().Defn) fmt.Fprintf(s, " defn(%p)", n.Name().Defn)
} }
@ -369,7 +367,7 @@ func jconvFmt(n Node, s fmt.State, flag FmtFlag) {
fmt.Fprintf(s, " l(%s%d)", pfx, n.Pos().Line()) fmt.Fprintf(s, " l(%s%d)", pfx, n.Pos().Line())
} }
if !short && n.Offset() != types.BADWIDTH { if n.Offset() != types.BADWIDTH {
fmt.Fprintf(s, " x(%d)", n.Offset()) fmt.Fprintf(s, " x(%d)", n.Offset())
} }
@ -382,12 +380,12 @@ func jconvFmt(n Node, s fmt.State, flag FmtFlag) {
} }
if EscFmt != nil { if EscFmt != nil {
if esc := EscFmt(n, short); esc != "" { if esc := EscFmt(n); esc != "" {
fmt.Fprintf(s, " %s", esc) fmt.Fprintf(s, " %s", esc)
} }
} }
if !short && n.Typecheck() != 0 { if n.Typecheck() != 0 {
fmt.Fprintf(s, " tc(%d)", n.Typecheck()) fmt.Fprintf(s, " tc(%d)", n.Typecheck())
} }
@ -423,11 +421,11 @@ func jconvFmt(n Node, s fmt.State, flag FmtFlag) {
fmt.Fprint(s, " nonnil") fmt.Fprint(s, " nonnil")
} }
if !short && n.HasCall() { if n.HasCall() {
fmt.Fprint(s, " hascall") fmt.Fprint(s, " hascall")
} }
if !short && n.Name() != nil && n.Name().Used() { if n.Name() != nil && n.Name().Used() {
fmt.Fprint(s, " used") fmt.Fprint(s, " used")
} }
} }