Commit 527f3518 authored by Matthew Dempsky's avatar Matthew Dempsky

cmd/compile/internal/gc: skip autotmp vars in gc again

Instead of skipping them based on string matching much later in the
compilation process, skip them up front using the proper API.

Passes toolstash-check.

Change-Id: Ibd4c0448a0701ba0de3235d4689ef300235fa1d9
Reviewed-on: https://go-review.googlesource.com/37930
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
parent b1a4424a
...@@ -478,6 +478,10 @@ func debuginfo(fnsym *obj.LSym) []*dwarf.Var { ...@@ -478,6 +478,10 @@ func debuginfo(fnsym *obj.LSym) []*dwarf.Var {
Gotype: gotype, Gotype: gotype,
}) })
if n.IsAutoTmp() {
continue
}
typename := dwarf.InfoPrefix + gotype.Name[len("type."):] typename := dwarf.InfoPrefix + gotype.Name[len("type."):]
vars = append(vars, &dwarf.Var{ vars = append(vars, &dwarf.Var{
Name: n.Sym.Name, Name: n.Sym.Name,
......
...@@ -7,10 +7,7 @@ ...@@ -7,10 +7,7 @@
// this package contains the shared code. // this package contains the shared code.
package dwarf package dwarf
import ( import "fmt"
"fmt"
"strings"
)
// InfoPrefix is the prefix for all the symbols containing DWARF info entries. // InfoPrefix is the prefix for all the symbols containing DWARF info entries.
const InfoPrefix = "go.info." const InfoPrefix = "go.info."
...@@ -576,9 +573,6 @@ func PutFunc(ctxt Context, s Sym, name string, external bool, startPC Sym, size ...@@ -576,9 +573,6 @@ func PutFunc(ctxt Context, s Sym, name string, external bool, startPC Sym, size
putattr(ctxt, s, DW_ABRV_FUNCTION, DW_FORM_flag, DW_CLS_FLAG, ev, 0) putattr(ctxt, s, DW_ABRV_FUNCTION, DW_FORM_flag, DW_CLS_FLAG, ev, 0)
names := make(map[string]bool) names := make(map[string]bool)
for _, v := range vars { for _, v := range vars {
if strings.Contains(v.Name, ".autotmp_") {
continue
}
var n string var n string
if names[v.Name] { if names[v.Name] {
n = fmt.Sprintf("%s#%d", v.Name, len(names)) n = fmt.Sprintf("%s#%d", v.Name, len(names))
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment