]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: don't bother compiling functions named "_"
authorKeith Randall <khr@google.com>
Tue, 22 Jan 2019 21:49:47 +0000 (13:49 -0800)
committerKeith Randall <khr@golang.org>
Tue, 22 Jan 2019 22:06:11 +0000 (22:06 +0000)
commit1fb596143cd47145c8cee0c1c5ed5e871feeb2b1
tree1f7efa777c793079cf2fe349b06359e761026a2f
parentef82ecd0f604f6323bcca6fc06ccd3ac94982c60
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.

This is the minimal CL for 1.12. For 1.13, CL 158845 will remove
a bunch of special cases sprinkled about the compiler to handle "_"
functions, which should (after this CL) be unnecessary.

Update #29870

Change-Id: Iaa1c194bd0017dffdce86589fe2d36726ee83c13
Reviewed-on: https://go-review.googlesource.com/c/158820
Run-TryBot: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
src/cmd/compile/internal/gc/pgen.go
test/fixedbugs/issue29870.go [new file with mode: 0644]
test/fixedbugs/issue29870b.go [new file with mode: 0644]