mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/link: use ctxt.{Lookup,ROLookup} in favour of function versions of same
Done with two eg templates:
package p
import (
"cmd/link/internal/ld"
)
func before(ctxt *ld.Link, name string, v int) *ld.Symbol {
return ld.Linklookup(ctxt, name, v)
}
func after(ctxt *ld.Link, name string, v int) *ld.Symbol {
return ctxt.Syms.Lookup(name, v)
}
package p
import (
"cmd/link/internal/ld"
)
func before(ctxt *ld.Link, name string, v int) *ld.Symbol {
return ld.Linkrlookup(ctxt, name, v)
}
func after(ctxt *ld.Link, name string, v int) *ld.Symbol {
return ctxt.Syms.ROLookup(name, v)
}
Change-Id: I00647dbf62294557bd24c29ad1f108fc786335f1
Reviewed-on: https://go-review.googlesource.com/29343
Run-TryBot: Michael Hudson-Doyle <michael.hudson@canonical.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
parent
d41a7f77c5
commit
324f6ab48c
21 changed files with 350 additions and 350 deletions
|
|
@ -59,8 +59,8 @@ func deadcode(ctxt *Link) {
|
|||
d.init()
|
||||
d.flood()
|
||||
|
||||
callSym := Linkrlookup(ctxt, "reflect.Value.Call", 0)
|
||||
methSym := Linkrlookup(ctxt, "reflect.Value.Method", 0)
|
||||
callSym := ctxt.Syms.ROLookup("reflect.Value.Call", 0)
|
||||
methSym := ctxt.Syms.ROLookup("reflect.Value.Method", 0)
|
||||
reflectSeen := false
|
||||
|
||||
if ctxt.DynlinkingGo() {
|
||||
|
|
@ -249,7 +249,7 @@ func (d *deadcodepass) init() {
|
|||
|
||||
// We don't keep the go.plugin.exports symbol,
|
||||
// but we do keep the symbols it refers to.
|
||||
exports := Linkrlookup(d.ctxt, "go.plugin.exports", 0)
|
||||
exports := d.ctxt.Syms.ROLookup("go.plugin.exports", 0)
|
||||
for _, r := range exports.R {
|
||||
d.mark(r.Sym, nil)
|
||||
}
|
||||
|
|
@ -263,7 +263,7 @@ func (d *deadcodepass) init() {
|
|||
}
|
||||
|
||||
for _, name := range names {
|
||||
d.mark(Linkrlookup(d.ctxt, name, 0), nil)
|
||||
d.mark(d.ctxt.Syms.ROLookup(name, 0), nil)
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue