aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/mips
diff options
context:
space:
mode:
authorJosh Bleecher Snyder <josharian@gmail.com>2017-04-10 07:31:23 -0700
committerJosh Bleecher Snyder <josharian@gmail.com>2017-04-10 16:19:21 +0000
commit52b33965fdc91c88f6df3cb60ecb0b7289d3004f (patch)
tree6a1091840ecfe99c5c97ec1e5177046ba7a4f641 /src/cmd/internal/obj/mips
parentdcf643f1fd39f98baa4686c1b3baf5691e5773d3 (diff)
downloadgo-52b33965fdc91c88f6df3cb60ecb0b7289d3004f.tar.xz
cmd/internal/obj: rename some local variables not c
I plan to use c as a consistent local variable in this packages. Rename most variables named c, excepting only some simple functions in asm9.go. Changes prepared with gorename. Passes toolstash-check -all. Updates #15756 Change-Id: If79baac43fca68fad1076e1ff23ae87c2ba638e4 Reviewed-on: https://go-review.googlesource.com/40172 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Diffstat (limited to 'src/cmd/internal/obj/mips')
-rw-r--r--src/cmd/internal/obj/mips/asm0.go24
-rw-r--r--src/cmd/internal/obj/mips/obj0.go70
2 files changed, 47 insertions, 47 deletions
diff --git a/src/cmd/internal/obj/mips/asm0.go b/src/cmd/internal/obj/mips/asm0.go
index 8c4be669b7..03367ec48b 100644
--- a/src/cmd/internal/obj/mips/asm0.go
+++ b/src/cmd/internal/obj/mips/asm0.go
@@ -385,13 +385,13 @@ func span0(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
ctxt.Diag("mips ops not initialized, call mips.buildop first")
}
- c := int64(0)
- p.Pc = c
+ pc := int64(0)
+ p.Pc = pc
var m int
var o *Optab
for p = p.Link; p != nil; p = p.Link {
- p.Pc = c
+ p.Pc = pc
o = oplook(ctxt, p)
m = int(o.size)
if m == 0 {
@@ -401,10 +401,10 @@ func span0(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
continue
}
- c += int64(m)
+ pc += int64(m)
}
- cursym.Size = c
+ cursym.Size = pc
/*
* if any procedure is large enough to
@@ -418,14 +418,14 @@ func span0(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
var q *obj.Prog
for bflag != 0 {
bflag = 0
- c = 0
+ pc = 0
for p = cursym.Text.Link; p != nil; p = p.Link {
- p.Pc = c
+ p.Pc = pc
o = oplook(ctxt, p)
// very large conditional branches
if o.type_ == 6 && p.Pcond != nil {
- otxt = p.Pcond.Pc - c
+ otxt = p.Pcond.Pc - pc
if otxt < -(1<<17)+10 || otxt >= (1<<17)-10 {
q = newprog()
q.Link = p.Link
@@ -457,15 +457,15 @@ func span0(ctxt *obj.Link, cursym *obj.LSym, newprog obj.ProgAlloc) {
continue
}
- c += int64(m)
+ pc += int64(m)
}
- cursym.Size = c
+ cursym.Size = pc
}
if ctxt.Arch.Family == sys.MIPS64 {
- c += -c & (mips64FuncAlign - 1)
+ pc += -pc & (mips64FuncAlign - 1)
}
- cursym.Size = c
+ cursym.Size = pc
/*
* lay out the code, emitting code and data relocations.
diff --git a/src/cmd/internal/obj/mips/obj0.go b/src/cmd/internal/obj/mips/obj0.go
index 5ed5a7cf06..872271eae9 100644
--- a/src/cmd/internal/obj/mips/obj0.go
+++ b/src/cmd/internal/obj/mips/obj0.go
@@ -938,11 +938,11 @@ func markregused(ctxt *obj.Link, s *Sch) {
ad = 1
case AJAL:
- c := p.Reg
- if c == 0 {
- c = REGLINK
+ r := p.Reg
+ if r == 0 {
+ r = REGLINK
}
- s.set.ireg |= 1 << uint(c-REG_R0)
+ s.set.ireg |= 1 << uint(r-REG_R0)
ar = 1
ad = 1
@@ -1061,15 +1061,15 @@ func markregused(ctxt *obj.Link, s *Sch) {
/*
* flags based on 'to' field
*/
- c := int(p.To.Class)
- if c == 0 {
- c = aclass(ctxt, &p.To) + 1
- p.To.Class = int8(c)
+ cls := int(p.To.Class)
+ if cls == 0 {
+ cls = aclass(ctxt, &p.To) + 1
+ p.To.Class = int8(cls)
}
- c--
- switch c {
+ cls--
+ switch cls {
default:
- fmt.Printf("unknown class %d %v\n", c, p)
+ fmt.Printf("unknown class %d %v\n", cls, p)
case C_ZCON,
C_SCON,
@@ -1099,8 +1099,8 @@ func markregused(ctxt *obj.Link, s *Sch) {
case C_ZOREG,
C_SOREG,
C_LOREG:
- c = int(p.To.Reg)
- s.used.ireg |= 1 << uint(c-REG_R0)
+ cls = int(p.To.Reg)
+ s.used.ireg |= 1 << uint(cls-REG_R0)
if ad != 0 {
break
}
@@ -1108,10 +1108,10 @@ func markregused(ctxt *obj.Link, s *Sch) {
s.soffset = regoff(ctxt, &p.To)
m := uint32(ANYMEM)
- if c == REGSB {
+ if cls == REGSB {
m = E_MEMSB
}
- if c == REGSP {
+ if cls == REGSP {
m = E_MEMSP
}
@@ -1180,15 +1180,15 @@ func markregused(ctxt *obj.Link, s *Sch) {
/*
* flags based on 'from' field
*/
- c = int(p.From.Class)
- if c == 0 {
- c = aclass(ctxt, &p.From) + 1
- p.From.Class = int8(c)
+ cls = int(p.From.Class)
+ if cls == 0 {
+ cls = aclass(ctxt, &p.From) + 1
+ p.From.Class = int8(cls)
}
- c--
- switch c {
+ cls--
+ switch cls {
default:
- fmt.Printf("unknown class %d %v\n", c, p)
+ fmt.Printf("unknown class %d %v\n", cls, p)
case C_ZCON,
C_SCON,
@@ -1218,8 +1218,8 @@ func markregused(ctxt *obj.Link, s *Sch) {
case C_ZOREG,
C_SOREG,
C_LOREG:
- c = int(p.From.Reg)
- s.used.ireg |= 1 << uint(c-REG_R0)
+ cls = int(p.From.Reg)
+ s.used.ireg |= 1 << uint(cls-REG_R0)
if ld != 0 {
p.Mark |= LOAD
}
@@ -1227,10 +1227,10 @@ func markregused(ctxt *obj.Link, s *Sch) {
s.soffset = regoff(ctxt, &p.From)
m := uint32(ANYMEM)
- if c == REGSB {
+ if cls == REGSB {
m = E_MEMSB
}
- if c == REGSP {
+ if cls == REGSP {
m = E_MEMSP
}
@@ -1238,11 +1238,11 @@ func markregused(ctxt *obj.Link, s *Sch) {
case C_SACON,
C_LACON:
- c = int(p.From.Reg)
- if c == 0 {
- c = REGSP
+ cls = int(p.From.Reg)
+ if cls == 0 {
+ cls = REGSP
}
- s.used.ireg |= 1 << uint(c-REG_R0)
+ s.used.ireg |= 1 << uint(cls-REG_R0)
case C_SECON,
C_LECON:
@@ -1286,12 +1286,12 @@ func markregused(ctxt *obj.Link, s *Sch) {
s.used.cc |= E_MEMSB
}
- c = int(p.Reg)
- if c != 0 {
- if REG_F0 <= c && c <= REG_F31 {
- s.used.freg |= 1 << uint(c-REG_F0)
+ cls = int(p.Reg)
+ if cls != 0 {
+ if REG_F0 <= cls && cls <= REG_F31 {
+ s.used.freg |= 1 << uint(cls-REG_F0)
} else {
- s.used.ireg |= 1 << uint(c-REG_R0)
+ s.used.ireg |= 1 << uint(cls-REG_R0)
}
}
s.set.ireg &^= (1 << (REGZERO - REG_R0)) /* R0 can't be set */