diff options
Diffstat (limited to 'src/cmd/compile/internal/ssa/print.go')
-rw-r--r-- | src/cmd/compile/internal/ssa/print.go | 8 |
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} |