mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
[dev.typeparams] cmd/compile: calculate variable sizes in walk
Walk already explicitly calculates the size of all expression types, to make sure they're known before SSA generation (which is concurrent, and thus not safe to modify shared state like types). Might as well compute all local variable sizes too, to be consistent. Reduces the burden of the frontend to make sure it's calculated the size of types that only the backend cares about. Passes toolstash -cmp. Change-Id: I68bcca67b4640bfc875467e4ed4d47104b1932f4 Reviewed-on: https://go-review.googlesource.com/c/go/+/282912 Trust: Matthew Dempsky <mdempsky@google.com> Trust: Robert Griesemer <gri@golang.org> Run-TryBot: Matthew Dempsky <mdempsky@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org>
This commit is contained in:
parent
1ce0854157
commit
8c5aa42c79
1 changed files with 5 additions and 0 deletions
|
|
@ -57,6 +57,11 @@ func Walk(fn *ir.Func) {
|
||||||
if base.Flag.Cfg.Instrumenting {
|
if base.Flag.Cfg.Instrumenting {
|
||||||
instrument(fn)
|
instrument(fn)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Eagerly compute sizes of all variables for SSA.
|
||||||
|
for _, n := range fn.Dcl {
|
||||||
|
types.CalcSize(n.Type())
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func paramoutheap(fn *ir.Func) bool {
|
func paramoutheap(fn *ir.Func) bool {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue