]> git.ipfire.org Git - thirdparty/gcc.git/commit
compiler: don't generate temporaries for composite literals
authorIan Lance Taylor <iant@golang.org>
Tue, 29 Jun 2021 19:53:02 +0000 (12:53 -0700)
committerIan Lance Taylor <iant@golang.org>
Tue, 29 Jun 2021 20:44:37 +0000 (13:44 -0700)
commit13c906f43f473ee9ff16d80590789d719f2190a4
tree1ace75a3584762f6a3768dbf27b6e02d0df80279
parentcca7eb8f7cc157ed1b351cbaa10a4066f8065c3a
compiler: don't generate temporaries for composite literals

We were generating temporaries for composite literals when a
conversion to interface type was required.  However, Cherry's
https://golang.org/cl/176459 changed the compiler to insert explicit
type conversions.  And those explicit type conversions insert the
required temporaries in Type_conversion_expression::do_flatten.
So in practice the composite literal do_flatten methods would never
insert temporaries, as the values they see would always be multi_eval_safe.
So just remove the unnecessary do_flatten methods.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/331691
gcc/go/gofrontend/MERGE
gcc/go/gofrontend/expressions.cc
gcc/go/gofrontend/expressions.h