Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> TryBot-Result: Go Bot <[email protected]> Trust: Alberto Donizetti <[email protected]> Trust: Cuong Manh Le <[email protected]> Reviewed-by: Cuong Manh Le <[email protected]> Reviewed-by: Matthew Dempsky <[email protected]>
- Loading branch information