compiler: in range, evaluate array if it has receives or calls
authorIan Lance Taylor <ian@gcc.gnu.org>
Mon, 5 Feb 2018 01:50:22 +0000 (01:50 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Mon, 5 Feb 2018 01:50:22 +0000 (01:50 +0000)
commit964c809fb28f2bbb5b7c35d7951911abff242b94
treeb28da004d38101795417db74c7864f081e38ba3f
parent4cff15eaca92180183608371351ba2c818990304
compiler: in range, evaluate array if it has receives or calls

    The last change was incomplete, in that it did not evaluate the array
    argument in some cases where it had to be evaluated.  This reuses the
    existing code for checking whether len/cap is constant.

    Also clean up the use of _ as the second variable in a for/range,
    which was previously inconsistent depending on whether the statement
    used = or :=.

    Updates golang/go#22313

    Reviewed-on: https://go-review.googlesource.com/91715

From-SVN: r257377
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h
gcc/go/gofrontend/parse.cc
gcc/go/gofrontend/statements.cc