aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/print.go
diff options
context:
space:
mode:
authorBradford Lamson-Scribner <brad.lamson@gmail.com>2020-03-29 13:17:46 -0600
committerJosh Bleecher Snyder <josharian@gmail.com>2020-04-01 03:54:44 +0000
commitafc480bab447c0fefe26a69e4221d93673021e98 (patch)
treeab8565a634c94e810f5f40ee6a535e9febf7237d /src/cmd/compile/internal/ssa/print.go
parent7939c43748932c0caf1a1538410eb70fcd5a705f (diff)
downloadgo-afc480bab447c0fefe26a69e4221d93673021e98.tar.gz
go-afc480bab447c0fefe26a69e4221d93673021e98.zip
cmd/compile: combine ssa.html columns with identical contents
Combine columns in ssa.html output if they are identical. There can now be multiple titles per column which are all clickable to expand and collapse their column. Give collapsed columns some padding for better readability. Some of the work in this CL was started by Josh Bleecher Snyder and mailed to me in order to continue to completion. Updates #37766 Change-Id: I313b0917dc1bafe1eb99d91798ea915e5bcfaae9 Reviewed-on: https://go-review.googlesource.com/c/go/+/226209 Reviewed-by: Alberto Donizetti <alb.donizetti@gmail.com> Reviewed-by: Keith Randall <khr@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/ssa/print.go')
-rw-r--r--src/cmd/compile/internal/ssa/print.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/ssa/print.go b/src/cmd/compile/internal/ssa/print.go
index 58e4c3bbbe..36f09c3ad9 100644
--- a/src/cmd/compile/internal/ssa/print.go
+++ b/src/cmd/compile/internal/ssa/print.go
@@ -6,6 +6,7 @@ package ssa
import (
"bytes"
+ "crypto/sha256"
"fmt"
"io"
)
@@ -14,6 +15,13 @@ func printFunc(f *Func) {
f.Logf("%s", f)
}
+func hashFunc(f *Func) []byte {
+ h := sha256.New()
+ p := stringFuncPrinter{w: h}
+ fprintFunc(p, f)
+ return h.Sum(nil)
+}
+
func (f *Func) String() string {
var buf bytes.Buffer
p := stringFuncPrinter{w: &buf}