From: Matthew Dempsky Date: Tue, 13 Sep 2016 21:05:14 +0000 (-0700) Subject: cmd/compile/internal/gc: eliminate bstdout X-Git-Tag: go1.8beta1~1342 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=2b5c18c99e1be7c779706e23f99717a84d7d882b;p=gostls13.git cmd/compile/internal/gc: eliminate bstdout Just use Ctxt.Bso instead. Change-Id: I68f1639f0b4c238ae5499ef49e78a5d734417979 Reviewed-on: https://go-review.googlesource.com/29114 Run-TryBot: Matthew Dempsky TryBot-Result: Gobot Gobot Reviewed-by: Brad Fitzpatrick --- diff --git a/src/cmd/compile/internal/gc/go.go b/src/cmd/compile/internal/gc/go.go index 756c4d7358..860f29e5b4 100644 --- a/src/cmd/compile/internal/gc/go.go +++ b/src/cmd/compile/internal/gc/go.go @@ -5,7 +5,6 @@ package gc import ( - "bufio" "cmd/compile/internal/ssa" "cmd/internal/bio" "cmd/internal/obj" @@ -285,8 +284,6 @@ var Ctxt *obj.Link var writearchive bool -var bstdout *bufio.Writer - var Nacl bool var continpc *obj.Prog diff --git a/src/cmd/compile/internal/gc/main.go b/src/cmd/compile/internal/gc/main.go index a52ad8cc50..99c6fe5a74 100644 --- a/src/cmd/compile/internal/gc/main.go +++ b/src/cmd/compile/internal/gc/main.go @@ -107,8 +107,7 @@ func Main() { Ctxt = obj.Linknew(Thearch.LinkArch) Ctxt.DiagFunc = Yyerror - bstdout = bufio.NewWriter(os.Stdout) - Ctxt.Bso = bstdout + Ctxt.Bso = bufio.NewWriter(os.Stdout) localpkg = mkpkg("") localpkg.Prefix = "\"\"" diff --git a/src/cmd/compile/internal/gc/subr.go b/src/cmd/compile/internal/gc/subr.go index fe8f820c5f..9992f49b4b 100644 --- a/src/cmd/compile/internal/gc/subr.go +++ b/src/cmd/compile/internal/gc/subr.go @@ -59,7 +59,7 @@ func (x byLineno) Less(i, j int) bool { return x[i].lineno < x[j].lineno } func (x byLineno) Swap(i, j int) { x[i], x[j] = x[j], x[i] } func Flusherrors() { - bstdout.Flush() + Ctxt.Bso.Flush() if len(errors) == 0 { return }