Skip to content

Commit 09272ae

Browse files
committed
cmd/compile/internal/gc: rename Thearch to thearch
Prepared using gorename. Change-Id: Id55dac9ae5446a8bfeac06e7995b35f4c249eeca Reviewed-on: https://go-review.googlesource.com/38302 Run-TryBot: Matthew Dempsky <[email protected]> TryBot-Result: Gobot Gobot <[email protected]> Reviewed-by: Josh Bleecher Snyder <[email protected]>
1 parent 3e2f980 commit 09272ae

File tree

9 files changed

+36
-36
lines changed

9 files changed

+36
-36
lines changed

src/cmd/compile/internal/gc/align.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ func offmod(t *Type) {
2020
for _, f := range t.Fields().Slice() {
2121
f.Offset = int64(o)
2222
o += int32(Widthptr)
23-
if int64(o) >= Thearch.MAXWIDTH {
23+
if int64(o) >= thearch.MAXWIDTH {
2424
yyerror("interface too large")
2525
o = int32(Widthptr)
2626
}
@@ -74,7 +74,7 @@ func widstruct(errtype *Type, t *Type, o int64, flag int) int64 {
7474
lastzero = o
7575
}
7676
o += w
77-
maxwidth := Thearch.MAXWIDTH
77+
maxwidth := thearch.MAXWIDTH
7878
// On 32-bit systems, reflect tables impose an additional constraint
7979
// that each field start offset must fit in 31 bits.
8080
if maxwidth < 1<<32 {
@@ -258,7 +258,7 @@ func dowidth(t *Type) {
258258

259259
dowidth(t.Elem())
260260
if t.Elem().Width != 0 {
261-
cap := (uint64(Thearch.MAXWIDTH) - 1) / uint64(t.Elem().Width)
261+
cap := (uint64(thearch.MAXWIDTH) - 1) / uint64(t.Elem().Width)
262262
if uint64(t.NumElem()) > cap {
263263
yyerror("type %L larger than address space", t)
264264
}

src/cmd/compile/internal/gc/go.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -382,7 +382,7 @@ type Arch struct {
382382

383383
var pcloc int32
384384

385-
var Thearch Arch
385+
var thearch Arch
386386

387387
var (
388388
staticbytes,

src/cmd/compile/internal/gc/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -112,9 +112,9 @@ func Main(archInit func(*Arch)) {
112112

113113
defer hidePanic()
114114

115-
archInit(&Thearch)
115+
archInit(&thearch)
116116

117-
Ctxt = obj.Linknew(Thearch.LinkArch)
117+
Ctxt = obj.Linknew(thearch.LinkArch)
118118
Ctxt.DebugInfo = debuginfo
119119
Ctxt.DiagFunc = yyerror
120120
Ctxt.Bso = bufio.NewWriter(os.Stdout)
@@ -208,11 +208,11 @@ func Main(archInit func(*Arch)) {
208208
flag.BoolVar(&use_writebarrier, "wb", true, "enable write barrier")
209209
var flag_shared bool
210210
var flag_dynlink bool
211-
if supportsDynlink(Thearch.LinkArch.Arch) {
211+
if supportsDynlink(thearch.LinkArch.Arch) {
212212
flag.BoolVar(&flag_shared, "shared", false, "generate code that can be linked into a shared library")
213213
flag.BoolVar(&flag_dynlink, "dynlink", false, "support references to Go symbols defined in other shared libraries")
214214
}
215-
if Thearch.LinkArch.Family == sys.AMD64 {
215+
if thearch.LinkArch.Family == sys.AMD64 {
216216
flag.BoolVar(&flag_largemodel, "largemodel", false, "generate code that assumes a large memory model")
217217
}
218218
flag.StringVar(&cpuprofile, "cpuprofile", "", "write cpu profile to `file`")
@@ -336,9 +336,9 @@ func Main(archInit func(*Arch)) {
336336
Debug['l'] = 1 - Debug['l']
337337
}
338338

339-
Widthint = Thearch.LinkArch.IntSize
340-
Widthptr = Thearch.LinkArch.PtrSize
341-
Widthreg = Thearch.LinkArch.RegSize
339+
Widthint = thearch.LinkArch.IntSize
340+
Widthptr = thearch.LinkArch.PtrSize
341+
Widthreg = thearch.LinkArch.RegSize
342342

343343
initUniverse()
344344

src/cmd/compile/internal/gc/pgen.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -273,15 +273,15 @@ func (s *ssaExport) AllocFrame(f *ssa.Func) {
273273

274274
dowidth(n.Type)
275275
w := n.Type.Width
276-
if w >= Thearch.MAXWIDTH || w < 0 {
276+
if w >= thearch.MAXWIDTH || w < 0 {
277277
Fatalf("bad width")
278278
}
279279
Stksize += w
280280
Stksize = Rnd(Stksize, int64(n.Type.Align))
281281
if haspointers(n.Type) {
282282
stkptrsize = Stksize
283283
}
284-
if Thearch.LinkArch.InFamily(sys.MIPS, sys.MIPS64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) {
284+
if thearch.LinkArch.InFamily(sys.MIPS, sys.MIPS64, sys.ARM, sys.ARM64, sys.PPC64, sys.S390X) {
285285
Stksize = Rnd(Stksize, int64(Widthptr))
286286
}
287287
if Stksize >= 1<<31 {

src/cmd/compile/internal/gc/plive.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -508,7 +508,7 @@ func (lv *Liveness) progeffects(prog *obj.Prog) (uevar, varkill, avarinit []int3
508508
varkill = lv.cache.varkill[:0]
509509
avarinit = lv.cache.avarinit[:0]
510510

511-
info := Thearch.Proginfo(prog)
511+
info := thearch.Proginfo(prog)
512512

513513
if info.Flags&(LeftRead|LeftWrite|LeftAddr) != 0 {
514514
from := &prog.From

src/cmd/compile/internal/gc/sinit.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1226,7 +1226,7 @@ func stataddr(nam *Node, n *Node) bool {
12261226
}
12271227

12281228
// Check for overflow.
1229-
if n.Type.Width != 0 && Thearch.MAXWIDTH/n.Type.Width <= int64(l) {
1229+
if n.Type.Width != 0 && thearch.MAXWIDTH/n.Type.Width <= int64(l) {
12301230
break
12311231
}
12321232
nam.Xoffset += int64(l) * n.Type.Width

src/cmd/compile/internal/gc/ssa.go

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,9 @@ var ssaExp ssaExport
2323
var ssaCache *ssa.Cache
2424

2525
func initssaconfig() {
26-
ssaConfig = ssa.NewConfig(Thearch.LinkArch.Name, &ssaExp, Ctxt, Debug['N'] == 0)
27-
if Thearch.LinkArch.Name == "386" {
28-
ssaConfig.Set387(Thearch.Use387)
26+
ssaConfig = ssa.NewConfig(thearch.LinkArch.Name, &ssaExp, Ctxt, Debug['N'] == 0)
27+
if thearch.LinkArch.Name == "386" {
28+
ssaConfig.Set387(thearch.Use387)
2929
}
3030
ssaCache = new(ssa.Cache)
3131
}
@@ -1549,18 +1549,18 @@ func (s *state) expr(n *Node) *ssa.Value {
15491549

15501550
if ft.IsFloat() || tt.IsFloat() {
15511551
conv, ok := fpConvOpToSSA[twoTypes{s.concreteEtype(ft), s.concreteEtype(tt)}]
1552-
if s.config.IntSize == 4 && Thearch.LinkArch.Name != "amd64p32" && Thearch.LinkArch.Family != sys.MIPS {
1552+
if s.config.IntSize == 4 && thearch.LinkArch.Name != "amd64p32" && thearch.LinkArch.Family != sys.MIPS {
15531553
if conv1, ok1 := fpConvOpToSSA32[twoTypes{s.concreteEtype(ft), s.concreteEtype(tt)}]; ok1 {
15541554
conv = conv1
15551555
}
15561556
}
1557-
if Thearch.LinkArch.Name == "arm64" {
1557+
if thearch.LinkArch.Name == "arm64" {
15581558
if conv1, ok1 := uint64fpConvOpToSSA[twoTypes{s.concreteEtype(ft), s.concreteEtype(tt)}]; ok1 {
15591559
conv = conv1
15601560
}
15611561
}
15621562

1563-
if Thearch.LinkArch.Family == sys.MIPS {
1563+
if thearch.LinkArch.Family == sys.MIPS {
15641564
if ft.Size() == 4 && ft.IsInteger() && !ft.IsSigned() {
15651565
// tt is float32 or float64, and ft is also unsigned
15661566
if tt.Size() == 4 {
@@ -2850,7 +2850,7 @@ func findIntrinsic(sym *Sym) intrinsicBuilder {
28502850
return nil
28512851
}
28522852
fn := sym.Name
2853-
return intrinsics[intrinsicKey{Thearch.LinkArch.Arch, pkg, fn}]
2853+
return intrinsics[intrinsicKey{thearch.LinkArch.Arch, pkg, fn}]
28542854
}
28552855

28562856
func isIntrinsicCall(n *Node) bool {
@@ -3378,7 +3378,7 @@ func (s *state) rtcall(fn *obj.LSym, returns bool, results []*Type, args ...*ssa
33783378
off += size
33793379
}
33803380
off = Rnd(off, int64(Widthptr))
3381-
if Thearch.LinkArch.Name == "amd64p32" {
3381+
if thearch.LinkArch.Name == "amd64p32" {
33823382
// amd64p32 wants 8-byte alignment of the start of the return values.
33833383
off = Rnd(off, 8)
33843384
}
@@ -4226,7 +4226,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
42264226
blockProgs[pc] = f.Blocks[0]
42274227
}
42284228

4229-
if Thearch.Use387 {
4229+
if thearch.Use387 {
42304230
s.SSEto387 = map[int16]int16{}
42314231
}
42324232

@@ -4237,7 +4237,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
42374237
for i, b := range f.Blocks {
42384238
s.bstart[b.ID] = pc
42394239
// Emit values in block
4240-
Thearch.SSAMarkMoves(&s, b)
4240+
thearch.SSAMarkMoves(&s, b)
42414241
for _, v := range b.Values {
42424242
x := pc
42434243
s.SetPos(v.Pos)
@@ -4267,7 +4267,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
42674267

42684268
default:
42694269
// let the backend handle it
4270-
Thearch.SSAGenValue(&s, v)
4270+
thearch.SSAGenValue(&s, v)
42714271
}
42724272

42734273
if logProgs {
@@ -4287,7 +4287,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
42874287
}
42884288
x := pc
42894289
s.SetPos(b.Pos)
4290-
Thearch.SSAGenBlock(&s, b, next)
4290+
thearch.SSAGenBlock(&s, b, next)
42914291
if logProgs {
42924292
for ; x != pc; x = x.Link {
42934293
blockProgs[x] = b
@@ -4345,7 +4345,7 @@ func genssa(f *ssa.Func, ptxt *obj.Prog, gcargs, gclocals *Sym) {
43454345
liveness(Curfn, ptxt, gcargs, gclocals)
43464346

43474347
// Add frame prologue. Zero ambiguously live variables.
4348-
Thearch.Defframe(ptxt)
4348+
thearch.Defframe(ptxt)
43494349
if Debug['f'] != 0 {
43504350
frame(0)
43514351
}
@@ -4570,7 +4570,7 @@ func AddrAuto(a *obj.Addr, v *ssa.Value) {
45704570
a.Type = obj.TYPE_MEM
45714571
a.Node = n
45724572
a.Sym = Linksym(n.Sym)
4573-
a.Reg = int16(Thearch.REGSP)
4573+
a.Reg = int16(thearch.REGSP)
45744574
a.Offset = n.Xoffset + off
45754575
if n.Class == PPARAM || n.Class == PPARAMOUT {
45764576
a.Name = obj.NAME_PARAM
@@ -4587,7 +4587,7 @@ func (s *SSAGenState) AddrScratch(a *obj.Addr) {
45874587
a.Name = obj.NAME_AUTO
45884588
a.Node = s.ScratchFpMem
45894589
a.Sym = Linksym(s.ScratchFpMem.Sym)
4590-
a.Reg = int16(Thearch.REGSP)
4590+
a.Reg = int16(thearch.REGSP)
45914591
a.Offset = s.ScratchFpMem.Xoffset
45924592
}
45934593

@@ -4601,7 +4601,7 @@ func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog {
46014601
// insert an actual hardware NOP that will have the right line number.
46024602
// This is different from obj.ANOP, which is a virtual no-op
46034603
// that doesn't make it into the instruction stream.
4604-
Thearch.Ginsnop()
4604+
thearch.Ginsnop()
46054605
}
46064606

46074607
p := Prog(obj.ACALL)
@@ -4611,7 +4611,7 @@ func (s *SSAGenState) Call(v *ssa.Value) *obj.Prog {
46114611
p.To.Sym = sym
46124612
} else {
46134613
// TODO(mdempsky): Can these differences be eliminated?
4614-
switch Thearch.LinkArch.Family {
4614+
switch thearch.LinkArch.Family {
46154615
case sys.AMD64, sys.I386, sys.PPC64, sys.S390X:
46164616
p.To.Type = obj.TYPE_REG
46174617
case sys.ARM, sys.ARM64, sys.MIPS, sys.MIPS64:
@@ -4768,7 +4768,7 @@ func (e *ssaExport) SplitInt64(name ssa.LocalSlot) (ssa.LocalSlot, ssa.LocalSlot
47684768
return ssa.LocalSlot{N: h, Type: t, Off: 0}, ssa.LocalSlot{N: l, Type: Types[TUINT32], Off: 0}
47694769
}
47704770
// Return the two parts of the larger variable.
4771-
if Thearch.LinkArch.ByteOrder == binary.BigEndian {
4771+
if thearch.LinkArch.ByteOrder == binary.BigEndian {
47724772
return ssa.LocalSlot{N: n, Type: t, Off: name.Off}, ssa.LocalSlot{N: n, Type: Types[TUINT32], Off: name.Off + 4}
47734773
}
47744774
return ssa.LocalSlot{N: n, Type: t, Off: name.Off + 4}, ssa.LocalSlot{N: n, Type: Types[TUINT32], Off: name.Off}

src/cmd/compile/internal/gc/subr.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1766,7 +1766,7 @@ func genwrapper(rcvr *Type, method *Field, newnam *Sym, iface int) {
17661766
// the TOC to the appropriate value for that module. But if it returns
17671767
// directly to the wrapper's caller, nothing will reset it to the correct
17681768
// value for that function.
1769-
if !instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !isifacemethod(method.Type) && !(Thearch.LinkArch.Name == "ppc64le" && Ctxt.Flag_dynlink) {
1769+
if !instrumenting && rcvr.IsPtr() && methodrcvr.IsPtr() && method.Embedded != 0 && !isifacemethod(method.Type) && !(thearch.LinkArch.Name == "ppc64le" && Ctxt.Flag_dynlink) {
17701770
// generate tail call: adjust pointer receiver and jump to embedded method.
17711771
dot = dot.Left // skip final .M
17721772
// TODO(mdempsky): Remove dependency on dotlist.

src/cmd/compile/internal/gc/walk.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1009,7 +1009,7 @@ opswitch:
10091009
n = walkexpr(n, init)
10101010

10111011
case OCONV, OCONVNOP:
1012-
if Thearch.LinkArch.Family == sys.ARM || Thearch.LinkArch.Family == sys.MIPS {
1012+
if thearch.LinkArch.Family == sys.ARM || thearch.LinkArch.Family == sys.MIPS {
10131013
if n.Left.Type.IsFloat() {
10141014
if n.Type.Etype == TINT64 {
10151015
n = mkcall("float64toint64", n.Type, init, conv(n.Left, Types[TFLOAT64]))
@@ -1035,7 +1035,7 @@ opswitch:
10351035
}
10361036
}
10371037

1038-
if Thearch.LinkArch.Family == sys.I386 {
1038+
if thearch.LinkArch.Family == sys.I386 {
10391039
if n.Left.Type.IsFloat() {
10401040
if n.Type.Etype == TINT64 {
10411041
n = mkcall("float64toint64", n.Type, init, conv(n.Left, Types[TFLOAT64]))

0 commit comments

Comments
 (0)