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

cmd/compile: remove AttrSeenGlobl (use AttrOnList instead)

Minor cleanup: remove the symbol attribute AttrSeenGlobal, since it is
redundant with the existing attribute AttrOnList (no need to have what
amounts to a separate flag for checking the same property).

Change-Id: Ia269b64de37c2bb4a2314bbecf3d2091c6d57424
Reviewed-on: https://go-review.googlesource.com/c/go/+/239477
Run-TryBot: Than McIntosh <thanm@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
This commit is contained in:
Than McIntosh 2020-06-23 08:46:36 -04:00
parent 933ca0cfdc
commit c2e73fb446
3 changed files with 1 additions and 8 deletions

View File

@ -352,7 +352,7 @@ func stringsym(pos src.XPos, s string) (data *obj.LSym) {
symdata := Ctxt.Lookup(symdataname) symdata := Ctxt.Lookup(symdataname)
if !symdata.SeenGlobl() { if !symdata.OnList() {
// string data // string data
off := dsname(symdata, 0, s, pos, "string") off := dsname(symdata, 0, s, pos, "string")
ggloblsym(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL) ggloblsym(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL)

View File

@ -480,7 +480,6 @@ const (
AttrWrapper AttrWrapper
AttrNeedCtxt AttrNeedCtxt
AttrNoFrame AttrNoFrame
AttrSeenGlobl
AttrOnList AttrOnList
AttrStatic AttrStatic
@ -537,7 +536,6 @@ func (a Attribute) MakeTypelink() bool { return a&AttrMakeTypelink != 0 }
func (a Attribute) CFunc() bool { return a&AttrCFunc != 0 } func (a Attribute) CFunc() bool { return a&AttrCFunc != 0 }
func (a Attribute) NoSplit() bool { return a&AttrNoSplit != 0 } func (a Attribute) NoSplit() bool { return a&AttrNoSplit != 0 }
func (a Attribute) Leaf() bool { return a&AttrLeaf != 0 } func (a Attribute) Leaf() bool { return a&AttrLeaf != 0 }
func (a Attribute) SeenGlobl() bool { return a&AttrSeenGlobl != 0 }
func (a Attribute) OnList() bool { return a&AttrOnList != 0 } func (a Attribute) OnList() bool { return a&AttrOnList != 0 }
func (a Attribute) ReflectMethod() bool { return a&AttrReflectMethod != 0 } func (a Attribute) ReflectMethod() bool { return a&AttrReflectMethod != 0 }
func (a Attribute) Local() bool { return a&AttrLocal != 0 } func (a Attribute) Local() bool { return a&AttrLocal != 0 }
@ -574,7 +572,6 @@ var textAttrStrings = [...]struct {
{bit: AttrCFunc, s: "CFUNC"}, {bit: AttrCFunc, s: "CFUNC"},
{bit: AttrNoSplit, s: "NOSPLIT"}, {bit: AttrNoSplit, s: "NOSPLIT"},
{bit: AttrLeaf, s: "LEAF"}, {bit: AttrLeaf, s: "LEAF"},
{bit: AttrSeenGlobl, s: ""},
{bit: AttrOnList, s: ""}, {bit: AttrOnList, s: ""},
{bit: AttrReflectMethod, s: "REFLECTMETHOD"}, {bit: AttrReflectMethod, s: "REFLECTMETHOD"},
{bit: AttrLocal, s: "LOCAL"}, {bit: AttrLocal, s: "LOCAL"},

View File

@ -145,10 +145,6 @@ func (ctxt *Link) InitTextSym(s *LSym, flag int) {
} }
func (ctxt *Link) Globl(s *LSym, size int64, flag int) { func (ctxt *Link) Globl(s *LSym, size int64, flag int) {
if s.SeenGlobl() {
fmt.Printf("duplicate %v\n", s)
}
s.Set(AttrSeenGlobl, true)
if s.OnList() { if s.OnList() {
ctxt.Diag("symbol %s listed multiple times", s.Name) ctxt.Diag("symbol %s listed multiple times", s.Name)
} }