compiler: do simple deadcode elimination

Programming / Compilers / GCC - ian [138bc75d-0d04-0410-961f-82ee72b054a4] - 7 June 2019 13:40 EDT

Normally the backend will do deadcode elimination and this is sufficient. However, the escape analysis operates on the AST that may have deadcode, and may cause things to escape that otherwise do not.

This CL adds a simple deadcode elimination, run before the escape analysis.

Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/181080

ac7ef97d772 compiler: do simple deadcode elimination
gcc/go/gofrontend/MERGE | 2 +-
gcc/go/gofrontend/expressions.cc | 129 +++++++++++++++++++++++++++++++++++++++
gcc/go/gofrontend/expressions.h | 21 +++++++
gcc/go/gofrontend/go.cc | 3 +
gcc/go/gofrontend/gogo.cc | 74 ++++++++++++++++++++++
gcc/go/gofrontend/gogo.h | 4 ++
gcc/go/gofrontend/statements.h | 8 +++
7 files changed, 240 insertions(+), 1 deletion(-)

Upstream: gcc.gnu.org


  • Share