mirror of
https://github.com/golang/go.git
synced 2025-11-03 02:00:57 +00:00
cmd/compile/internal/gc: unexport more helper functions
After the removal of the old backend many types are no longer referenced outside internal/gc. Make these functions private so that tools like honnef.co/go/unused can spot when they become dead code. In doing so this CL identified several previously public helpers which are no longer used, so removes them. This should be the last of the public functions. Change-Id: I7e9c4e72f86f391b428b9dddb6f0d516529706c3 Reviewed-on: https://go-review.googlesource.com/29134 Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
896ac677b5
commit
d7012ca282
37 changed files with 713 additions and 720 deletions
|
|
@ -27,7 +27,7 @@ var renameinit_initgen int
|
|||
|
||||
func renameinit() *Sym {
|
||||
renameinit_initgen++
|
||||
return LookupN("init.", renameinit_initgen)
|
||||
return lookupN("init.", renameinit_initgen)
|
||||
}
|
||||
|
||||
// hand-craft the following initialization code
|
||||
|
|
@ -70,7 +70,7 @@ func anyinit(n []*Node) bool {
|
|||
}
|
||||
|
||||
// is there an explicit init function
|
||||
s := Lookup("init.1")
|
||||
s := lookup("init.1")
|
||||
|
||||
if s.Def != nil {
|
||||
return true
|
||||
|
|
@ -101,14 +101,14 @@ func fninit(n []*Node) {
|
|||
var r []*Node
|
||||
|
||||
// (1)
|
||||
gatevar := newname(Lookup("initdone·"))
|
||||
gatevar := newname(lookup("initdone·"))
|
||||
addvar(gatevar, Types[TUINT8], PEXTERN)
|
||||
|
||||
// (2)
|
||||
Maxarg = 0
|
||||
|
||||
fn := Nod(ODCLFUNC, nil, nil)
|
||||
initsym := Lookup("init")
|
||||
initsym := lookup("init")
|
||||
fn.Func.Nname = newname(initsym)
|
||||
fn.Func.Nname.Name.Defn = fn
|
||||
fn.Func.Nname.Name.Param.Ntype = Nod(OTFUNC, nil, nil)
|
||||
|
|
@ -153,7 +153,7 @@ func fninit(n []*Node) {
|
|||
// (8)
|
||||
// could check that it is fn of no args/returns
|
||||
for i := 1; ; i++ {
|
||||
s := LookupN("init.", i)
|
||||
s := lookupN("init.", i)
|
||||
if s.Def == nil {
|
||||
break
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue