From fb17dfa43d1c8e08d08f380ea082195d1c4f89f4 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Sat, 5 Dec 2020 15:20:51 -0500 Subject: [dev.regabi] cmd/compile: narrow interface between ir and types Narrow the interface between package ir and package types to make it easier to clean up the type formatting code all in one place. Also introduce ir.BlankSym for use by OrigSym, so that later OrigSym can move to package types without needing to reference a variable of type ir.Node. Passes buildall w/ toolstash -cmp. Change-Id: I39fa419a1c8fb3318203e31cacc8d06399deeff9 Reviewed-on: https://go-review.googlesource.com/c/go/+/275776 Trust: Russ Cox Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/ssa/export_test.go | 15 +-------------- 1 file changed, 1 insertion(+), 14 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 5a81f76ceb..cb3b9c0e2a 100644 --- a/src/cmd/compile/internal/ssa/export_test.go +++ b/src/cmd/compile/internal/ssa/export_test.go @@ -12,7 +12,6 @@ import ( "cmd/internal/obj/s390x" "cmd/internal/obj/x86" "cmd/internal/src" - "fmt" "testing" ) @@ -138,19 +137,7 @@ func init() { // Initialize just enough of the universe and the types package to make our tests function. // TODO(josharian): move universe initialization to the types package, // so this test setup can share it. - - types.Tconv = func(t *types.Type, flag, mode int) string { - return t.Kind().String() - } - types.Sconv = func(s *types.Sym, flag, mode int) string { - return "sym" - } - types.FormatSym = func(sym *types.Sym, s fmt.State, verb rune, mode int) { - fmt.Fprintf(s, "sym") - } - types.FormatType = func(t *types.Type, s fmt.State, verb rune, mode int) { - fmt.Fprintf(s, "%v", t.Kind()) - } + ir.InstallTypeFormats() types.Dowidth = func(t *types.Type) {} for _, typ := range [...]struct { -- cgit v1.2.3-54-g00ecf