mirror of
https://github.com/golang/go.git
synced 2025-05-28 02:41:30 +00:00
cmd/compile: don’t consider recursive calls for inlining
We will never inline recursive calls. Rather than simulate the recursion until we hit the complexity ceiling, just bail early. Also, remove a pointless n.Op check. visitBottomUp guarantees that n will be an ODCLFUNC, and caninl double-checks it. Change-Id: Ifa48331686b24289d34e68cf5bef385f464b6b92 Reviewed-on: https://go-review.googlesource.com/27462 Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
d1faf3879e
commit
376d9665a8
@ -438,10 +438,10 @@ func Main() {
|
||||
// Find functions that can be inlined and clone them before walk expands them.
|
||||
visitBottomUp(xtop, func(list []*Node, recursive bool) {
|
||||
for _, n := range list {
|
||||
if n.Op == ODCLFUNC {
|
||||
if !recursive {
|
||||
caninl(n)
|
||||
inlcalls(n)
|
||||
}
|
||||
inlcalls(n)
|
||||
}
|
||||
})
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user