Commit e5140211 authored by Keith Randall's avatar Keith Randall

[dev.ssa] cmd/compile: fix printing of live information

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: default avatarDavid Chase <drchase@google.com>
parent 18559e2d
...@@ -19,6 +19,7 @@ import ( ...@@ -19,6 +19,7 @@ import (
"cmd/internal/obj" "cmd/internal/obj"
"fmt" "fmt"
"sort" "sort"
"strings"
) )
const ( const (
...@@ -1393,8 +1394,13 @@ func livenessepilogue(lv *Liveness) { ...@@ -1393,8 +1394,13 @@ func livenessepilogue(lv *Liveness) {
if msg != nil { if msg != nil {
fmt_ = "" fmt_ = ""
fmt_ += fmt.Sprintf("%v: live at ", p.Line()) fmt_ += fmt.Sprintf("%v: live at ", p.Line())
if p.As == obj.ACALL && p.To.Node != nil { if p.As == obj.ACALL && p.To.Sym != nil {
fmt_ += fmt.Sprintf("call to %s:", ((p.To.Node).(*Node)).Sym.Name) 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 { } else if p.As == obj.ACALL {
fmt_ += "indirect call:" fmt_ += "indirect call:"
} else { } else {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment