cmd/link/internal: rename LSym to Symbol, and add a doc comment.

I'd also like to document some of its fields, but I don't know
what they are.

Change-Id: I87d341e255f785d351a8a73e645be668e02b2689
Reviewed-on: https://go-review.googlesource.com/27399
Reviewed-by: David Crawshaw <crawshaw@golang.org>
Run-TryBot: David Crawshaw <crawshaw@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
Michael Matloob 2016-08-19 11:35:54 -04:00
parent 0a2a64d85d
commit a072fc2e67
24 changed files with 291 additions and 289 deletions

View file

@ -119,7 +119,7 @@ func deadcode(ctxt *Link) {
}
// Remove dead text but keep file information (z symbols).
textp := make([]*LSym, 0, len(ctxt.Textp))
textp := make([]*Symbol, 0, len(ctxt.Textp))
for _, s := range ctxt.Textp {
if s.Attr.Reachable() {
textp = append(textp, s)
@ -154,11 +154,11 @@ var markextra = []string{
// the reflect.method struct: mtyp, ifn, and tfn.
type methodref struct {
m methodsig
src *LSym // receiver type symbol
src *Symbol // receiver type symbol
r [3]*Reloc // R_METHODOFF relocations to fields of runtime.method
}
func (m methodref) ifn() *LSym { return m.r[1].Sym }
func (m methodref) ifn() *Symbol { return m.r[1].Sym }
func (m methodref) isExported() bool {
for _, r := range m.m {
@ -170,7 +170,7 @@ func (m methodref) isExported() bool {
// deadcodepass holds state for the deadcode flood fill.
type deadcodepass struct {
ctxt *Link
markQueue []*LSym // symbols to flood fill in next pass
markQueue []*Symbol // symbols to flood fill in next pass
ifaceMethod map[methodsig]bool // methods declared in reached interfaces
markableMethods []methodref // methods of reached types
reflectMethod bool
@ -189,7 +189,7 @@ func (d *deadcodepass) cleanupReloc(r *Reloc) {
}
// mark appends a symbol to the mark queue for flood filling.
func (d *deadcodepass) mark(s, parent *LSym) {
func (d *deadcodepass) mark(s, parent *Symbol) {
if s == nil || s.Attr.Reachable() {
return
}