Commit caf45cde authored by Cuong Manh Le's avatar Cuong Manh Le Committed by Matthew Dempsky

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 <cuong.manhle.vn@gmail.com>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 54776230
...@@ -1450,7 +1450,19 @@ func liveness(e *ssafn, f *ssa.Func, pp *Progs) LivenessMap { ...@@ -1450,7 +1450,19 @@ func liveness(e *ssafn, f *ssa.Func, pp *Progs) LivenessMap {
return lv.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 { func isfat(t *types.Type) bool {
if t != nil { if t != nil {
switch t.Etype { switch t.Etype {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment