From 5ffa275f3cab631483a1ce76a63fc4ede3d204e8 Mon Sep 17 00:00:00 2001 From: Matthew Dempsky Date: Tue, 1 Dec 2020 03:25:29 -0800 Subject: [dev.regabi] cmd/compile: first pass at abstracting Type Passes toolstash/buildall. [git-generate] cd src/cmd/compile/internal/ssa rf ' ex . ../ir ../gc { import "cmd/compile/internal/types" var t *types.Type t.Etype -> t.Kind() t.Sym -> t.GetSym() t.Orig -> t.Underlying() } ' cd ../types rf ' mv EType Kind mv IRNode Object mv Type.Etype Type.kind mv Type.Sym Type.sym mv Type.Orig Type.underlying mv Type.Cache Type.cache mv Type.GetSym Type.Sym mv Bytetype ByteType mv Runetype RuneType mv Errortype ErrorType ' cd ../gc sed -i 's/Bytetype/ByteType/; s/Runetype/RuneType/' mkbuiltin.go git codereview gofmt go install cmd/compile/internal/... go test cmd/compile -u || go test cmd/compile Change-Id: Ibecb2d7100d3318a49238eb4a78d70acb49eedca Reviewed-on: https://go-review.googlesource.com/c/go/+/274437 Run-TryBot: Matthew Dempsky Reviewed-by: Russ Cox Trust: Matthew Dempsky --- src/cmd/compile/internal/ssa/export_test.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/cmd/compile/internal/ssa/export_test.go') diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go index df83383308..5a81f76ceb 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -140,7 +140,7 @@ func init() { // so this test setup can share it. types.Tconv = func(t *types.Type, flag, mode int) string { - return t.Etype.String() + return t.Kind().String() } types.Sconv = func(s *types.Sym, flag, mode int) string { return "sym" @@ -149,13 +149,13 @@ func init() { fmt.Fprintf(s, "sym") } types.FormatType = func(t *types.Type, s fmt.State, verb rune, mode int) { - fmt.Fprintf(s, "%v", t.Etype) + fmt.Fprintf(s, "%v", t.Kind()) } types.Dowidth = func(t *types.Type) {} for _, typ := range [...]struct { width int64 - et types.EType + et types.Kind }{ {1, types.TINT8}, {1, types.TUINT8}, -- cgit v1.2.3-54-g00ecf