From: Cuong Manh Le Date: Thu, 19 Sep 2019 15:07:00 +0000 (+0200) Subject: cmd/compile: add documentation for isfat X-Git-Tag: go1.14beta1~992 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=caf45cde1873360d326af974575bd254b8011901;p=gostls13.git cmd/compile: add documentation for isfat In CL 192980, I tend to think that canSSAType can be used as replacement for isfat. It is not the truth as @khr points me out that isfat has very different purpose. So this CL adds documentation for isfat, also remove outdated TODO. Change-Id: I15954d638759bd9f6b28a6aa04c1a51129d9ae7d Reviewed-on: https://go-review.googlesource.com/c/go/+/196499 Run-TryBot: Cuong Manh Le TryBot-Result: Gobot Gobot Reviewed-by: Matthew Dempsky --- diff --git a/src/cmd/compile/internal/gc/plive.go b/src/cmd/compile/internal/gc/plive.go index 6abbfe757e..16a752c893 100644 --- a/src/cmd/compile/internal/gc/plive.go +++ b/src/cmd/compile/internal/gc/plive.go @@ -1450,7 +1450,19 @@ func liveness(e *ssafn, f *ssa.Func, pp *Progs) LivenessMap { return lv.livenessMap } -// TODO(cuonglm,mdempsky): Revisit after #24416 is fixed. +// isfat reports whether a variable of type t needs multiple assignments to initialize. +// For example: +// +// type T struct { x, y int } +// x := T{x: 0, y: 1} +// +// Then we need: +// +// var t T +// t.x = 0 +// t.y = 1 +// +// to fully initialize t. func isfat(t *types.Type) bool { if t != nil { switch t.Etype {