cmd/compile: merge TPTR32 and TPTR64 as TPTR

Change-Id: I0490098a7235458c5aede1135426a9f19f8584a7
Reviewed-on: https://go-review.googlesource.com/c/76312
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
Matthew Dempsky 2017-11-06 14:50:30 -08:00
parent d397d4bffc
commit 62e5215a2a
19 changed files with 45 additions and 79 deletions

View file

@ -177,11 +177,8 @@ func typeinit() {
simtype[et] = et
}
types.Types[TPTR32] = types.New(TPTR32)
dowidth(types.Types[TPTR32])
types.Types[TPTR64] = types.New(TPTR64)
dowidth(types.Types[TPTR64])
types.Types[TPTR] = types.New(TPTR)
dowidth(types.Types[TPTR])
t := types.New(TUNSAFEPTR)
types.Types[TUNSAFEPTR] = t
@ -190,11 +187,6 @@ func typeinit() {
asNode(t.Sym.Def).Name = new(Name)
dowidth(types.Types[TUNSAFEPTR])
types.Tptr = TPTR32
if Widthptr == 8 {
types.Tptr = TPTR64
}
for et := TINT8; et <= TUINT64; et++ {
isInt[et] = true
}
@ -263,8 +255,7 @@ func typeinit() {
okforlen[TSLICE] = true
okforlen[TSTRING] = true
okforeq[TPTR32] = true
okforeq[TPTR64] = true
okforeq[TPTR] = true
okforeq[TUNSAFEPTR] = true
okforeq[TINTER] = true
okforeq[TCHAN] = true
@ -357,10 +348,10 @@ func typeinit() {
types.Types[TINTER] = types.New(TINTER)
// simple aliases
simtype[TMAP] = types.Tptr
simtype[TCHAN] = types.Tptr
simtype[TFUNC] = types.Tptr
simtype[TUNSAFEPTR] = types.Tptr
simtype[TMAP] = TPTR
simtype[TCHAN] = TPTR
simtype[TFUNC] = TPTR
simtype[TUNSAFEPTR] = TPTR
array_array = int(Rnd(0, int64(Widthptr)))
array_nel = int(Rnd(int64(array_array)+int64(Widthptr), int64(Widthptr)))