From caf45cde1873360d326af974575bd254b8011901 Mon Sep 17 00:00:00 2001 From: Cuong Manh Le Date: Thu, 19 Sep 2019 17:07:00 +0200 Subject: [PATCH] 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 --- src/cmd/compile/internal/gc/plive.go | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) 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 { -- 2.50.0