diff options
author | Russ Cox <rsc@golang.org> | 2020-12-05 15:20:51 -0500 |
---|---|---|
committer | Russ Cox <rsc@golang.org> | 2020-12-07 20:40:52 +0000 |
commit | fb17dfa43d1c8e08d08f380ea082195d1c4f89f4 (patch) | |
tree | 1566775970697cd8435d0beb7a0cfc1421a44a05 /src/cmd/compile/internal/ssa/export_test.go | |
parent | 3b25f3c1504cdc8f2263d68436df42042251b290 (diff) | |
download | go-fb17dfa43d1c8e08d08f380ea082195d1c4f89f4.tar.gz go-fb17dfa43d1c8e08d08f380ea082195d1c4f89f4.zip |
[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 <rsc@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/export_test.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/export_test.go | 15 |
1 files changed, 1 insertions, 14 deletions
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 { |