SSA generates ACALL assembly with the target in a *Sym.
The old compiler generates both that *Sym and a *Node.
Use the *Sym to print the live info so it works with both compilers.
Change-Id: I0b12a161f83e76638604358c21b9f5abb31ce950
Reviewed-on: https://go-review.googlesource.com/16432
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: David Chase <drchase@google.com>
"cmd/internal/obj"
"fmt"
"sort"
+ "strings"
)
const (
if msg != nil {
fmt_ = ""
fmt_ += fmt.Sprintf("%v: live at ", p.Line())
- if p.As == obj.ACALL && p.To.Node != nil {
- fmt_ += fmt.Sprintf("call to %s:", ((p.To.Node).(*Node)).Sym.Name)
+ if p.As == obj.ACALL && p.To.Sym != nil {
+ name := p.To.Sym.Name
+ i := strings.Index(name, ".")
+ if i >= 0 {
+ name = name[i+1:]
+ }
+ fmt_ += fmt.Sprintf("call to %s:", name)
} else if p.As == obj.ACALL {
fmt_ += "indirect call:"
} else {