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

cmd/internal/obj: remove LSym.Etext

Use a local variable instead.

Passes toolstash -cmp.

Change-Id: I9623a40ff0d568f11afd1279b6aaa1c33eda644c
Reviewed-on: https://go-review.googlesource.com/20730
Reviewed-by: Ian Lance Taylor <iant@golang.org>
This commit is contained in:
Josh Bleecher Snyder 2016-03-14 22:28:04 -07:00
parent dd2ba0c7a7
commit 31a9e50524
3 changed files with 6 additions and 7 deletions

View File

@ -337,7 +337,6 @@ type LSym struct {
Gotype *LSym
Autom *Auto
Text *Prog
Etext *Prog
Pcln *Pcln
P []byte
R []Reloc

View File

@ -131,6 +131,7 @@ func flushplist(ctxt *Link, freeProgs bool) {
// Ignore ctxt->plist boundaries. There are no guarantees there,
// and the assemblers just use one big list.
var curtext *LSym
var etext *Prog
var text []*LSym
for pl := ctxt.Plist; pl != nil; pl = pl.Link {
@ -228,7 +229,7 @@ func flushplist(ctxt *Link, freeProgs bool) {
}
s.Type = STEXT
s.Text = p
s.Etext = p
etext = p
curtext = s
continue
@ -247,11 +248,11 @@ func flushplist(ctxt *Link, freeProgs bool) {
}
if curtext == nil {
etext = nil
continue
}
s := curtext
s.Etext.Link = p
s.Etext = p
etext.Link = p
etext = p
}
}
@ -293,7 +294,6 @@ func flushplist(ctxt *Link, freeProgs bool) {
linkpcln(ctxt, s)
if freeProgs {
s.Text = nil
s.Etext = nil
}
}

View File

@ -23,7 +23,7 @@ func TestSizeof(t *testing.T) {
_64bit uintptr // size on 64bit platforms
}{
{Addr{}, 52, 80},
{LSym{}, 88, 152},
{LSym{}, 84, 144},
{Prog{}, 196, 288},
}