cmd/compile: improve debugging output for GOSSAFUNC
This changes the assembly language output to use the
innermost (instead of outermost) position for line
number and file.
The file is printed separately, only when it changes,
to remove redundant and space-consuming noise from the
output.
Unknown positions have line number "?"
The output format was changed slightly to make it
easier to read.
One source of gratuitous variation in debugging output was
removed.
Change-Id: I1fd9c8b0ddd82766488582fb684dce4b04f35723
Reviewed-on: https://go-review.googlesource.com/78895
Run-TryBot: David Chase <drchase@google.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Cherry Zhang <cherryyz@google.com>
diff --git a/src/cmd/compile/internal/ssa/value.go b/src/cmd/compile/internal/ssa/value.go
index 288ad19..832ed8d 100644
--- a/src/cmd/compile/internal/ssa/value.go
+++ b/src/cmd/compile/internal/ssa/value.go
@@ -9,6 +9,7 @@
"cmd/internal/src"
"fmt"
"math"
+ "sort"
"strings"
)
@@ -120,6 +121,7 @@
}
}
if len(names) != 0 {
+ sort.Strings(names) // Otherwise a source of variation in debugging output.
s += " (" + strings.Join(names, ", ") + ")"
}
return s