compiler: improve escape analysis

This CL ports recent enhancements of the escape analysis in the
gc compiler to gofrontend.

- CL 99335: unnamed receiver should not escape.

- CL 105257: propagate loop depth to field. This prevents it
  from escaping when a field's address is taken inside a loop
  (but not otherwise escape).

- CL 107597: use element type for "indirection" of slice/string.
  This prevents the slice/string from escaping when only the
  element, in case that it is pointerless, flows to outer scope.

Change-Id: I19d7e700e0384fc352dbef4c9e3d73915df6d106
Reviewed-on: https://go-review.googlesource.com/120760
Reviewed-by: Than McIntosh <thanm@google.com>
Reviewed-by: Ian Lance Taylor <iant@golang.org>
1 file changed