]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: insert ' ' and \n at beginning of walkprint
authorJosh Bleecher Snyder <josharian@gmail.com>
Sun, 21 May 2017 22:18:08 +0000 (15:18 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Tue, 15 Aug 2017 21:54:30 +0000 (21:54 +0000)
commit9de7990054184381f1c520563d60175f821e7d7f
tree36d26327d73d0e55a580b3278775ae2caae52ebe
parent385ca9ae9afa7b326f2b27c8596961bcef862504
cmd/compile: insert ' ' and \n at beginning of walkprint

Rather than emitting spaces and newlines for println
as we walk the expression, construct it all up front.
This enables further optimizations.

This requires using printstring instead of print in
the implementation of printsp and printnl,
on pain of infinite recursion.
That's ok; it's more efficient anyway, and just as simple.
While we're here, do it for other print routines as well.

Change-Id: I61d7df143810e00710c4d4d948d904007a7fd190
Reviewed-on: https://go-review.googlesource.com/55097
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/subr.go
src/cmd/compile/internal/gc/walk.go
src/runtime/print.go