]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: support new language constructs in escape analysis
authorCherry Mui <cherryyz@google.com>
Tue, 3 Aug 2021 23:35:55 +0000 (19:35 -0400)
committerIan Lance Taylor <iant@golang.org>
Wed, 4 Aug 2021 01:32:07 +0000 (18:32 -0700)
commit22e40cc7feb8abda85762e4f07719836d5c57f1a
tree006460b18638cda9e6daada502ef6f79ee7820e3
parentfa1407c7613214cb4a45734fdb14c4756a83808a
compiler: support new language constructs in escape analysis

Previous CLs add new language constructs in Go 1.17, specifically,
unsafe.Add, unsafe.Slice, and conversion from a slice to a pointer
to an array. This CL handles them in the escape analysis.

At the point of the escape analysis, unsafe.Add and unsafe.Slice
are still builtin calls, so just handle them in data flow.
Conversion from a slice to a pointer to an array has already been
lowered to a combination of compound expression, conditional
expression and slice info expressions, so handle them in the
escape analysis.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/339671
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/escape.cc
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h