1
0
mirror of https://github.com/golang/go synced 2024-11-19 06:04:39 -07:00

cmd/internal/obj: unexport Link.Hash

A prior CL eliminated the last reference to Ctxt.Hash
from the compiler.

Change-Id: Ic97ff84ed1a14e0c93fb0e8ec0b2617c3397c0e8
Reviewed-on: https://go-review.googlesource.com/40699
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2017-04-14 06:44:30 -07:00
parent b3fb6b00ae
commit 9d4a84677b
4 changed files with 6 additions and 6 deletions

View File

@ -1135,7 +1135,7 @@ func livenessemit(lv *Liveness, argssym, livesym *obj.LSym) {
// so that they can be de-duplicated.
// This provides significant binary size savings.
// It is safe to rename these LSyms because
// they are tracked separately from ctxt.Hash.
// they are tracked separately from ctxt.hash.
argssym.Name = fmt.Sprintf("gclocals·%x", md5.Sum(argssym.P))
livesym.Name = fmt.Sprintf("gclocals·%x", md5.Sum(livesym.P))
}

View File

@ -12,7 +12,7 @@ import (
func TestLinkgetlineFromPos(t *testing.T) {
ctxt := new(Link)
ctxt.Hash = make(map[SymVer]*LSym)
ctxt.hash = make(map[SymVer]*LSym)
afile := src.NewFileBase("a.go", "a.go")
bfile := src.NewFileBase("b.go", "/foo/bar/b.go")

View File

@ -761,7 +761,7 @@ type Link struct {
Flag_optimize bool
Bso *bufio.Writer
Pathname string
Hash map[SymVer]*LSym
hash map[SymVer]*LSym
PosTable src.PosTable
InlTree InlTree // global inlining tree used by gc/inl.go
Imports []string

View File

@ -53,7 +53,7 @@ func WorkingDir() string {
func Linknew(arch *LinkArch) *Link {
ctxt := new(Link)
ctxt.Hash = make(map[SymVer]*LSym)
ctxt.hash = make(map[SymVer]*LSym)
ctxt.Arch = arch
ctxt.Pathname = WorkingDir()
@ -76,13 +76,13 @@ func (ctxt *Link) Lookup(name string, v int) *LSym {
// LookupInit looks up the symbol with name name and version v.
// If it does not exist, it creates it and passes it to initfn for one-time initialization.
func (ctxt *Link) LookupInit(name string, v int, init func(s *LSym)) *LSym {
s := ctxt.Hash[SymVer{name, v}]
s := ctxt.hash[SymVer{name, v}]
if s != nil {
return s
}
s = &LSym{Name: name, Version: int16(v)}
ctxt.Hash[SymVer{name, v}] = s
ctxt.hash[SymVer{name, v}] = s
if init != nil {
init(s)
}