Commit e8475c94 authored by Robert Griesemer's avatar Robert Griesemer

cmd/compile/internal/types: shorten struct type names

They are in the types package, no need to mention the Type suffix.

Change-Id: Ie4fe1e3c1793514145e33f9df373d715f63e1aad
Reviewed-on: https://go-review.googlesource.com/39911
Run-TryBot: Robert Griesemer <gri@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 5c850cc2
......@@ -58,7 +58,7 @@ func expandiface(t *types.Type) {
// Access fields directly to avoid recursively calling dowidth
// within Type.Fields().
t.Extra.(*types.InterType).Fields.Set(fields)
t.Extra.(*types.Interface).Fields.Set(fields)
}
func offmod(t *types.Type) {
......@@ -337,7 +337,7 @@ func dowidth(t *types.Type) {
w = widstruct(t1, t1.Recvs(), 0, 0)
w = widstruct(t1, t1.Params(), w, Widthreg)
w = widstruct(t1, t1.Results(), w, Widthreg)
t1.Extra.(*types.FuncType).Argwid = w
t1.Extra.(*types.Func).Argwid = w
if w%int64(Widthreg) != 0 {
Warn("bad type %v %d\n", t1, w)
}
......
......@@ -505,16 +505,16 @@ func (p *importer) typ() *types.Type {
t = p.newtyp(TARRAY)
bound := p.int64()
elem := p.typ()
t.Extra = &types.ArrayType{Elem: elem, Bound: bound}
t.Extra = &types.Array{Elem: elem, Bound: bound}
case sliceTag:
t = p.newtyp(TSLICE)
elem := p.typ()
t.Extra = types.SliceType{Elem: elem}
t.Extra = types.Slice{Elem: elem}
case dddTag:
t = p.newtyp(TDDDFIELD)
t.Extra = types.DDDFieldType{T: p.typ()}
t.Extra = types.DDDField{T: p.typ()}
case structTag:
t = p.newtyp(TSTRUCT)
......@@ -523,7 +523,7 @@ func (p *importer) typ() *types.Type {
case pointerTag:
t = p.newtyp(types.Tptr)
t.Extra = types.PtrType{Elem: p.typ()}
t.Extra = types.Ptr{Elem: p.typ()}
case signatureTag:
t = p.newtyp(TFUNC)
......
......@@ -24,18 +24,18 @@ func TestSizeof(t *testing.T) {
}{
{Sym{}, 60, 104},
{Type{}, 52, 88},
{MapType{}, 20, 40},
{ForwardType{}, 20, 32},
{FuncType{}, 28, 48},
{StructType{}, 12, 24},
{InterType{}, 4, 8},
{ChanType{}, 8, 16},
{ArrayType{}, 12, 16},
{DDDFieldType{}, 4, 8},
{FuncArgsType{}, 4, 8},
{ChanArgsType{}, 4, 8},
{PtrType{}, 4, 8},
{SliceType{}, 4, 8},
{Map{}, 20, 40},
{Forward{}, 20, 32},
{Func{}, 28, 48},
{Struct{}, 12, 24},
{Interface{}, 4, 8},
{Chan{}, 8, 16},
{Array{}, 12, 16},
{DDDField{}, 4, 8},
{FuncArgs{}, 4, 8},
{ChanArgs{}, 4, 8},
{Ptr{}, 4, 8},
{Slice{}, 4, 8},
}
for _, tt := range tests {
......
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment