]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't bother compiling functions named "_"
authorKeith Randall <khr@google.com>
Tue, 22 Jan 2019 18:08:10 +0000 (10:08 -0800)
committerKeith Randall <khr@golang.org>
Tue, 26 Feb 2019 20:56:24 +0000 (20:56 +0000)
commitf495f549acb3505792902151d6306f177fb65207
tree83274270f4a2494cbb20f6dab525fc9b72feef95
parent933e34ac995cf7b2a1d044dc530bfafbf697758d
cmd/compile: don't bother compiling functions named "_"

They can't be used, so we don't need code generated for them. We just
need to report errors in their bodies.

The compiler currently has a bunch of special cases sprinkled about
for "_" functions, because we never generate a linker symbol for them.
Instead, abort compilation earlier so we never reach any of that
special-case code.

Fixes #29870

Change-Id: I3530c9c353deabcf75ce9072c0b740e992349ee5
Reviewed-on: https://go-review.googlesource.com/c/158845
Run-TryBot: Keith Randall <khr@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Josh Bleecher Snyder <josharian@gmail.com>
src/cmd/compile/internal/gc/gsubr.go
src/cmd/compile/internal/gc/pgen.go
src/cmd/compile/internal/gc/plive.go
src/cmd/compile/internal/gc/ssa.go