mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[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>
This commit is contained in:
parent
84e2bd611f
commit
048debb224
16 changed files with 73 additions and 126 deletions
|
|
@ -5,6 +5,7 @@
|
|||
package ssa
|
||||
|
||||
import (
|
||||
"cmd/compile/internal/ir"
|
||||
"cmd/compile/internal/types"
|
||||
"cmd/internal/obj"
|
||||
"cmd/internal/objabi"
|
||||
|
|
@ -138,7 +139,7 @@ type Frontend interface {
|
|||
|
||||
// Auto returns a Node for an auto variable of the given type.
|
||||
// The SSA compiler uses this function to allocate space for spills.
|
||||
Auto(src.XPos, *types.Type) GCNode
|
||||
Auto(src.XPos, *types.Type) *ir.Node
|
||||
|
||||
// Given the name for a compound type, returns the name we should use
|
||||
// for the parts of that compound type.
|
||||
|
|
@ -178,24 +179,6 @@ type Frontend interface {
|
|||
MyImportPath() string
|
||||
}
|
||||
|
||||
// interface used to hold a *gc.Node (a stack variable).
|
||||
// We'd use *gc.Node directly but that would lead to an import cycle.
|
||||
type GCNode interface {
|
||||
Typ() *types.Type
|
||||
String() string
|
||||
IsSynthetic() bool
|
||||
IsAutoTmp() bool
|
||||
StorageClass() StorageClass
|
||||
}
|
||||
|
||||
type StorageClass uint8
|
||||
|
||||
const (
|
||||
ClassAuto StorageClass = iota // local stack variable
|
||||
ClassParam // argument
|
||||
ClassParamOut // return value
|
||||
)
|
||||
|
||||
const go116lateCallExpansion = true
|
||||
|
||||
// LateCallExpansionEnabledWithin returns true if late call expansion should be tested
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue