}
if c == 0 && n.Xoffset != BADWIDTH {
- fmt.Fprintf(s, " x(%d%+d)", n.Xoffset, stkdelta[n])
+ fmt.Fprintf(s, " x(%d)", n.Xoffset)
}
if n.Class != 0 {
}
if p.From.Name == obj.NAME_AUTO && p.From.Node != nil {
- p.From.Offset += stkdelta[p.From.Node.(*Node)]
+ p.From.Offset += p.From.Node.(*Node).Xoffset
}
if p.To.Name == obj.NAME_AUTO && p.To.Node != nil {
- p.To.Offset += stkdelta[p.To.Node.(*Node)]
+ p.To.Offset += p.To.Node.(*Node).Xoffset
}
lp = &p.Link
func (s byStackVar) Less(i, j int) bool { return cmpstackvarlt(s[i], s[j]) }
func (s byStackVar) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
-// stkdelta records the stack offset delta for a node
-// during the compaction of the stack frame to remove
-// unused stack slots.
-var stkdelta = map[*Node]int64{}
-
// TODO(lvd) find out where the PAUTO/OLITERAL nodes come from.
func allocauto(ptxt *obj.Prog) {
Stksize = 0
yyerror("stack frame too large (>2GB)")
}
- stkdelta[n] = -Stksize - n.Xoffset
+ n.Xoffset = -Stksize
}
Stksize = Rnd(Stksize, int64(Widthreg))
stkptrsize = Rnd(stkptrsize, int64(Widthreg))
fixautoused(ptxt)
-
- // The debug information needs accurate offsets on the symbols.
- for _, ln := range Curfn.Func.Dcl {
- if ln.Class != PAUTO || ln.Op != ONAME {
- continue
- }
- ln.Xoffset += stkdelta[ln]
- delete(stkdelta, ln)
- }
}
func compile(fn *Node) {
a.Name = obj.NAME_PARAM
a.Node = n
a.Sym = Linksym(n.Orig.Sym)
- a.Offset += n.Xoffset // TODO: why do I have to add this here? I don't for auto variables.
+ a.Offset += n.Xoffset
case *ssa.AutoSymbol:
n := sym.Node.(*Node)
a.Name = obj.NAME_AUTO
a.Node = n
a.Sym = Linksym(n.Sym)
+ // TODO: a.Offset += n.Xoffset once frame offsets for autos are computed during SSA
default:
v.Fatalf("aux in %s not implemented %#v", v, v.Aux)
}