]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: change mustHeapAlloc to return a reason why
authorAlberto Donizetti <alb.donizetti@gmail.com>
Thu, 1 Oct 2020 10:03:27 +0000 (12:03 +0200)
committerAlberto Donizetti <alb.donizetti@gmail.com>
Sat, 3 Oct 2020 13:02:20 +0000 (13:02 +0000)
commit095e0f48a19fa3bd7901f79420374b9cb50940e9
treea60e196b1aaa8389f248bea1812c212d53febc63
parentf89d05eb7ba1885474d03bb62f0a36a2d3cf56ea
cmd/compile: change mustHeapAlloc to return a reason why

This change renames mustHeapAlloc to heapAllocReason, and changes it
to return the reason why the argument must escape, so we don't have to
re-deduce it in its callers just to print the escape reason. It also
embeds isSmallMakeSlice body in heapAllocReason, since the former was
only used by the latter, and deletes isSmallMakeSlice.

An outdated TODO to remove smallintconst, which the TODO claimed was
only used in one place, was also removed, since grepping shows we
currently call smallintconst in 11 different places.

Change-Id: I0bd11bf29b92c4126f5bb455877ff73217d5a155
Reviewed-on: https://go-review.googlesource.com/c/go/+/258678
Run-TryBot: Alberto Donizetti <alb.donizetti@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Trust: Alberto Donizetti <alb.donizetti@gmail.com>
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/esc.go
src/cmd/compile/internal/gc/escape.go
src/cmd/compile/internal/gc/walk.go
test/fixedbugs/issue41635.go