• Daniel Martí's avatar
    cmd/compile/internal/gc: add some Node methods · 2b2348ab
    Daniel Martí authored
    Focus on "isfoo" funcs that take a *Node, and conver them to isFoo
    methods instead. This makes for more idiomatic Go code, and also more
    readable func names.
    
    Found candidates with grep, and applied most changes with sed. The funcs
    chosen were isgoconst, isnil, and isblank. All had the same signature,
    func(*Node) bool.
    
    While at it, camelCase the isliteral and iszero function names. Don't
    move these to methods, as they are only used in the backend part of gc,
    which might one day be split into a separate package.
    
    Passes toolstash -cmp on std cmd.
    
    Change-Id: I4df081b12d36c46c253167c8841c5a841f1c5a16
    Reviewed-on: https://go-review.googlesource.com/105555
    Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
    2b2348ab
walk.go 96.1 KB