]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: use more range fors in gc
authorDaniel Martí <mvdan@mvdan.cc>
Wed, 14 Mar 2018 10:50:49 +0000 (10:50 +0000)
committerMatthew Dempsky <mdempsky@google.com>
Thu, 22 Mar 2018 18:38:19 +0000 (18:38 +0000)
commit02798ed936cc3c4789ee8a3ca5ac26a24105947d
tree70059716e9eff0ff64cdbc42a0059876ae0ac5af
parent48f990b4a5743426ebf39b9cf2930fe100ebca9e
cmd/compile: use more range fors in gc

Slightly simplifies the code. Made sure to exclude the cases that would
change behavior, such as when the iterated value is a string, when the
index is modified within the body, or when the slice is modified.

Also checked that all the elements are of pointer type, to avoid the
corner case where non-pointer types could be copied by mistake.

Change-Id: Iea64feb2a9a6a4c94ada9ff3ace40ee173505849
Reviewed-on: https://go-review.googlesource.com/100557
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/dwinl.go
src/cmd/compile/internal/gc/phi.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/subr.go