diff options
author | Josh Bleecher Snyder <josharian@gmail.com> | 2017-04-20 07:13:02 -0700 |
---|---|---|
committer | Josh Bleecher Snyder <josharian@gmail.com> | 2017-04-20 21:56:23 +0000 |
commit | 405a280d01ee6434eea306e3f849ba0586cc8f78 (patch) | |
tree | 33242762270b6600e26e6b4b106d238718af1867 /src/cmd/compile/internal | |
parent | 950fa673a57ed2e55d1c992c7c34c6d251cb88fd (diff) | |
download | go-405a280d01ee6434eea306e3f849ba0586cc8f78.tar.gz go-405a280d01ee6434eea306e3f849ba0586cc8f78.zip |
cmd/internal/obj: eliminate LSym.Version
There were only two versions, 0 and 1,
and the only user of version 1 was the assembler,
to indicate that a symbol was static.
Rename LSym.Version to Static,
and add it to LSym.Attributes.
Simplify call-sites.
Passes toolstash-check.
Change-Id: Iabd39918f5019cce78f381d13f0481ae09f3871f
Reviewed-on: https://go-review.googlesource.com/41201
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal')
-rw-r--r-- | src/cmd/compile/internal/gc/obj.go | 4 | ||||
-rw-r--r-- | src/cmd/compile/internal/gc/pgen.go | 4 | ||||
-rw-r--r-- | src/cmd/compile/internal/gc/reflect.go | 12 | ||||
-rw-r--r-- | src/cmd/compile/internal/ssa/export_test.go | 2 |
4 files changed, 11 insertions, 11 deletions
diff --git a/src/cmd/compile/internal/gc/obj.go b/src/cmd/compile/internal/gc/obj.go index 419a6ec057..3ff5c6fa20 100644 --- a/src/cmd/compile/internal/gc/obj.go +++ b/src/cmd/compile/internal/gc/obj.go @@ -266,7 +266,7 @@ func Linksym(s *types.Sym) *obj.LSym { return nil } if s.Lsym == nil { - s.Lsym = Ctxt.Lookup(linksymname(s), 0) + s.Lsym = Ctxt.Lookup(linksymname(s)) } return s.Lsym } @@ -337,7 +337,7 @@ func stringsym(s string) (data *obj.LSym) { const prefix = "go.string." symdataname := prefix + symname - symdata := Ctxt.Lookup(symdataname, 0) + symdata := Ctxt.Lookup(symdataname) if !symdata.SeenGlobl() { // string data diff --git a/src/cmd/compile/internal/gc/pgen.go b/src/cmd/compile/internal/gc/pgen.go index 090cbe427a..6a3a345bf4 100644 --- a/src/cmd/compile/internal/gc/pgen.go +++ b/src/cmd/compile/internal/gc/pgen.go @@ -264,7 +264,7 @@ func debuginfo(fnsym *obj.LSym, curfn interface{}) []*dwarf.Var { gotype := Linksym(ngotype(n)) fnsym.Func.Autom = append(fnsym.Func.Autom, &obj.Auto{ - Asym: Ctxt.Lookup(n.Sym.Name, 0), + Asym: Ctxt.Lookup(n.Sym.Name), Aoffset: int32(n.Xoffset), Name: name, Gotype: gotype, @@ -279,7 +279,7 @@ func debuginfo(fnsym *obj.LSym, curfn interface{}) []*dwarf.Var { Name: n.Sym.Name, Abbrev: abbrev, Offset: int32(offs), - Type: Ctxt.Lookup(typename, 0), + Type: Ctxt.Lookup(typename), }) } diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go index 1703a9a67d..3f9bf40a95 100644 --- a/src/cmd/compile/internal/gc/reflect.go +++ b/src/cmd/compile/internal/gc/reflect.go @@ -447,7 +447,7 @@ func dimportpath(p *types.Pkg) { str = p.Path } - s := Ctxt.Lookup("type..importpath."+p.Prefix+".", 0) + s := Ctxt.Lookup("type..importpath." + p.Prefix + ".") ot := dnameData(s, 0, str, "", nil, false) ggloblLSym(s, int32(ot), obj.DUPOK|obj.RODATA) p.Pathsym = s @@ -468,7 +468,7 @@ func dgopkgpathLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { // type..importpath.""., which the linker will rewrite using the correct import path. // Every package that imports this one directly defines the symbol. // See also https://groups.google.com/forum/#!topic/golang-dev/myb9s53HxGQ. - ns := Ctxt.Lookup(`type..importpath."".`, 0) + ns := Ctxt.Lookup(`type..importpath."".`) return dsymptrLSym(s, ot, ns, 0) } @@ -487,7 +487,7 @@ func dgopkgpathOffLSym(s *obj.LSym, ot int, pkg *types.Pkg) int { // type..importpath.""., which the linker will rewrite using the correct import path. // Every package that imports this one directly defines the symbol. // See also https://groups.google.com/forum/#!topic/golang-dev/myb9s53HxGQ. - ns := Ctxt.Lookup(`type..importpath."".`, 0) + ns := Ctxt.Lookup(`type..importpath."".`) return dsymptrOffLSym(s, ot, ns, 0) } @@ -591,7 +591,7 @@ func dname(name, tag string, pkg *types.Pkg, exported bool) *obj.LSym { sname = fmt.Sprintf(`%s"".%d`, sname, dnameCount) dnameCount++ } - s := Ctxt.Lookup(sname, 0) + s := Ctxt.Lookup(sname) if len(s.P) > 0 { return s } @@ -1478,7 +1478,7 @@ func dumptypestructs() { // process ptabs if localpkg.Name == "main" && len(ptabs) > 0 { ot := 0 - s := Ctxt.Lookup("go.plugin.tabs", 0) + s := Ctxt.Lookup("go.plugin.tabs") for _, p := range ptabs { // Dump ptab symbol into go.pluginsym package. // @@ -1493,7 +1493,7 @@ func dumptypestructs() { ggloblLSym(s, int32(ot), int16(obj.RODATA)) ot = 0 - s = Ctxt.Lookup("go.plugin.exports", 0) + s = Ctxt.Lookup("go.plugin.exports") for _, p := range ptabs { ot = dsymptrLSym(s, ot, Linksym(p.s), 0) } diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index 1b18d74575..e2d8a2d69b 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -114,7 +114,7 @@ func (DummyFrontend) Line(_ src.XPos) string { func (DummyFrontend) AllocFrame(f *Func) { } func (d DummyFrontend) Syslook(s string) *obj.LSym { - return d.ctxt.Lookup(s, 0) + return d.ctxt.Lookup(s) } func (DummyFrontend) UseWriteBarrier() bool { return true // only writebarrier_test cares |