]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/dwarfgen: remove unversion
authorMatthew Dempsky <mdempsky@google.com>
Tue, 12 Sep 2023 10:17:23 +0000 (03:17 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 12 Sep 2023 18:52:49 +0000 (18:52 +0000)
The unified export data format doesn't rely on embedding version
numbers in local variable names anymore, so there's no need to look
for them.

While here, simplify the checking for "~r" or "~b" to just "~",
because the next commit is going to eliminate "~b", but introduce
"~p".

Change-Id: I3ac73150ee561c66356a0c4aee5290b44a4893ee
Reviewed-on: https://go-review.googlesource.com/c/go/+/527695
Auto-Submit: Matthew Dempsky <mdempsky@google.com>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Than McIntosh <thanm@google.com>
src/cmd/compile/internal/dwarfgen/dwarf.go
src/cmd/compile/internal/dwarfgen/dwinl.go

index 4bb40bea8ea7e26bc2d3e41fb52fcd139c6c11fb..e9553d118535e9c68d7dc931db4dbeefad0dba11 100644 (file)
@@ -323,7 +323,7 @@ func preInliningDcls(fnsym *obj.LSym) []*ir.Name {
                c := n.Sym().Name[0]
                // Avoid reporting "_" parameters, since if there are more than
                // one, it can result in a collision later on, as in #23179.
-               if unversion(n.Sym().Name) == "_" || c == '.' || n.Type().IsUntyped() {
+               if n.Sym().Name == "_" || c == '.' || n.Type().IsUntyped() {
                        continue
                }
                rdcl = append(rdcl, n)
index 92f339d3c6f8f0f4cb61e3b3215d6c9e2759bee3..655e7c66ac24f8da8efe7d81156e73006c8ad365 100644 (file)
@@ -124,18 +124,16 @@ func assembleInlines(fnsym *obj.LSym, dwVars []*dwarf.Var) dwarf.InlCalls {
                // caller.
                synthCount := len(m)
                for _, v := range sl {
-                       canonName := unversion(v.Name)
                        vp := varPos{
-                               DeclName: canonName,
+                               DeclName: v.Name,
                                DeclFile: v.DeclFile,
                                DeclLine: v.DeclLine,
                                DeclCol:  v.DeclCol,
                        }
-                       synthesized := strings.HasPrefix(v.Name, "~r") || canonName == "_" || strings.HasPrefix(v.Name, "~b")
+                       synthesized := strings.HasPrefix(v.Name, "~") || v.Name == "_"
                        if idx, found := m[vp]; found {
                                v.ChildIndex = int32(idx)
                                v.IsInAbstract = !synthesized
-                               v.Name = canonName
                        } else {
                                // Variable can't be found in the pre-inline dcl list.
                                // In the top-level case (ii=0) this can happen
@@ -220,15 +218,6 @@ func AbstractFunc(fn *obj.LSym) {
        base.Ctxt.DwarfAbstractFunc(ifn, fn)
 }
 
-// Undo any versioning performed when a name was written
-// out as part of export data.
-func unversion(name string) string {
-       if i := strings.Index(name, "ยท"); i > 0 {
-               name = name[:i]
-       }
-       return name
-}
-
 // Given a function that was inlined as part of the compilation, dig
 // up the pre-inlining DCL list for the function and create a map that
 // supports lookup of pre-inline dcl index, based on variable
@@ -241,7 +230,7 @@ func makePreinlineDclMap(fnsym *obj.LSym) map[varPos]int {
        for i, n := range dcl {
                pos := base.Ctxt.InnermostPos(n.Pos())
                vp := varPos{
-                       DeclName: unversion(n.Sym().Name),
+                       DeclName: n.Sym().Name,
                        DeclFile: pos.RelFilename(),
                        DeclLine: pos.RelLine(),
                        DeclCol:  pos.RelCol(),