Skip to content

Commit

Permalink
cmd/internal/obj/*: rename Rconv to rconv
Browse files Browse the repository at this point in the history
Each architecture's Rconv function is only used inside its
respective package, so it does not need to be exported.

Change-Id: Ifbd629964d7a9edd66501d7cdf4750621d66d646
Reviewed-on: https://go-review.googlesource.com/39110
Run-TryBot: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
  • Loading branch information
davecheney authored and bradfitz committed Apr 1, 2017
1 parent d96f9cb commit 78f6622
Show file tree
Hide file tree
Showing 8 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/arm/list5.go
Original file line number Diff line number Diff line change
Expand Up @@ -36,11 +36,11 @@ import (
)

func init() {
obj.RegisterRegister(obj.RBaseARM, MAXREG, Rconv)
obj.RegisterRegister(obj.RBaseARM, MAXREG, rconv)
obj.RegisterOpcode(obj.ABaseARM, Anames)
}

func Rconv(r int) string {
func rconv(r int) string {
if r == 0 {
return "NONE"
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/arm64/list7.go
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ var strcond = [16]string{
}

func init() {
obj.RegisterRegister(obj.RBaseARM64, REG_SPECIAL+1024, Rconv)
obj.RegisterRegister(obj.RBaseARM64, REG_SPECIAL+1024, rconv)
obj.RegisterOpcode(obj.ABaseARM64, Anames)
}

func Rconv(r int) string {
func rconv(r int) string {
if r == REGG {
return "g"
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/mips/list0.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import (
)

func init() {
obj.RegisterRegister(obj.RBaseMIPS, REG_LAST+1, Rconv)
obj.RegisterRegister(obj.RBaseMIPS, REG_LAST+1, rconv)
obj.RegisterOpcode(obj.ABaseMIPS, Anames)
}

func Rconv(r int) string {
func rconv(r int) string {
if r == 0 {
return "NONE"
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/ppc64/list9.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import (
)

func init() {
obj.RegisterRegister(obj.RBasePPC64, REG_DCR0+1024, Rconv)
obj.RegisterRegister(obj.RBasePPC64, REG_DCR0+1024, rconv)
obj.RegisterOpcode(obj.ABasePPC64, Anames)
}

func Rconv(r int) string {
func rconv(r int) string {
if r == 0 {
return "NONE"
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/s390x/listz.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,11 +35,11 @@ import (
)

func init() {
obj.RegisterRegister(obj.RBaseS390X, REG_R0+1024, Rconv)
obj.RegisterRegister(obj.RBaseS390X, REG_R0+1024, rconv)
obj.RegisterOpcode(obj.ABaseS390X, Anames)
}

func Rconv(r int) string {
func rconv(r int) string {
if r == 0 {
return "NONE"
}
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/x86/asm6.go
Original file line number Diff line number Diff line change
Expand Up @@ -3207,7 +3207,7 @@ func isax(a *obj.Addr) bool {

func subreg(p *obj.Prog, from int, to int) {
if false { /* debug['Q'] */
fmt.Printf("\n%v\ts/%v/%v/\n", p, Rconv(from), Rconv(to))
fmt.Printf("\n%v\ts/%v/%v/\n", p, rconv(from), rconv(to))
}

if int(p.From.Reg) == from {
Expand Down Expand Up @@ -4084,7 +4084,7 @@ func (asmbuf *AsmBuf) doasm(ctxt *obj.Link, cursym *obj.LSym, p *obj.Prog) {
r.Off = int32(p.Pc + int64(asmbuf.Len()))
r.Type = obj.R_CALL
r.Siz = 4
r.Sym = obj.Linklookup(ctxt, "__x86.get_pc_thunk."+strings.ToLower(Rconv(int(dst))), 0)
r.Sym = obj.Linklookup(ctxt, "__x86.get_pc_thunk."+strings.ToLower(rconv(int(dst))), 0)
asmbuf.PutInt32(0)

asmbuf.Put2(0x8B, byte(2<<6|reg[dst]|(reg[dst]<<3)))
Expand Down
4 changes: 2 additions & 2 deletions src/cmd/internal/obj/x86/list6.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,11 +168,11 @@ var Register = []string{
}

func init() {
obj.RegisterRegister(REG_AL, REG_AL+len(Register), Rconv)
obj.RegisterRegister(REG_AL, REG_AL+len(Register), rconv)
obj.RegisterOpcode(obj.ABaseAMD64, Anames)
}

func Rconv(r int) string {
func rconv(r int) string {
if REG_AL <= r && r-REG_AL < len(Register) {
return Register[r-REG_AL]
}
Expand Down
2 changes: 1 addition & 1 deletion src/cmd/internal/obj/x86/obj6.go
Original file line number Diff line number Diff line change
Expand Up @@ -542,7 +542,7 @@ func rewriteToPcrel(ctxt *obj.Link, p *obj.Prog) {
r := obj.Appendp(ctxt, q)
r.RegTo2 = 1
q.As = obj.ACALL
q.To.Sym = obj.Linklookup(ctxt, "__x86.get_pc_thunk."+strings.ToLower(Rconv(int(dst))), 0)
q.To.Sym = obj.Linklookup(ctxt, "__x86.get_pc_thunk."+strings.ToLower(rconv(int(dst))), 0)
q.To.Type = obj.TYPE_MEM
q.To.Name = obj.NAME_EXTERN
q.To.Sym.Set(obj.AttrLocal, true)
Expand Down

0 comments on commit 78f6622

Please sign in to comment.