Commit 9d4a8467 authored by Josh Bleecher Snyder's avatar Josh Bleecher Snyder

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: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
parent b3fb6b00
...@@ -1135,7 +1135,7 @@ func livenessemit(lv *Liveness, argssym, livesym *obj.LSym) { ...@@ -1135,7 +1135,7 @@ func livenessemit(lv *Liveness, argssym, livesym *obj.LSym) {
// so that they can be de-duplicated. // so that they can be de-duplicated.
// This provides significant binary size savings. // This provides significant binary size savings.
// It is safe to rename these LSyms because // 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)) argssym.Name = fmt.Sprintf("gclocals·%x", md5.Sum(argssym.P))
livesym.Name = fmt.Sprintf("gclocals·%x", md5.Sum(livesym.P)) livesym.Name = fmt.Sprintf("gclocals·%x", md5.Sum(livesym.P))
} }
......
...@@ -12,7 +12,7 @@ import ( ...@@ -12,7 +12,7 @@ import (
func TestLinkgetlineFromPos(t *testing.T) { func TestLinkgetlineFromPos(t *testing.T) {
ctxt := new(Link) ctxt := new(Link)
ctxt.Hash = make(map[SymVer]*LSym) ctxt.hash = make(map[SymVer]*LSym)
afile := src.NewFileBase("a.go", "a.go") afile := src.NewFileBase("a.go", "a.go")
bfile := src.NewFileBase("b.go", "/foo/bar/b.go") bfile := src.NewFileBase("b.go", "/foo/bar/b.go")
......
...@@ -761,7 +761,7 @@ type Link struct { ...@@ -761,7 +761,7 @@ type Link struct {
Flag_optimize bool Flag_optimize bool
Bso *bufio.Writer Bso *bufio.Writer
Pathname string Pathname string
Hash map[SymVer]*LSym hash map[SymVer]*LSym
PosTable src.PosTable PosTable src.PosTable
InlTree InlTree // global inlining tree used by gc/inl.go InlTree InlTree // global inlining tree used by gc/inl.go
Imports []string Imports []string
......
...@@ -53,7 +53,7 @@ func WorkingDir() string { ...@@ -53,7 +53,7 @@ func WorkingDir() string {
func Linknew(arch *LinkArch) *Link { func Linknew(arch *LinkArch) *Link {
ctxt := new(Link) ctxt := new(Link)
ctxt.Hash = make(map[SymVer]*LSym) ctxt.hash = make(map[SymVer]*LSym)
ctxt.Arch = arch ctxt.Arch = arch
ctxt.Pathname = WorkingDir() ctxt.Pathname = WorkingDir()
...@@ -76,13 +76,13 @@ func (ctxt *Link) Lookup(name string, v int) *LSym { ...@@ -76,13 +76,13 @@ func (ctxt *Link) Lookup(name string, v int) *LSym {
// LookupInit looks up the symbol with name name and version v. // 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. // 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 { 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 { if s != nil {
return s return s
} }
s = &LSym{Name: name, Version: int16(v)} s = &LSym{Name: name, Version: int16(v)}
ctxt.Hash[SymVer{name, v}] = s ctxt.hash[SymVer{name, v}] = s
if init != nil { if init != nil {
init(s) init(s)
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment