mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd: remove IntSize and Widthint
Use PtrSize and Widthptr instead. CL prepared mostly with sed and uniq. Passes toolstash-check -all. Fixes #19954. Change-Id: I09371bd7128672885cb8bc4e7f534ad56a88d755 Reviewed-on: https://go-review.googlesource.com/40506 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Martin Möhrmann <moehrmann@google.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
This commit is contained in:
parent
8a07469663
commit
c87520c598
16 changed files with 58 additions and 80 deletions
|
|
@ -17,9 +17,8 @@ import (
|
|||
// and shared across all compilations.
|
||||
type Config struct {
|
||||
arch string // "amd64", etc.
|
||||
IntSize int64 // 4 or 8
|
||||
PtrSize int64 // 4 or 8
|
||||
RegSize int64 // 4 or 8
|
||||
PtrSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.PtrSize
|
||||
RegSize int64 // 4 or 8; copy of cmd/internal/sys.Arch.RegSize
|
||||
Types Types
|
||||
lowerBlock blockRewriter // lowering function
|
||||
lowerValue valueRewriter // lowering function
|
||||
|
|
@ -143,7 +142,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c := &Config{arch: arch, Types: types}
|
||||
switch arch {
|
||||
case "amd64":
|
||||
c.IntSize = 8
|
||||
c.PtrSize = 8
|
||||
c.RegSize = 8
|
||||
c.lowerBlock = rewriteBlockAMD64
|
||||
|
|
@ -155,7 +153,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.LinkReg = linkRegAMD64
|
||||
c.hasGReg = false
|
||||
case "amd64p32":
|
||||
c.IntSize = 4
|
||||
c.PtrSize = 4
|
||||
c.RegSize = 8
|
||||
c.lowerBlock = rewriteBlockAMD64
|
||||
|
|
@ -168,7 +165,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.hasGReg = false
|
||||
c.noDuffDevice = true
|
||||
case "386":
|
||||
c.IntSize = 4
|
||||
c.PtrSize = 4
|
||||
c.RegSize = 4
|
||||
c.lowerBlock = rewriteBlock386
|
||||
|
|
@ -180,7 +176,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.LinkReg = linkReg386
|
||||
c.hasGReg = false
|
||||
case "arm":
|
||||
c.IntSize = 4
|
||||
c.PtrSize = 4
|
||||
c.RegSize = 4
|
||||
c.lowerBlock = rewriteBlockARM
|
||||
|
|
@ -192,7 +187,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.LinkReg = linkRegARM
|
||||
c.hasGReg = true
|
||||
case "arm64":
|
||||
c.IntSize = 8
|
||||
c.PtrSize = 8
|
||||
c.RegSize = 8
|
||||
c.lowerBlock = rewriteBlockARM64
|
||||
|
|
@ -208,7 +202,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.BigEndian = true
|
||||
fallthrough
|
||||
case "ppc64le":
|
||||
c.IntSize = 8
|
||||
c.PtrSize = 8
|
||||
c.RegSize = 8
|
||||
c.lowerBlock = rewriteBlockPPC64
|
||||
|
|
@ -224,7 +217,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.BigEndian = true
|
||||
fallthrough
|
||||
case "mips64le":
|
||||
c.IntSize = 8
|
||||
c.PtrSize = 8
|
||||
c.RegSize = 8
|
||||
c.lowerBlock = rewriteBlockMIPS64
|
||||
|
|
@ -237,7 +229,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.LinkReg = linkRegMIPS64
|
||||
c.hasGReg = true
|
||||
case "s390x":
|
||||
c.IntSize = 8
|
||||
c.PtrSize = 8
|
||||
c.RegSize = 8
|
||||
c.lowerBlock = rewriteBlockS390X
|
||||
|
|
@ -254,7 +245,6 @@ func NewConfig(arch string, types Types, ctxt *obj.Link, optimize bool) *Config
|
|||
c.BigEndian = true
|
||||
fallthrough
|
||||
case "mipsle":
|
||||
c.IntSize = 4
|
||||
c.PtrSize = 4
|
||||
c.RegSize = 4
|
||||
c.lowerBlock = rewriteBlockMIPS
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue