diff options
author | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-04-27 08:30:41 +0700 |
---|---|---|
committer | Cuong Manh Le <cuong.manhle.vn@gmail.com> | 2021-04-27 02:39:52 +0000 |
commit | 434e12f77223e0915e29bcdaf2b214e52213f2ab (patch) | |
tree | 8e2431e3ee76657028b3a4a963736990266bbe48 /src/cmd/compile/internal/ir | |
parent | 15105dd4b56610e18fa4b5744c7deca069085bc5 (diff) | |
download | go-434e12f77223e0915e29bcdaf2b214e52213f2ab.tar.gz go-434e12f77223e0915e29bcdaf2b214e52213f2ab.zip |
cmd/compile: add more doc for Name.Defn
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>
Diffstat (limited to 'src/cmd/compile/internal/ir')
-rw-r--r-- | src/cmd/compile/internal/ir/name.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/cmd/compile/internal/ir/name.go b/src/cmd/compile/internal/ir/name.go index 5697213eac..b6c68bc5e0 100644 --- a/src/cmd/compile/internal/ir/name.go +++ b/src/cmd/compile/internal/ir/name.go @@ -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. |