]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/gc: skip autotmp vars in gc again
authorMatthew Dempsky <mdempsky@google.com>
Tue, 7 Mar 2017 18:57:55 +0000 (10:57 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 7 Mar 2017 19:23:25 +0000 (19:23 +0000)
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: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>

src/cmd/compile/internal/gc/pgen.go
src/cmd/internal/dwarf/dwarf.go

index 33811b80c298de0dd9d6538f0473d052f63ec5a1..0b4a62fd6c7c8eb68a97c78cd6ef6a92d04d5c16 100644 (file)
@@ -478,6 +478,10 @@ func debuginfo(fnsym *obj.LSym) []*dwarf.Var {
                        Gotype:  gotype,
                })
 
+               if n.IsAutoTmp() {
+                       continue
+               }
+
                typename := dwarf.InfoPrefix + gotype.Name[len("type."):]
                vars = append(vars, &dwarf.Var{
                        Name:   n.Sym.Name,
index 3644146725a3a1a574cbcc925821335b8d463942..99cb2d53ce3f20034dfd3a0d649ac7b1b8211fa4 100644 (file)
@@ -7,10 +7,7 @@
 // this package contains the shared code.
 package dwarf
 
-import (
-       "fmt"
-       "strings"
-)
+import "fmt"
 
 // InfoPrefix is the prefix for all the symbols containing DWARF info entries.
 const InfoPrefix = "go.info."
@@ -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)
        names := make(map[string]bool)
        for _, v := range vars {
-               if strings.Contains(v.Name, ".autotmp_") {
-                       continue
-               }
                var n string
                if names[v.Name] {
                        n = fmt.Sprintf("%s#%d", v.Name, len(names))