aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/export_test.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-11-17 21:47:56 -0500
committerRuss Cox <rsc@golang.org>2020-11-25 17:30:36 +0000
commit048debb2246d17ecd19ccfd603e8544d5e7946a0 (patch)
treebaed7610d5f186d2650d831d416573dc55fd80ae /src/cmd/compile/internal/ssa/export_test.go
parent84e2bd611f9b62ec3b581f8a0d932dc4252ceb67 (diff)
downloadgo-048debb2246d17ecd19ccfd603e8544d5e7946a0.tar.gz
go-048debb2246d17ecd19ccfd603e8544d5e7946a0.zip
[dev.regabi] cmd/compile: remove gc ↔ ssa cycle hacks
The cycle hacks existed because gc needed to import ssa which need to know about gc.Node. But now that's ir.Node, and there's no cycle anymore. Don't know how much it matters but LocalSlot is now one word shorter than before, because it holds a pointer instead of an interface for the *Node. That won't last long. Now that they're not necessary for interface satisfaction, IsSynthetic and IsAutoTmp can move to top-level ir functions. Change-Id: Ie511e93466cfa2b17d9a91afc4bd8d53fdb80453 Reviewed-on: https://go-review.googlesource.com/c/go/+/272931 Trust: Russ Cox <rsc@golang.org> Run-TryBot: Russ Cox <rsc@golang.org> TryBot-Result: Go Bot <gobot@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.go32
1 files changed, 5 insertions, 27 deletions
diff --git a/src/cmd/compile/internal/ssa/export_test.go b/src/cmd/compile/internal/ssa/export_test.go
index bfe94ff160..3d142a2272 100644
--- a/src/cmd/compile/internal/ssa/export_test.go
+++ b/src/cmd/compile/internal/ssa/export_test.go
@@ -5,6 +5,7 @@
package ssa
import (
+ "cmd/compile/internal/ir"
"cmd/compile/internal/types"
"cmd/internal/obj"
"cmd/internal/obj/arm64"
@@ -65,36 +66,13 @@ type TestFrontend struct {
ctxt *obj.Link
}
-type TestAuto struct {
- t *types.Type
- s string
-}
-
-func (d *TestAuto) Typ() *types.Type {
- return d.t
-}
-
-func (d *TestAuto) String() string {
- return d.s
-}
-
-func (d *TestAuto) StorageClass() StorageClass {
- return ClassAuto
-}
-
-func (d *TestAuto) IsSynthetic() bool {
- return false
-}
-
-func (d *TestAuto) IsAutoTmp() bool {
- return true
-}
-
func (TestFrontend) StringData(s string) *obj.LSym {
return nil
}
-func (TestFrontend) Auto(pos src.XPos, t *types.Type) GCNode {
- return &TestAuto{t: t, s: "aTestAuto"}
+func (TestFrontend) Auto(pos src.XPos, t *types.Type) *ir.Node {
+ n := ir.NewNameAt(pos, &types.Sym{Name: "aFakeAuto"})
+ n.SetClass(ir.PAUTO)
+ return n
}
func (d TestFrontend) SplitString(s LocalSlot) (LocalSlot, LocalSlot) {
return LocalSlot{N: s.N, Type: testTypes.BytePtr, Off: s.Off}, LocalSlot{N: s.N, Type: testTypes.Int, Off: s.Off + 8}