From e514021153f81c30b4a483079379c343916bcb0f Mon Sep 17 00:00:00 2001 From: Keith Randall Date: Wed, 28 Oct 2015 10:40:47 -0700 Subject: [PATCH] [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 Reviewed-by: David Chase --- src/cmd/compile/internal/gc/plive.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index 00ae807609..a09247b8a3 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -19,6 +19,7 @@ import ( "cmd/internal/obj" "fmt" "sort" + "strings" ) const ( @@ -1393,8 +1394,13 @@ func livenessepilogue(lv *Liveness) { 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 {