mirror of
https://github.com/golang/go
synced 2024-11-07 00:16:10 -07:00
[dev.link] cmd/link: restore -dumpdep in new deadcode pass
Change-Id: I2e52206a95c9463df5661664726a8b3bbf3ad1fc Reviewed-on: https://go-review.googlesource.com/c/go/+/204825 Reviewed-by: Than McIntosh <thanm@google.com>
This commit is contained in:
parent
36dbdbe9bd
commit
c6621d9241
@ -18,10 +18,6 @@ import (
|
||||
|
||||
var _ = fmt.Print
|
||||
|
||||
// TODO:
|
||||
// - Debug output:
|
||||
// Emit messages about which symbols are kept or deleted.
|
||||
|
||||
type workQueue []loader.Sym
|
||||
|
||||
// Implement container/heap.Interface.
|
||||
@ -205,6 +201,16 @@ func (d *deadcodePass2) mark(symIdx, parent loader.Sym) {
|
||||
if d.ctxt.Reachparent != nil {
|
||||
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)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user