Commit c6621d92 authored by Cherry Zhang's avatar Cherry Zhang

[dev.link] cmd/link: restore -dumpdep in new deadcode pass

Change-Id: I2e52206a95c9463df5661664726a8b3bbf3ad1fc
Reviewed-on: https://go-review.googlesource.com/c/go/+/204825Reviewed-by: default avatarThan McIntosh <thanm@google.com>
parent 36dbdbe9
...@@ -18,10 +18,6 @@ import ( ...@@ -18,10 +18,6 @@ import (
var _ = fmt.Print var _ = fmt.Print
// TODO:
// - Debug output:
// Emit messages about which symbols are kept or deleted.
type workQueue []loader.Sym type workQueue []loader.Sym
// Implement container/heap.Interface. // Implement container/heap.Interface.
...@@ -205,6 +201,16 @@ func (d *deadcodePass2) mark(symIdx, parent loader.Sym) { ...@@ -205,6 +201,16 @@ func (d *deadcodePass2) mark(symIdx, parent loader.Sym) {
if d.ctxt.Reachparent != nil { if d.ctxt.Reachparent != nil {
d.ldr.Reachparent[symIdx] = parent d.ldr.Reachparent[symIdx] = parent
} }
if *flagDumpDep {
to := d.ldr.SymName(symIdx)
if to != "" {
from := "_"
if parent != 0 {
from = d.ldr.SymName(parent)
}
fmt.Printf("%s -> %s\n", from, to)
}
}
} }
} }
......
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