mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
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:
parent
d397d4bffc
commit
62e5215a2a
19 changed files with 45 additions and 79 deletions
|
|
@ -656,7 +656,7 @@ func typePkg(t *types.Type) *types.Pkg {
|
|||
tsym := t.Sym
|
||||
if tsym == nil {
|
||||
switch t.Etype {
|
||||
case TARRAY, TSLICE, TPTR32, TPTR64, TCHAN:
|
||||
case TARRAY, TSLICE, TPTR, TCHAN:
|
||||
if t.Elem() != nil {
|
||||
tsym = t.Elem().Sym
|
||||
}
|
||||
|
|
@ -714,8 +714,7 @@ var kinds = []int{
|
|||
TFLOAT64: objabi.KindFloat64,
|
||||
TBOOL: objabi.KindBool,
|
||||
TSTRING: objabi.KindString,
|
||||
TPTR32: objabi.KindPtr,
|
||||
TPTR64: objabi.KindPtr,
|
||||
TPTR: objabi.KindPtr,
|
||||
TSTRUCT: objabi.KindStruct,
|
||||
TINTER: objabi.KindInterface,
|
||||
TCHAN: objabi.KindChan,
|
||||
|
|
@ -736,8 +735,7 @@ func typeptrdata(t *types.Type) int64 {
|
|||
}
|
||||
|
||||
switch t.Etype {
|
||||
case TPTR32,
|
||||
TPTR64,
|
||||
case TPTR,
|
||||
TUNSAFEPTR,
|
||||
TFUNC,
|
||||
TCHAN,
|
||||
|
|
@ -1035,8 +1033,7 @@ func isreflexive(t *types.Type) bool {
|
|||
TINT64,
|
||||
TUINT64,
|
||||
TUINTPTR,
|
||||
TPTR32,
|
||||
TPTR64,
|
||||
TPTR,
|
||||
TUNSAFEPTR,
|
||||
TSTRING,
|
||||
TCHAN:
|
||||
|
|
@ -1071,7 +1068,7 @@ func isreflexive(t *types.Type) bool {
|
|||
func needkeyupdate(t *types.Type) bool {
|
||||
switch t.Etype {
|
||||
case TBOOL, TINT, TUINT, TINT8, TUINT8, TINT16, TUINT16, TINT32, TUINT32,
|
||||
TINT64, TUINT64, TUINTPTR, TPTR32, TPTR64, TUNSAFEPTR, TCHAN:
|
||||
TINT64, TUINT64, TUINTPTR, TPTR, TUNSAFEPTR, TCHAN:
|
||||
return false
|
||||
|
||||
case TFLOAT32, TFLOAT64, TCOMPLEX64, TCOMPLEX128, // floats and complex can be +0/-0
|
||||
|
|
@ -1279,7 +1276,7 @@ func dtypesym(t *types.Type) *obj.LSym {
|
|||
ot = duint8(lsym, ot, uint8(obj.Bool2int(needkeyupdate(t.Key()))))
|
||||
ot = dextratype(lsym, ot, t, 0)
|
||||
|
||||
case TPTR32, TPTR64:
|
||||
case TPTR:
|
||||
if t.Elem().Etype == TANY {
|
||||
// ../../../../runtime/type.go:/UnsafePointerType
|
||||
ot = dcommontype(lsym, t)
|
||||
|
|
@ -1356,7 +1353,7 @@ func dtypesym(t *types.Type) *obj.LSym {
|
|||
// functions must return the existing type structure rather
|
||||
// than creating a new one.
|
||||
switch t.Etype {
|
||||
case TPTR32, TPTR64, TARRAY, TCHAN, TFUNC, TMAP, TSLICE, TSTRUCT:
|
||||
case TPTR, TARRAY, TCHAN, TFUNC, TMAP, TSLICE, TSTRUCT:
|
||||
keep = true
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue