mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile: remove Pkglookup in favor of Lookup
Remove one of the many lookup variants. Change-Id: I4095aa030da4227540badd6724bbf50b728fbe93 Reviewed-on: https://go-review.googlesource.com/38990 Reviewed-by: Dave Cheney <dave@cheney.net>
This commit is contained in:
parent
f7027b4b2d
commit
ac99ade5a0
10 changed files with 49 additions and 53 deletions
|
|
@ -285,15 +285,11 @@ func (pkg *Pkg) LookupBytes(name []byte) *Sym {
|
|||
return pkg.Lookup(str)
|
||||
}
|
||||
|
||||
func Pkglookup(name string, pkg *Pkg) *Sym {
|
||||
return pkg.Lookup(name)
|
||||
}
|
||||
|
||||
func restrictlookup(name string, pkg *Pkg) *Sym {
|
||||
if !exportname(name) && pkg != localpkg {
|
||||
yyerror("cannot refer to unexported name %s.%s", pkg.Name, name)
|
||||
}
|
||||
return Pkglookup(name, pkg)
|
||||
return pkg.Lookup(name)
|
||||
}
|
||||
|
||||
// find all the exported symbols in package opkg
|
||||
|
|
@ -1116,7 +1112,7 @@ func (n *Node) labeledControl() *Node {
|
|||
}
|
||||
|
||||
func syslook(name string) *Node {
|
||||
s := Pkglookup(name, Runtimepkg)
|
||||
s := Runtimepkg.Lookup(name)
|
||||
if s == nil || s.Def == nil {
|
||||
Fatalf("syslook: can't find runtime.%s", name)
|
||||
}
|
||||
|
|
@ -1833,7 +1829,7 @@ func genwrapper(rcvr *Type, method *Field, newnam *Sym, iface int) {
|
|||
}
|
||||
|
||||
func hashmem(t *Type) *Node {
|
||||
sym := Pkglookup("memhash", Runtimepkg)
|
||||
sym := Runtimepkg.Lookup("memhash")
|
||||
|
||||
n := newname(sym)
|
||||
n.Class = PFUNC
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue