cmd/compile: implement fmt.Formatter for Val formats %s, %v

Change-Id: Id56e886793161b48b445439e9a12109142064d3f
Reviewed-on: https://go-review.googlesource.com/28332
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
This commit is contained in:
Robert Griesemer 2016-08-30 15:01:48 -07:00
parent 9e1f6a326e
commit 97ba3c8242
3 changed files with 41 additions and 28 deletions

View file

@ -382,7 +382,7 @@ func dumpasmhdr() {
}
switch n.Op {
case OLITERAL:
fmt.Fprintf(b, "#define const_%s %v\n", n.Sym.Name, vconv(n.Val(), FmtSharp))
fmt.Fprintf(b, "#define const_%s %#v\n", n.Sym.Name, n.Val())
case OTYPE:
t := n.Type