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 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.

Change-Id: I66975b7ddc763f0cf93a6b56efede10bca3d3765
Trust: Ian Lance Taylor <>
Reviewed-by: Than McIntosh <>
Reviewed-by: Cherry Mui <>
2 files changed
tree: df7c384c9e2d4d8fd76f56058e6a6f25e14170c7
  1. .gitignore
  8. codereview.cfg
  9. go/
  10. libgo/

A Go frontend

Ian Lance Taylor Last update 15 June 2014

This is a compiler frontend for the Go programming language. The frontend was originally developed at Google, and was released in November 2009. It was originally written by Ian Lance Taylor.

It was originally written for GCC. As of this writing it only supports GCC, but the GCC support has been separated from the rest of the frontend, so supporting another compiler is feasible.

The go subdirectory holds the frontend source code. This is mirrored to the gcc/go subdirectory in the GCC repository.

The libgo subdirectory holds the library source code. This is a copy of the main Go library with various changes appropriate for this compiler. The main Go library is hosted at, in the src directory. The libgo subdirectory is mirrored to the libgo subdirectory in the gcc repository.

Legal Matters

To contribute patches to the files in this directory, please see Contributing to the gccgo frontend.

The master copy of these files is hosted in Gerrit (there is a mirror at Github). Changes to these files require signing a Google contributor license agreement. If you are the copyright holder, you will need to agree to the Google Individual Contributor License Agreement. This agreement can be completed online.

If your organization is the copyright holder, the organization will need to agree to the Google Software Grant and Corporate Contributor License Agreement.

If the copyright holder for your code has already completed the agreement in connection with another Google open source project, it does not need to be completed again.

The authors of these files may be found in the AUTHORS and CONTRIBUTORS files.