if n.Class() == ir.PAUTO && n.Offset() != 0 {
s.Fatalf("AUTO var with offset %v %d", n, n.Offset())
}
- loc := ssa.LocalSlot{N: n, Type: n.Type(), Off: 0}
+ loc := ssa.LocalSlot{N: n.Name(), Type: n.Type(), Off: 0}
values, ok := s.f.NamedValues[loc]
if !ok {
s.f.Names = append(s.f.Names, loc)
return data
}
-func (e *ssafn) Auto(pos src.XPos, t *types.Type) ir.Node {
- n := tempAt(pos, e.curfn, t) // Note: adds new auto to e.curfn.Func.Dcl list
- return n
+func (e *ssafn) Auto(pos src.XPos, t *types.Type) *ir.Name {
+ return tempAt(pos, e.curfn, t) // Note: adds new auto to e.curfn.Func.Dcl list
}
func (e *ssafn) SplitString(name ssa.LocalSlot) (ssa.LocalSlot, ssa.LocalSlot) {
// 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) ir.Node
+ Auto(src.XPos, *types.Type) *ir.Name
// Given the name for a compound type, returns the name we should use
// for the parts of that compound type.
for _, b := range f.Blocks {
for _, v := range b.Values {
if v.Op == OpVarDef || v.Op == OpVarKill {
- n := v.Aux.(ir.Node)
+ n := v.Aux.(*ir.Name)
if ir.IsSynthetic(n) {
continue
}
func (TestFrontend) StringData(s string) *obj.LSym {
return nil
}
-func (TestFrontend) Auto(pos src.XPos, t *types.Type) ir.Node {
+func (TestFrontend) Auto(pos src.XPos, t *types.Type) *ir.Name {
n := ir.NewNameAt(pos, &types.Sym{Name: "aFakeAuto"})
n.SetClass(ir.PAUTO)
return n
// { N: len, Type: int, Off: 0, SplitOf: parent, SplitOffset: 8}
// parent = &{N: s, Type: string}
type LocalSlot struct {
- N ir.Node // an ONAME *gc.Node representing a stack location.
+ N *ir.Name // an ONAME *ir.Name representing a stack location.
Type *types.Type // type of slot
Off int64 // offset of slot in N
}{
{Value{}, 72, 112},
{Block{}, 164, 304},
- {LocalSlot{}, 32, 48},
+ {LocalSlot{}, 28, 40},
{valState{}, 28, 40},
}
if v.Aux == nil {
f.Fatalf("%s has nil Aux\n", v.LongString())
}
- loc := LocalSlot{N: v.Aux.(ir.Node), Type: v.Type, Off: v.AuxInt}
+ loc := LocalSlot{N: v.Aux.(*ir.Name), Type: v.Type, Off: v.AuxInt}
if f.pass.debug > stackDebug {
fmt.Printf("stackalloc %s to %s\n", v, loc)
}