]> Cypherpunks repositories - gostls13.git/commit
cmd/internal/objfile: emit trailing tab outside of Disasm.Decode
authorJosh Bleecher Snyder <josharian@gmail.com>
Sat, 14 Apr 2018 16:59:25 +0000 (09:59 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Wed, 18 Apr 2018 18:07:05 +0000 (18:07 +0000)
commit50ccbe1fc2737f6ea2642aee1c99c9ad141258b2
tree257efca6a8d4c233fe3de21fc98948f7a1aa43d3
parent4c15fdb32b58cae0a999fdd2fb8eae1c720c870b
cmd/internal/objfile: emit trailing tab outside of Disasm.Decode

Disasm.Decode currently always appends a tab to the formatted instruction,
although not to any relocations after it.

Decode has two clients: objdump and pprof.
pprof emits plain text, so it would be better not to have a trailing tab.
objdump wants the trailing tab for text/tabwriter,
but it is easy to add that to the Fprintf call.

Shifting the responsibility for the trailing tab to the caller
simplifies the code, increases correctness, and slightly improves
performance by reducing and coalescing string concatenations.

Change-Id: I0c85518ee185949e385de819e2e703bce757eba9
Reviewed-on: https://go-review.googlesource.com/106983
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
src/cmd/internal/objfile/disasm.go