| commit | 4b3015de639cf22ed11ff96097555700909827c8 | [log] [tgz] |
|---|---|---|
| author | Cherry Zhang <cherryyz@google.com> | Tue Mar 26 10:44:37 2019 -0400 |
| committer | Ian Lance Taylor <iant@golang.org> | Fri May 03 21:44:55 2019 +0000 |
| tree | bccf5da607019fb47081fe2a452fad23787da725 | |
| parent | 208521930c9b5adcfb495799ee01b6aec86c2ccf [diff] |
compiler: recognize and optimize array range clear
Recognize
for i := range a { a[i] = zero }
for array or slice a, and rewrite it to call memclr, as the gc
compiler does.
Change-Id: I57e4487a8cd463504624edc1c42199dfe8133174
Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/169398
Reviewed-by: Ian Lance Taylor <iant@golang.org>