]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: improve inlining and static analysis
authorMatthew Dempsky <mdempsky@google.com>
Sat, 24 Oct 2020 09:08:06 +0000 (02:08 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 29 Oct 2020 19:03:09 +0000 (19:03 +0000)
commitf2c0c2b90200b470c39a2db821b7c707604fe083
treed426aa9c7c491a332ec73d36f3cdccdb07aa28e9
parent0b798c46cd6994d246c37d011292b02aa2f37a08
cmd/compile: improve inlining and static analysis

When inlining a function call "f()", if "f" contains exactly 1
"return" statement and doesn't name its result parameters, it's
inlined to declare+initialize the result value using the AST
representation that's compatible with staticValue.

Also, extend staticValue to skip over OCONVNOP nodes (often introduced
by inlining), and fix various bits of code related to handling method
expressions.

Updates #33160.

Change-Id: If8652e319f0a5700cf9d40a7a62e369a2a359229
Reviewed-on: https://go-review.googlesource.com/c/go/+/266199
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: David Chase <drchase@google.com>
src/cmd/compile/internal/gc/inl.go
src/cmd/compile/internal/gc/scc.go