aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/link/internal/ld/deadcode.go
diff options
context:
space:
mode:
authorDave Cheney <dave@cheney.net>2016-08-25 12:32:42 +1000
committerDave Cheney <dave@cheney.net>2016-08-25 03:34:06 +0000
commitd61c07ffd81b804cbd746ed1dc1e0d9c8b7fca49 (patch)
tree23045f09d88bd23c9e58eba9c4f2620d5e781317 /src/cmd/link/internal/ld/deadcode.go
parent5f94ff4c8702e05bdee32b4a5dc6f8c736adab38 (diff)
downloadgo-d61c07ffd81b804cbd746ed1dc1e0d9c8b7fca49.tar.xz
cmd/link/internal, cmd/internal/obj: introduce ctxt.Logf
Replace the various calls to Fprintf(ctxt.Bso, ...) with a helper, ctxt.Logf. This also addresses the various inconsistent flushing of ctxt.Bso. Because we have two Link structures, add Link.Logf in both places. Change-Id: I23093f9b9b3bf33089a0ffd7f815f92dcd1a1fa1 Reviewed-on: https://go-review.googlesource.com/27730 Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/link/internal/ld/deadcode.go')
-rw-r--r--src/cmd/link/internal/ld/deadcode.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/cmd/link/internal/ld/deadcode.go b/src/cmd/link/internal/ld/deadcode.go
index 43873a2abe..6fd5ee3cbb 100644
--- a/src/cmd/link/internal/ld/deadcode.go
+++ b/src/cmd/link/internal/ld/deadcode.go
@@ -46,7 +46,7 @@ import (
// Any unreached text symbols are removed from ctxt.Textp.
func deadcode(ctxt *Link) {
if ctxt.Debugvlog != 0 {
- fmt.Fprintf(ctxt.Bso, "%5.2f deadcode\n", obj.Cputime())
+ ctxt.Logf("%5.2f deadcode\n", obj.Cputime())
}
d := &deadcodepass{
@@ -181,7 +181,7 @@ func (d *deadcodepass) cleanupReloc(r *Reloc) {
r.Type = obj.R_ADDROFF
} else {
if d.ctxt.Debugvlog > 1 {
- fmt.Fprintf(d.ctxt.Bso, "removing method %s\n", r.Sym.Name)
+ d.ctxt.Logf("removing method %s\n", r.Sym.Name)
}
r.Sym = nil
r.Siz = 0
@@ -265,7 +265,7 @@ func (d *deadcodepass) flood() {
d.markQueue = d.markQueue[1:]
if s.Type == obj.STEXT {
if d.ctxt.Debugvlog > 1 {
- fmt.Fprintf(d.ctxt.Bso, "marktext %s\n", s.Name)
+ d.ctxt.Logf("marktext %s\n", s.Name)
}
if s.FuncInfo != nil {
for _, a := range s.FuncInfo.Autom {
@@ -279,7 +279,7 @@ func (d *deadcodepass) flood() {
if decodetypeKind(s)&kindMask == kindInterface {
for _, sig := range decodeIfaceMethods(d.ctxt.Arch, s) {
if d.ctxt.Debugvlog > 1 {
- fmt.Fprintf(d.ctxt.Bso, "reached iface method: %s\n", sig)
+ d.ctxt.Logf("reached iface method: %s\n", sig)
}
d.ifaceMethod[sig] = true
}