]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: add documentation for isfat
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Thu, 19 Sep 2019 15:07:00 +0000 (17:07 +0200)
committerMatthew Dempsky <mdempsky@google.com>
Wed, 25 Sep 2019 03:53:20 +0000 (03:53 +0000)
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: Matthew Dempsky <mdempsky@google.com>
src/cmd/compile/internal/gc/plive.go

index 6abbfe757eb5b4892845c5f29e4335c5cb8e471c..16a752c893867efb7066987d1bd533eb477ad473 100644 (file)
@@ -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 {