]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile: add more doc for Name.Defn
authorCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 27 Apr 2021 01:30:41 +0000 (08:30 +0700)
committerCuong Manh Le <cuong.manhle.vn@gmail.com>
Tue, 27 Apr 2021 02:39:52 +0000 (02:39 +0000)
As discussion in CL 313289, Name.Defn is also be set for variables
declared in type switch, or name function.

Change-Id: I3deb3d79fca269356e4432b77df7c7720a523674
Reviewed-on: https://go-review.googlesource.com/c/go/+/313889
Trust: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Trust: Dan Scales <danscales@google.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Dan Scales <danscales@google.com>
src/cmd/compile/internal/ir/name.go

index 5697213eac59d88b065c8a6900e29428ebbd2d46..b6c68bc5e01a4b33d8b590f29658886446584fbf 100644 (file)
@@ -49,7 +49,9 @@ type Name struct {
 
        PkgName *PkgName // real package for import . names
        // For a local variable (not param) or extern, the initializing assignment (OAS or OAS2).
-       // For a closure var, the ONAME node of the outer captured variable
+       // For a closure var, the ONAME node of the outer captured variable.
+       // For the case-local variables of a type switch, the type switch guard (OTYPESW).
+       // For the name of a function, points to corresponding Func node.
        Defn Node
 
        // The function, method, or closure in which local variable or param is declared.