]> Cypherpunks.ru repositories - gostls13.git/commit
cmd/gc: improve escape analysis for &T{...}
authorDmitry Vyukov <dvyukov@google.com>
Mon, 19 Jan 2015 20:46:22 +0000 (23:46 +0300)
committerDmitry Vyukov <dvyukov@google.com>
Wed, 28 Jan 2015 16:59:01 +0000 (16:59 +0000)
commit1b87f01239de499654b390a41a7f8e2b453789dc
treee346c4ea2d5fe828abcbf55121ec149f3b99b623
parent2059ffbc8db0dff3fd9780a817f76e95559193ba
cmd/gc: improve escape analysis for &T{...}

Currently all PTRLIT element initializers escape. There is no reason for that.
This change links STRUCTLIT to PTRLIT; STRUCTLIT element initializers are
already linked to the STRUCTLIT. As the result, PTRLIT element initializers
escape when PTRLIT itself escapes.

Change-Id: I89ecd8677cbf81addcfd469cd2fd461c0e9bf7dd
Reviewed-on: https://go-review.googlesource.com/3031
Reviewed-by: Russ Cox <rsc@golang.org>
src/cmd/gc/esc.c
test/escape2.go
test/escape2n.go