mirror of
https://github.com/golang/go
synced 2024-11-19 21:54:40 -07:00
cmd/compile: ignore non-code nodes when inlining
Avoid counting nodes that don't generate code (eg, constants) against the inlining budget. Fixes #21749 Change-Id: I10fca073e64be7d304709ef33e125eb8c78d5e4d Reviewed-on: https://go-review.googlesource.com/61250 Reviewed-by: Matthew Dempsky <mdempsky@google.com> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Gobot Gobot <gobot@golang.org>
This commit is contained in:
parent
b2e8630f2f
commit
812b34efae
@ -279,6 +279,10 @@ func (v *hairyVisitor) visit(n *Node) bool {
|
||||
ORETJMP:
|
||||
v.reason = "unhandled op " + n.Op.String()
|
||||
return true
|
||||
|
||||
case ODCLCONST, OEMPTY, OFALL, OLABEL:
|
||||
// These nodes don't produce code; omit from inlining budget.
|
||||
return false
|
||||
}
|
||||
|
||||
v.budget--
|
||||
|
Loading…
Reference in New Issue
Block a user