]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: add Func.SetNilCheckDisabled
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 4 May 2017 14:55:00 +0000 (07:55 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Fri, 5 May 2017 19:34:09 +0000 (19:34 +0000)
commit53e62aba2fcdc4bb97726bfaf13042625209d154
tree77cbaa234b7b8db9f59b85c7a9fab15502eec8c5
parent09b71d563a53766ef2ab34beac6ddaea48c56783
cmd/compile: add Func.SetNilCheckDisabled

Generated hash and eq routines don't need nil checks.
Prior to this CL, this was accomplished by
temporarily incrementing the global variable disable_checknil.
However, that increment lasted only the lifetime of the
call to funccompile. After CL 41503, funccompile may
do nothing but enqueue the function for compilation,
resulting in nil checks being generated.

Fix this by adding an explicit flag to a function
indicating whether nil checks should be disabled
for that function.

While we're here, allow concurrent compilation
with the -w and -W flags, since that was needed
to investigate this issue.

Fixes #20242

Change-Id: Ib9140c22c49e9a09e62fa3cf350f5d3eff18e2bd
Reviewed-on: https://go-review.googlesource.com/42591
Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Marvin Stenger <marvin.stenger94@gmail.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/alg.go
src/cmd/compile/internal/gc/main.go
src/cmd/compile/internal/gc/ssa.go
src/cmd/compile/internal/gc/syntax.go