aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/internal/obj/arm64/obj7.go
diff options
context:
space:
mode:
authorDave Cheney <dave@cheney.net>2016-08-24 20:44:09 +1000
committerDave Cheney <dave@cheney.net>2016-08-25 01:31:17 +0000
commit3167ff7ca91b56f3d06c5cda371b2a7c2741cd35 (patch)
tree60fc5de8afc034a8d2e74e9084f77d81d723d51c /src/cmd/internal/obj/arm64/obj7.go
parent1472221a774c2a763dbe545b1686f4e8dc23613f (diff)
downloadgo-3167ff7ca91b56f3d06c5cda371b2a7c2741cd35.tar.xz
cmd/internal/*: only call ctx.Bso.Flush when something has been written
In many places where ctx.Bso.Flush is used as the target for some debug logging, ctx.Bso.Flush is called unconditionally. In the majority of cases where debug logging is not enabled, this means Flush is called many times when there is nothing to be flushed (it will be called anyway when ctx.Bso is eventually closed), sometimes in a loop. Avoid this by moving the ctx.Bso.Flush call into the same condition block as the debug print. This pattern was previously applied sporadically. Change-Id: I0444cb235cc8b9bac51a59b2e44e59872db2be06 Reviewed-on: https://go-review.googlesource.com/27579 Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: David Crawshaw <crawshaw@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/internal/obj/arm64/obj7.go')
-rw-r--r--src/cmd/internal/obj/arm64/obj7.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cmd/internal/obj/arm64/obj7.go b/src/cmd/internal/obj/arm64/obj7.go
index 3f606dd697..e251408aa7 100644
--- a/src/cmd/internal/obj/arm64/obj7.go
+++ b/src/cmd/internal/obj/arm64/obj7.go
@@ -714,8 +714,8 @@ func preprocess(ctxt *obj.Link, cursym *obj.LSym) {
if ctxt.Autosize == 0 && !(cursym.Text.Mark&LEAF != 0) {
if ctxt.Debugvlog != 0 {
fmt.Fprintf(ctxt.Bso, "save suppressed in: %s\n", cursym.Text.From.Sym.Name)
+ ctxt.Bso.Flush()
}
- ctxt.Bso.Flush()
cursym.Text.Mark |= LEAF
}