mirror of https://github.com/golang/go.git
[dev.regabi] cmd/compile: replace many uses of ir.Node with *ir.Name
This commit adds exactly two "n := n.(*ir.Name)" statements, that are each immediately preceded by a "case ir.ONAME:" clause in an n.Op() switch. The rest of the changes are simply replacing "ir.Node" to "*ir.Name" and removing now unnecessary "n.(*ir.Name)" type assertions, exposing the latent typing details. Passes buildall w/ toolstash -cmp. Updates #42982. Change-Id: I8ea3bbb7ddf0c7192245cafa49a19c0e7a556a39 Reviewed-on: https://go-review.googlesource.com/c/go/+/275791 Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Trust: Matthew Dempsky <mdempsky@google.com> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Russ Cox <rsc@golang.org>
This commit is contained in:
parent
bb31c75343
commit
dbf2fc8cff
|
|
@ -205,7 +205,7 @@ func caninl(fn *ir.Func) {
|
||||||
visitor := hairyVisitor{
|
visitor := hairyVisitor{
|
||||||
budget: inlineMaxBudget,
|
budget: inlineMaxBudget,
|
||||||
extraCallCost: cc,
|
extraCallCost: cc,
|
||||||
usedLocals: make(map[ir.Node]bool),
|
usedLocals: make(map[*ir.Name]bool),
|
||||||
}
|
}
|
||||||
if visitor.tooHairy(fn) {
|
if visitor.tooHairy(fn) {
|
||||||
reason = visitor.reason
|
reason = visitor.reason
|
||||||
|
|
@ -292,7 +292,7 @@ type hairyVisitor struct {
|
||||||
budget int32
|
budget int32
|
||||||
reason string
|
reason string
|
||||||
extraCallCost int32
|
extraCallCost int32
|
||||||
usedLocals map[ir.Node]bool
|
usedLocals map[*ir.Name]bool
|
||||||
do func(ir.Node) error
|
do func(ir.Node) error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -431,6 +431,7 @@ func (v *hairyVisitor) doNode(n ir.Node) error {
|
||||||
}
|
}
|
||||||
|
|
||||||
case ir.ONAME:
|
case ir.ONAME:
|
||||||
|
n := n.(*ir.Name)
|
||||||
if n.Class() == ir.PAUTO {
|
if n.Class() == ir.PAUTO {
|
||||||
v.usedLocals[n] = true
|
v.usedLocals[n] = true
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -63,7 +63,7 @@ func order(fn *ir.Func) {
|
||||||
// newTemp allocates a new temporary with the given type,
|
// newTemp allocates a new temporary with the given type,
|
||||||
// pushes it onto the temp stack, and returns it.
|
// pushes it onto the temp stack, and returns it.
|
||||||
// If clear is true, newTemp emits code to zero the temporary.
|
// If clear is true, newTemp emits code to zero the temporary.
|
||||||
func (o *Order) newTemp(t *types.Type, clear bool) ir.Node {
|
func (o *Order) newTemp(t *types.Type, clear bool) *ir.Name {
|
||||||
var v *ir.Name
|
var v *ir.Name
|
||||||
// Note: LongString is close to the type equality we want,
|
// Note: LongString is close to the type equality we want,
|
||||||
// but not exactly. We still need to double-check with types.Identical.
|
// but not exactly. We still need to double-check with types.Identical.
|
||||||
|
|
@ -107,11 +107,11 @@ func (o *Order) copyExpr(n ir.Node) ir.Node {
|
||||||
// (The other candidate would be map access, but map access
|
// (The other candidate would be map access, but map access
|
||||||
// returns a pointer to the result data instead of taking a pointer
|
// returns a pointer to the result data instead of taking a pointer
|
||||||
// to be filled in.)
|
// to be filled in.)
|
||||||
func (o *Order) copyExprClear(n ir.Node) ir.Node {
|
func (o *Order) copyExprClear(n ir.Node) *ir.Name {
|
||||||
return o.copyExpr1(n, true)
|
return o.copyExpr1(n, true)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (o *Order) copyExpr1(n ir.Node, clear bool) ir.Node {
|
func (o *Order) copyExpr1(n ir.Node, clear bool) *ir.Name {
|
||||||
t := n.Type()
|
t := n.Type()
|
||||||
v := o.newTemp(t, clear)
|
v := o.newTemp(t, clear)
|
||||||
a := ir.Nod(ir.OAS, v, n)
|
a := ir.Nod(ir.OAS, v, n)
|
||||||
|
|
|
||||||
|
|
@ -438,7 +438,7 @@ func debuginfo(fnsym *obj.LSym, infosym *obj.LSym, curfn interface{}) ([]dwarf.S
|
||||||
// which used to use the ONAME form.
|
// which used to use the ONAME form.
|
||||||
isODCLFUNC := infosym.Name == ""
|
isODCLFUNC := infosym.Name == ""
|
||||||
|
|
||||||
var apdecls []ir.Node
|
var apdecls []*ir.Name
|
||||||
// Populate decls for fn.
|
// Populate decls for fn.
|
||||||
if isODCLFUNC {
|
if isODCLFUNC {
|
||||||
for _, n := range fn.Dcl {
|
for _, n := range fn.Dcl {
|
||||||
|
|
@ -495,7 +495,7 @@ func debuginfo(fnsym *obj.LSym, infosym *obj.LSym, curfn interface{}) ([]dwarf.S
|
||||||
return scopes, inlcalls
|
return scopes, inlcalls
|
||||||
}
|
}
|
||||||
|
|
||||||
func declPos(decl ir.Node) src.XPos {
|
func declPos(decl *ir.Name) src.XPos {
|
||||||
if decl.Name().Defn != nil && (decl.Name().Captured() || decl.Name().Byval()) {
|
if decl.Name().Defn != nil && (decl.Name().Captured() || decl.Name().Byval()) {
|
||||||
// It's not clear which position is correct for captured variables here:
|
// It's not clear which position is correct for captured variables here:
|
||||||
// * decl.Pos is the wrong position for captured variables, in the inner
|
// * decl.Pos is the wrong position for captured variables, in the inner
|
||||||
|
|
@ -518,10 +518,10 @@ func declPos(decl ir.Node) src.XPos {
|
||||||
|
|
||||||
// createSimpleVars creates a DWARF entry for every variable declared in the
|
// createSimpleVars creates a DWARF entry for every variable declared in the
|
||||||
// function, claiming that they are permanently on the stack.
|
// function, claiming that they are permanently on the stack.
|
||||||
func createSimpleVars(fnsym *obj.LSym, apDecls []ir.Node) ([]ir.Node, []*dwarf.Var, map[ir.Node]bool) {
|
func createSimpleVars(fnsym *obj.LSym, apDecls []*ir.Name) ([]*ir.Name, []*dwarf.Var, map[*ir.Name]bool) {
|
||||||
var vars []*dwarf.Var
|
var vars []*dwarf.Var
|
||||||
var decls []ir.Node
|
var decls []*ir.Name
|
||||||
selected := make(map[ir.Node]bool)
|
selected := make(map[*ir.Name]bool)
|
||||||
for _, n := range apDecls {
|
for _, n := range apDecls {
|
||||||
if ir.IsAutoTmp(n) {
|
if ir.IsAutoTmp(n) {
|
||||||
continue
|
continue
|
||||||
|
|
@ -534,7 +534,7 @@ func createSimpleVars(fnsym *obj.LSym, apDecls []ir.Node) ([]ir.Node, []*dwarf.V
|
||||||
return decls, vars, selected
|
return decls, vars, selected
|
||||||
}
|
}
|
||||||
|
|
||||||
func createSimpleVar(fnsym *obj.LSym, n ir.Node) *dwarf.Var {
|
func createSimpleVar(fnsym *obj.LSym, n *ir.Name) *dwarf.Var {
|
||||||
var abbrev int
|
var abbrev int
|
||||||
offs := n.Offset()
|
offs := n.Offset()
|
||||||
|
|
||||||
|
|
@ -585,13 +585,13 @@ func createSimpleVar(fnsym *obj.LSym, n ir.Node) *dwarf.Var {
|
||||||
|
|
||||||
// createComplexVars creates recomposed DWARF vars with location lists,
|
// createComplexVars creates recomposed DWARF vars with location lists,
|
||||||
// suitable for describing optimized code.
|
// suitable for describing optimized code.
|
||||||
func createComplexVars(fnsym *obj.LSym, fn *ir.Func) ([]ir.Node, []*dwarf.Var, map[ir.Node]bool) {
|
func createComplexVars(fnsym *obj.LSym, fn *ir.Func) ([]*ir.Name, []*dwarf.Var, map[*ir.Name]bool) {
|
||||||
debugInfo := fn.DebugInfo.(*ssa.FuncDebug)
|
debugInfo := fn.DebugInfo.(*ssa.FuncDebug)
|
||||||
|
|
||||||
// Produce a DWARF variable entry for each user variable.
|
// Produce a DWARF variable entry for each user variable.
|
||||||
var decls []ir.Node
|
var decls []*ir.Name
|
||||||
var vars []*dwarf.Var
|
var vars []*dwarf.Var
|
||||||
ssaVars := make(map[ir.Node]bool)
|
ssaVars := make(map[*ir.Name]bool)
|
||||||
|
|
||||||
for varID, dvar := range debugInfo.Vars {
|
for varID, dvar := range debugInfo.Vars {
|
||||||
n := dvar
|
n := dvar
|
||||||
|
|
@ -611,11 +611,11 @@ func createComplexVars(fnsym *obj.LSym, fn *ir.Func) ([]ir.Node, []*dwarf.Var, m
|
||||||
|
|
||||||
// createDwarfVars process fn, returning a list of DWARF variables and the
|
// createDwarfVars process fn, returning a list of DWARF variables and the
|
||||||
// Nodes they represent.
|
// Nodes they represent.
|
||||||
func createDwarfVars(fnsym *obj.LSym, complexOK bool, fn *ir.Func, apDecls []ir.Node) ([]ir.Node, []*dwarf.Var) {
|
func createDwarfVars(fnsym *obj.LSym, complexOK bool, fn *ir.Func, apDecls []*ir.Name) ([]*ir.Name, []*dwarf.Var) {
|
||||||
// Collect a raw list of DWARF vars.
|
// Collect a raw list of DWARF vars.
|
||||||
var vars []*dwarf.Var
|
var vars []*dwarf.Var
|
||||||
var decls []ir.Node
|
var decls []*ir.Name
|
||||||
var selected map[ir.Node]bool
|
var selected map[*ir.Name]bool
|
||||||
if base.Ctxt.Flag_locationlists && base.Ctxt.Flag_optimize && fn.DebugInfo != nil && complexOK {
|
if base.Ctxt.Flag_locationlists && base.Ctxt.Flag_optimize && fn.DebugInfo != nil && complexOK {
|
||||||
decls, vars, selected = createComplexVars(fnsym, fn)
|
decls, vars, selected = createComplexVars(fnsym, fn)
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -714,9 +714,9 @@ func createDwarfVars(fnsym *obj.LSym, complexOK bool, fn *ir.Func, apDecls []ir.
|
||||||
// function that is not local to the package being compiled, then the
|
// function that is not local to the package being compiled, then the
|
||||||
// names of the variables may have been "versioned" to avoid conflicts
|
// names of the variables may have been "versioned" to avoid conflicts
|
||||||
// with local vars; disregard this versioning when sorting.
|
// with local vars; disregard this versioning when sorting.
|
||||||
func preInliningDcls(fnsym *obj.LSym) []ir.Node {
|
func preInliningDcls(fnsym *obj.LSym) []*ir.Name {
|
||||||
fn := base.Ctxt.DwFixups.GetPrecursorFunc(fnsym).(*ir.Func)
|
fn := base.Ctxt.DwFixups.GetPrecursorFunc(fnsym).(*ir.Func)
|
||||||
var rdcl []ir.Node
|
var rdcl []*ir.Name
|
||||||
for _, n := range fn.Inl.Dcl {
|
for _, n := range fn.Inl.Dcl {
|
||||||
c := n.Sym().Name[0]
|
c := n.Sym().Name[0]
|
||||||
// Avoid reporting "_" parameters, since if there are more than
|
// Avoid reporting "_" parameters, since if there are more than
|
||||||
|
|
|
||||||
|
|
@ -410,7 +410,7 @@ func buildssa(fn *ir.Func, worker int) *ssa.Func {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Generate addresses of local declarations
|
// Generate addresses of local declarations
|
||||||
s.decladdrs = map[ir.Node]*ssa.Value{}
|
s.decladdrs = map[*ir.Name]*ssa.Value{}
|
||||||
var args []ssa.Param
|
var args []ssa.Param
|
||||||
var results []ssa.Param
|
var results []ssa.Param
|
||||||
for _, n := range fn.Dcl {
|
for _, n := range fn.Dcl {
|
||||||
|
|
@ -576,7 +576,7 @@ type openDeferInfo struct {
|
||||||
// function call are stored.
|
// function call are stored.
|
||||||
argVals []*ssa.Value
|
argVals []*ssa.Value
|
||||||
// The nodes representing the argtmps where the args of the defer are stored
|
// The nodes representing the argtmps where the args of the defer are stored
|
||||||
argNodes []ir.Node
|
argNodes []*ir.Name
|
||||||
}
|
}
|
||||||
|
|
||||||
type state struct {
|
type state struct {
|
||||||
|
|
@ -613,7 +613,7 @@ type state struct {
|
||||||
defvars []map[ir.Node]*ssa.Value
|
defvars []map[ir.Node]*ssa.Value
|
||||||
|
|
||||||
// addresses of PPARAM and PPARAMOUT variables.
|
// addresses of PPARAM and PPARAMOUT variables.
|
||||||
decladdrs map[ir.Node]*ssa.Value
|
decladdrs map[*ir.Name]*ssa.Value
|
||||||
|
|
||||||
// starting values. Memory, stack pointer, and globals pointer
|
// starting values. Memory, stack pointer, and globals pointer
|
||||||
startmem *ssa.Value
|
startmem *ssa.Value
|
||||||
|
|
@ -633,7 +633,7 @@ type state struct {
|
||||||
panics map[funcLine]*ssa.Block
|
panics map[funcLine]*ssa.Block
|
||||||
|
|
||||||
// list of PPARAMOUT (return) variables.
|
// list of PPARAMOUT (return) variables.
|
||||||
returns []ir.Node
|
returns []*ir.Name
|
||||||
|
|
||||||
cgoUnsafeArgs bool
|
cgoUnsafeArgs bool
|
||||||
hasdefer bool // whether the function contains a defer statement
|
hasdefer bool // whether the function contains a defer statement
|
||||||
|
|
@ -685,7 +685,7 @@ func (s *state) Fatalf(msg string, args ...interface{}) {
|
||||||
func (s *state) Warnl(pos src.XPos, msg string, args ...interface{}) { s.f.Warnl(pos, msg, args...) }
|
func (s *state) Warnl(pos src.XPos, msg string, args ...interface{}) { s.f.Warnl(pos, msg, args...) }
|
||||||
func (s *state) Debug_checknil() bool { return s.f.Frontend().Debug_checknil() }
|
func (s *state) Debug_checknil() bool { return s.f.Frontend().Debug_checknil() }
|
||||||
|
|
||||||
func ssaMarker(name string) ir.Node {
|
func ssaMarker(name string) *ir.Name {
|
||||||
return NewName(&types.Sym{Name: name})
|
return NewName(&types.Sym{Name: name})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1571,7 +1571,7 @@ func (s *state) exit() *ssa.Block {
|
||||||
for _, n := range s.returns {
|
for _, n := range s.returns {
|
||||||
addr := s.decladdrs[n]
|
addr := s.decladdrs[n]
|
||||||
val := s.variable(n, n.Type())
|
val := s.variable(n, n.Type())
|
||||||
s.vars[memVar] = s.newValue1A(ssa.OpVarDef, types.TypeMem, n.(*ir.Name), s.mem())
|
s.vars[memVar] = s.newValue1A(ssa.OpVarDef, types.TypeMem, n, s.mem())
|
||||||
s.store(n.Type(), addr, val)
|
s.store(n.Type(), addr, val)
|
||||||
// TODO: if val is ever spilled, we'd like to use the
|
// TODO: if val is ever spilled, we'd like to use the
|
||||||
// PPARAMOUT slot for spilling it. That won't happen
|
// PPARAMOUT slot for spilling it. That won't happen
|
||||||
|
|
@ -4224,7 +4224,7 @@ func (s *state) openDeferRecord(n ir.Node) {
|
||||||
s.stmtList(n.List())
|
s.stmtList(n.List())
|
||||||
|
|
||||||
var args []*ssa.Value
|
var args []*ssa.Value
|
||||||
var argNodes []ir.Node
|
var argNodes []*ir.Name
|
||||||
|
|
||||||
opendefer := &openDeferInfo{
|
opendefer := &openDeferInfo{
|
||||||
n: n,
|
n: n,
|
||||||
|
|
@ -4467,7 +4467,7 @@ func (s *state) openDeferExit() {
|
||||||
}
|
}
|
||||||
for _, argNode := range r.argNodes {
|
for _, argNode := range r.argNodes {
|
||||||
if argNode.Type().HasPointers() {
|
if argNode.Type().HasPointers() {
|
||||||
s.vars[memVar] = s.newValue1Apos(ssa.OpVarLive, types.TypeMem, argNode.(*ir.Name), s.mem(), false)
|
s.vars[memVar] = s.newValue1Apos(ssa.OpVarLive, types.TypeMem, argNode, s.mem(), false)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -4838,6 +4838,7 @@ func (s *state) addr(n ir.Node) *ssa.Value {
|
||||||
t := types.NewPtr(n.Type())
|
t := types.NewPtr(n.Type())
|
||||||
switch n.Op() {
|
switch n.Op() {
|
||||||
case ir.ONAME:
|
case ir.ONAME:
|
||||||
|
n := n.(*ir.Name)
|
||||||
switch n.Class() {
|
switch n.Class() {
|
||||||
case ir.PEXTERN:
|
case ir.PEXTERN:
|
||||||
// global variable
|
// global variable
|
||||||
|
|
@ -4855,17 +4856,17 @@ func (s *state) addr(n ir.Node) *ssa.Value {
|
||||||
}
|
}
|
||||||
if n == nodfp {
|
if n == nodfp {
|
||||||
// Special arg that points to the frame pointer (Used by ORECOVER).
|
// Special arg that points to the frame pointer (Used by ORECOVER).
|
||||||
return s.entryNewValue2A(ssa.OpLocalAddr, t, n.(*ir.Name), s.sp, s.startmem)
|
return s.entryNewValue2A(ssa.OpLocalAddr, t, n, s.sp, s.startmem)
|
||||||
}
|
}
|
||||||
s.Fatalf("addr of undeclared ONAME %v. declared: %v", n, s.decladdrs)
|
s.Fatalf("addr of undeclared ONAME %v. declared: %v", n, s.decladdrs)
|
||||||
return nil
|
return nil
|
||||||
case ir.PAUTO:
|
case ir.PAUTO:
|
||||||
return s.newValue2Apos(ssa.OpLocalAddr, t, n.(*ir.Name), s.sp, s.mem(), !ir.IsAutoTmp(n))
|
return s.newValue2Apos(ssa.OpLocalAddr, t, n, s.sp, s.mem(), !ir.IsAutoTmp(n))
|
||||||
|
|
||||||
case ir.PPARAMOUT: // Same as PAUTO -- cannot generate LEA early.
|
case ir.PPARAMOUT: // Same as PAUTO -- cannot generate LEA early.
|
||||||
// ensure that we reuse symbols for out parameters so
|
// ensure that we reuse symbols for out parameters so
|
||||||
// that cse works on their addresses
|
// that cse works on their addresses
|
||||||
return s.newValue2Apos(ssa.OpLocalAddr, t, n.(*ir.Name), s.sp, s.mem(), true)
|
return s.newValue2Apos(ssa.OpLocalAddr, t, n, s.sp, s.mem(), true)
|
||||||
default:
|
default:
|
||||||
s.Fatalf("variable address class %v not implemented", n.Class())
|
s.Fatalf("variable address class %v not implemented", n.Class())
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -6196,15 +6197,15 @@ func (s *SSAGenState) DebugFriendlySetPosFrom(v *ssa.Value) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// byXoffset implements sort.Interface for []*Node using Xoffset as the ordering.
|
// byXoffset implements sort.Interface for []*ir.Name using Xoffset as the ordering.
|
||||||
type byXoffset []ir.Node
|
type byXoffset []*ir.Name
|
||||||
|
|
||||||
func (s byXoffset) Len() int { return len(s) }
|
func (s byXoffset) Len() int { return len(s) }
|
||||||
func (s byXoffset) Less(i, j int) bool { return s[i].Offset() < s[j].Offset() }
|
func (s byXoffset) Less(i, j int) bool { return s[i].Offset() < s[j].Offset() }
|
||||||
func (s byXoffset) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
func (s byXoffset) Swap(i, j int) { s[i], s[j] = s[j], s[i] }
|
||||||
|
|
||||||
func emitStackObjects(e *ssafn, pp *Progs) {
|
func emitStackObjects(e *ssafn, pp *Progs) {
|
||||||
var vars []ir.Node
|
var vars []*ir.Name
|
||||||
for _, n := range e.curfn.Dcl {
|
for _, n := range e.curfn.Dcl {
|
||||||
if livenessShouldTrack(n) && n.Addrtaken() {
|
if livenessShouldTrack(n) && n.Addrtaken() {
|
||||||
vars = append(vars, n)
|
vars = append(vars, n)
|
||||||
|
|
|
||||||
|
|
@ -137,9 +137,9 @@ func dse(f *Func) {
|
||||||
// reaches stores then we delete all the stores. The other operations will then
|
// reaches stores then we delete all the stores. The other operations will then
|
||||||
// be eliminated by the dead code elimination pass.
|
// be eliminated by the dead code elimination pass.
|
||||||
func elimDeadAutosGeneric(f *Func) {
|
func elimDeadAutosGeneric(f *Func) {
|
||||||
addr := make(map[*Value]ir.Node) // values that the address of the auto reaches
|
addr := make(map[*Value]*ir.Name) // values that the address of the auto reaches
|
||||||
elim := make(map[*Value]ir.Node) // values that could be eliminated if the auto is
|
elim := make(map[*Value]*ir.Name) // values that could be eliminated if the auto is
|
||||||
used := make(map[ir.Node]bool) // used autos that must be kept
|
used := make(map[*ir.Name]bool) // used autos that must be kept
|
||||||
|
|
||||||
// visit the value and report whether any of the maps are updated
|
// visit the value and report whether any of the maps are updated
|
||||||
visit := func(v *Value) (changed bool) {
|
visit := func(v *Value) (changed bool) {
|
||||||
|
|
@ -222,7 +222,7 @@ func elimDeadAutosGeneric(f *Func) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Propagate any auto addresses through v.
|
// Propagate any auto addresses through v.
|
||||||
var node ir.Node
|
var node *ir.Name
|
||||||
for _, a := range args {
|
for _, a := range args {
|
||||||
if n, ok := addr[a]; ok && !used[n] {
|
if n, ok := addr[a]; ok && !used[n] {
|
||||||
if node == nil {
|
if node == nil {
|
||||||
|
|
@ -299,7 +299,7 @@ func elimUnreadAutos(f *Func) {
|
||||||
// Loop over all ops that affect autos taking note of which
|
// Loop over all ops that affect autos taking note of which
|
||||||
// autos we need and also stores that we might be able to
|
// autos we need and also stores that we might be able to
|
||||||
// eliminate.
|
// eliminate.
|
||||||
seen := make(map[ir.Node]bool)
|
seen := make(map[*ir.Name]bool)
|
||||||
var stores []*Value
|
var stores []*Value
|
||||||
for _, b := range f.Blocks {
|
for _, b := range f.Blocks {
|
||||||
for _, v := range b.Values {
|
for _, v := range b.Values {
|
||||||
|
|
|
||||||
|
|
@ -25,7 +25,7 @@ type FuncDebug struct {
|
||||||
// Slots is all the slots used in the debug info, indexed by their SlotID.
|
// Slots is all the slots used in the debug info, indexed by their SlotID.
|
||||||
Slots []LocalSlot
|
Slots []LocalSlot
|
||||||
// The user variables, indexed by VarID.
|
// The user variables, indexed by VarID.
|
||||||
Vars []ir.Node
|
Vars []*ir.Name
|
||||||
// The slots that make up each variable, indexed by VarID.
|
// The slots that make up each variable, indexed by VarID.
|
||||||
VarSlots [][]SlotID
|
VarSlots [][]SlotID
|
||||||
// The location list data, indexed by VarID. Must be processed by PutLocationList.
|
// The location list data, indexed by VarID. Must be processed by PutLocationList.
|
||||||
|
|
@ -166,7 +166,7 @@ func (s *debugState) logf(msg string, args ...interface{}) {
|
||||||
type debugState struct {
|
type debugState struct {
|
||||||
// See FuncDebug.
|
// See FuncDebug.
|
||||||
slots []LocalSlot
|
slots []LocalSlot
|
||||||
vars []ir.Node
|
vars []*ir.Name
|
||||||
varSlots [][]SlotID
|
varSlots [][]SlotID
|
||||||
lists [][]byte
|
lists [][]byte
|
||||||
|
|
||||||
|
|
@ -190,7 +190,7 @@ type debugState struct {
|
||||||
// The pending location list entry for each user variable, indexed by VarID.
|
// The pending location list entry for each user variable, indexed by VarID.
|
||||||
pendingEntries []pendingEntry
|
pendingEntries []pendingEntry
|
||||||
|
|
||||||
varParts map[ir.Node][]SlotID
|
varParts map[*ir.Name][]SlotID
|
||||||
blockDebug []BlockDebug
|
blockDebug []BlockDebug
|
||||||
pendingSlotLocs []VarLoc
|
pendingSlotLocs []VarLoc
|
||||||
liveSlots []liveSlot
|
liveSlots []liveSlot
|
||||||
|
|
@ -347,7 +347,7 @@ func BuildFuncDebug(ctxt *obj.Link, f *Func, loggingEnabled bool, stackOffset fu
|
||||||
}
|
}
|
||||||
|
|
||||||
if state.varParts == nil {
|
if state.varParts == nil {
|
||||||
state.varParts = make(map[ir.Node][]SlotID)
|
state.varParts = make(map[*ir.Name][]SlotID)
|
||||||
} else {
|
} else {
|
||||||
for n := range state.varParts {
|
for n := range state.varParts {
|
||||||
delete(state.varParts, n)
|
delete(state.varParts, n)
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue