]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: cleanup compile function
authorMatthew Dempsky <mdempsky@google.com>
Tue, 8 Mar 2016 06:05:49 +0000 (22:05 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Tue, 8 Mar 2016 21:34:51 +0000 (21:34 +0000)
commite806cd9f95ccf14163623792425db2b066d4198e
tree956d67f403217fc14a99592e024f175015310629
parent4fc02d175b2eb45b89facae9723975fe12acac3c
cmd/compile: cleanup compile function

Make more idiomatic with a defer cleanup, which allows declaring
variables closer to their first use, rather than up front before the
first goto statement.

Also, split the legacy code generation code path into a separate
genlegacy function, analogous to the new genssa.

Passes toolstash -cmp.

Change-Id: I86c22838704f6861b75716ae64ba103b0e73b12f
Reviewed-on: https://go-review.googlesource.com/20353
Reviewed-by: Dave Cheney <dave@cheney.net>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/pgen.go