]> Cypherpunks.ru repositories - gostls13.git/commit
[dev.regabi] cmd/compile: minor walkExpr cleanups
authorMatthew Dempsky <mdempsky@google.com>
Sun, 27 Dec 2020 03:30:12 +0000 (19:30 -0800)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 28 Dec 2020 07:10:11 +0000 (07:10 +0000)
commit0f732f8c91aa4550ce1803906a55de51760e3243
tree60b59cdd12ad2cfd8693596baccd45d118fc3e33
parent0de8eafd98e7431a46c60dd8ea4d3f3a47691049
[dev.regabi] cmd/compile: minor walkExpr cleanups

This CL cleans up a few minor points in walkExpr:

1. We don't actually care about computing the type-size of all
expressions that are walked. We care about computing the type-size of
all expressions that are *returned* by walk, as these are the
expressions that will actually be seen by the back end.

2. There's no need to call typecheck.EvalConst anymore. EvalConst used
to be responsible for doing additional constant folding during walk;
but for a while a now, it has done only as much constant folding as is
required during type checking (because doing further constant folding
led to too many issues with Go spec compliance). Instead, more
aggressive constant folding is handled entirely by SSA.

3. The code for detecting string constants and generating their
symbols can be simplified somewhat.

Passes toolstash -cmp.

Change-Id: I464ef5bceb8a97689c8f55435369a3402a5ebc55
Reviewed-on: https://go-review.googlesource.com/c/go/+/280434
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/walk/expr.go