aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/ssa/html.go
diff options
context:
space:
mode:
authorYury Smolsky <yury@smolsky.by>2018-11-21 19:06:28 +0200
committerDavid Chase <drchase@google.com>2018-11-21 17:48:27 +0000
commit8c5c2b71f4124eb5e72cde327d740a8dbdd4eeb8 (patch)
treee16dc55254a4e37f4d2baff074751a8a89554f02 /src/cmd/compile/internal/ssa/html.go
parent9098d1d85494810a21c6342c8f501dae8fc757d6 (diff)
downloadgo-8c5c2b71f4124eb5e72cde327d740a8dbdd4eeb8.tar.gz
go-8c5c2b71f4124eb5e72cde327d740a8dbdd4eeb8.zip
cmd/compile: fix TestFormats by using valid formats
CL 142517 has used some formats incorrectly. This change fixes it by using %v for errors and invoking Block.Kind.String(). Format map stays intact. Updates #28177 Change-Id: If53b6cc54ba3c1ffc17b005225787e3b546de404 Reviewed-on: https://go-review.googlesource.com/c/150798 Run-TryBot: Yury Smolsky <yury@smolsky.by> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Chase <drchase@google.com>
Diffstat (limited to 'src/cmd/compile/internal/ssa/html.go')
-rw-r--r--src/cmd/compile/internal/ssa/html.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/cmd/compile/internal/ssa/html.go b/src/cmd/compile/internal/ssa/html.go
index 3ea83f90a2..6b8748bdb5 100644
--- a/src/cmd/compile/internal/ssa/html.go
+++ b/src/cmd/compile/internal/ssa/html.go
@@ -893,7 +893,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) {
if f.laidout {
layout = fmt.Sprintf(" #%d", i)
}
- fmt.Fprintf(pipe, `%v [label="%v%s\n%v",id="graph_node_%v_%v",tooltip="%v"];`, b, b, layout, b.Kind, id, b, b.LongString())
+ fmt.Fprintf(pipe, `%v [label="%v%s\n%v",id="graph_node_%v_%v",tooltip="%v"];`, b, b, layout, b.Kind.String(), id, b, b.LongString())
}
indexOf := make([]int, f.NumBlocks())
for i, b := range f.Blocks {
@@ -942,7 +942,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) {
err = cmd.Wait()
if err != nil {
d.broken = true
- fmt.Printf("dot: %s\n%v\n", err, bufErr.String())
+ fmt.Printf("dot: %v\n%v\n", err, bufErr.String())
return
}
@@ -952,7 +952,7 @@ func (d *dotWriter) writeFuncSVG(w io.Writer, phase string, f *Func) {
// our fingers, finding '<svg ' and injecting needed attributes after it.
err = d.copyUntil(w, buf, `<svg `)
if err != nil {
- fmt.Printf("injecting attributes: %s\n", err)
+ fmt.Printf("injecting attributes: %v\n", err)
return
}
fmt.Fprintf(w, ` id="%s" onload="makeDraggable(evt)" `, svgID)