• Josh Bleecher Snyder's avatar
    cmd/compile: insert ' ' and \n at beginning of walkprint · 9de79900
    Josh Bleecher Snyder authored
    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: 's avatarMatthew Dempsky <mdempsky@google.com>
    9de79900
print.go 4.57 KB