cmd/compile: cleanup after IntSize->PtrSize conversion

Also, replace "PtrSize == 4 && Arch != amd64p32" with "RegSize == 4".

Passes toolstash-check -all.

Updates #19954.

Change-Id: I79b2ee9324f4fa53e34c9271d837ea288b5d7829
Reviewed-on: https://go-review.googlesource.com/41491
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
Matthew Dempsky 2017-04-21 19:16:15 -07:00
parent 06e5749f01
commit fe885fbdb0
5 changed files with 18 additions and 39 deletions

View file

@ -36,13 +36,12 @@ var basicTypes = [...]struct {
var typedefs = [...]struct {
name string
etype types.EType
width *int
sameas32 types.EType
sameas64 types.EType
}{
{"int", TINT, &Widthptr, TINT32, TINT64},
{"uint", TUINT, &Widthptr, TUINT32, TUINT64},
{"uintptr", TUINTPTR, &Widthptr, TUINT32, TUINT64},
{"int", TINT, TINT32, TINT64},
{"uint", TUINT, TUINT32, TUINT64},
{"uintptr", TUINTPTR, TUINT32, TUINT64},
}
var builtinFuncs = [...]struct {
@ -276,7 +275,6 @@ func typeinit() {
// binary
okfor[OADD] = okforadd[:]
okfor[OAND] = okforand[:]
okfor[OANDAND] = okforbool[:]
okfor[OANDNOT] = okforand[:]
@ -298,19 +296,16 @@ func typeinit() {
// unary
okfor[OCOM] = okforand[:]
okfor[OMINUS] = okforarith[:]
okfor[ONOT] = okforbool[:]
okfor[OPLUS] = okforarith[:]
// special
okfor[OCAP] = okforcap[:]
okfor[OLEN] = okforlen[:]
// comparison
iscmp[OLT] = true
iscmp[OGT] = true
iscmp[OGE] = true
iscmp[OLE] = true
@ -353,7 +348,6 @@ func typeinit() {
// simple aliases
simtype[TMAP] = types.Tptr
simtype[TCHAN] = types.Tptr
simtype[TFUNC] = types.Tptr
simtype[TUNSAFEPTR] = types.Tptr
@ -424,7 +418,7 @@ func lexinit1() {
s1 := builtinpkg.Lookup(s.name)
sameas := s.sameas32
if *s.width == 8 {
if Widthptr == 8 {
sameas = s.sameas64
}