]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: remove AttrSeenGlobl (use AttrOnList instead)
authorThan McIntosh <thanm@google.com>
Tue, 23 Jun 2020 12:46:36 +0000 (08:46 -0400)
committerThan McIntosh <thanm@google.com>
Thu, 13 Aug 2020 12:08:56 +0000 (12:08 +0000)
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>
src/cmd/compile/internal/gc/obj.go
src/cmd/internal/obj/link.go
src/cmd/internal/obj/plist.go

index 0826b04e3390ef990d3110ade56537fb5a7073d9..af5037c5a8bdcacd43df87ba4831d59042937879 100644 (file)
@@ -352,7 +352,7 @@ func stringsym(pos src.XPos, s string) (data *obj.LSym) {
 
        symdata := Ctxt.Lookup(symdataname)
 
-       if !symdata.SeenGlobl() {
+       if !symdata.OnList() {
                // string data
                off := dsname(symdata, 0, s, pos, "string")
                ggloblsym(symdata, int32(off), obj.DUPOK|obj.RODATA|obj.LOCAL)
index dc47e51be912339aa2d92b6c94d5ab7d0fd29e20..311e5ae2e8ab9a06b71dbdcaaa865402b2a0ab66 100644 (file)
@@ -480,7 +480,6 @@ const (
        AttrWrapper
        AttrNeedCtxt
        AttrNoFrame
-       AttrSeenGlobl
        AttrOnList
        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) NoSplit() bool            { return a&AttrNoSplit != 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) ReflectMethod() bool      { return a&AttrReflectMethod != 0 }
 func (a Attribute) Local() bool              { return a&AttrLocal != 0 }
@@ -574,7 +572,6 @@ var textAttrStrings = [...]struct {
        {bit: AttrCFunc, s: "CFUNC"},
        {bit: AttrNoSplit, s: "NOSPLIT"},
        {bit: AttrLeaf, s: "LEAF"},
-       {bit: AttrSeenGlobl, s: ""},
        {bit: AttrOnList, s: ""},
        {bit: AttrReflectMethod, s: "REFLECTMETHOD"},
        {bit: AttrLocal, s: "LOCAL"},
index afe0ee4ee0c12431a623b39724e830891d555516..6e33f29959890b433b9c24555d3c361daeb0e07a 100644 (file)
@@ -145,10 +145,6 @@ func (ctxt *Link) InitTextSym(s *LSym, 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() {
                ctxt.Diag("symbol %s listed multiple times", s.Name)
        }