diff options
| author | Josh Bleecher Snyder <josharian@gmail.com> | 2016-11-08 22:18:38 -0800 |
|---|---|---|
| committer | Josh Bleecher Snyder <josharian@gmail.com> | 2017-02-01 20:34:34 +0000 |
| commit | a246f61637b80e2f3426fae03ede072c8a28474e (patch) | |
| tree | 9fa0e76832c8da14d6c2896dac894e2f10b592ae | |
| parent | 457ac38e7a4066d27a64845c2569fad2b4d7bc8a (diff) | |
| download | go-a246f61637b80e2f3426fae03ede072c8a28474e.tar.xz | |
cmd/compile: report more non-inlineable functions
Many non-inlineable functions were not being
reported in '-m -m' mode.
Updates #17858.
Change-Id: I7d96361b39dd317f5550e57334a8a6dd1a836598
Reviewed-on: https://go-review.googlesource.com/32971
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
| -rw-r--r-- | src/cmd/compile/internal/gc/inl.go | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/gc/inl.go b/src/cmd/compile/internal/gc/inl.go index 9912cf5aa0..7095782411 100644 --- a/src/cmd/compile/internal/gc/inl.go +++ b/src/cmd/compile/internal/gc/inl.go @@ -268,7 +268,12 @@ func ishairy(n *Node, budget *int32, reason *string) bool { *budget -= 2 } - return *budget < 0 || ishairy(n.Left, budget, reason) || ishairy(n.Right, budget, reason) || + if *budget < 0 { + *reason = "function too complex" + return true + } + + return ishairy(n.Left, budget, reason) || ishairy(n.Right, budget, reason) || ishairylist(n.List, budget, reason) || ishairylist(n.Rlist, budget, reason) || ishairylist(n.Ninit, budget, reason) || ishairylist(n.Nbody, budget, reason) } |
