]> Cypherpunks repositories - gostls13.git/commit
cmd/compile: simplify isGoConst
authorMatthew Dempsky <mdempsky@google.com>
Thu, 28 Feb 2019 02:18:47 +0000 (18:18 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 13 Mar 2019 18:24:02 +0000 (18:24 +0000)
commita1b5cb1d04dc3aac7149a5cb7cfc02111bd4ebef
tree61b6ac056eb7bf9ecc91f90e5123017974101a91
parent3def15cd20dc136e033a5866086ce862dc36bd52
cmd/compile: simplify isGoConst

The only ways to construct an OLITERAL node are (1) a basic literal
from the source package, (2) constant folding within evconst (which
only folds Go language constants), (3) the universal "nil" constant,
and (4) implicit conversions of nil to some concrete type.

Passes toolstash-check.

Change-Id: I30fc6b07ebede7adbdfa4ed562436cbb7078a2ff
Reviewed-on: https://go-review.googlesource.com/c/go/+/166981
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
src/cmd/compile/internal/gc/const.go
src/cmd/compile/internal/gc/typecheck.go
test/fixedbugs/bug297.go
test/fixedbugs/issue11361.go
test/fixedbugs/issue17038.go
test/fixedbugs/issue8183.go