aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/sym.go
diff options
context:
space:
mode:
authorDan Scales <danscales@google.com>2021-04-26 14:32:23 -0700
committerDan Scales <danscales@google.com>2021-05-07 21:35:41 +0000
commitf24eac47710b0170fd45611ab1867e87701e0a95 (patch)
tree485a45d4d3be76ca28f3fc6d0f18e994b86b25d4 /src/cmd/compile/internal/types/sym.go
parent3980c4db192783c6aefa0a5978e553046c9c7dea (diff)
downloadgo-f24eac47710b0170fd45611ab1867e87701e0a95.tar.gz
go-f24eac47710b0170fd45611ab1867e87701e0a95.zip
cmd/compile: improving the documentation of various fields and functions
This is only changes to comments, so should be fine to go into 1.17. Change-Id: I01e28dc76b03fb3ca846d976f8ac84bc2acb2ea2 Reviewed-on: https://go-review.googlesource.com/c/go/+/318009 Run-TryBot: Dan Scales <danscales@google.com> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/sym.go')
-rw-r--r--src/cmd/compile/internal/types/sym.go8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/types/sym.go b/src/cmd/compile/internal/types/sym.go
index 9a32a01a1a..534cf7e237 100644
--- a/src/cmd/compile/internal/types/sym.go
+++ b/src/cmd/compile/internal/types/sym.go
@@ -32,8 +32,12 @@ type Sym struct {
Pkg *Pkg
Name string // object name
- // saved and restored by Pushdcl/Popdcl
- Def Object // definition: ONAME OTYPE OPACK or OLITERAL
+ // Def, Block, and Lastlineno are saved and restored by Pushdcl/Popdcl.
+
+ // The unique ONAME, OTYPE, OPACK, or OLITERAL node that this symbol is
+ // bound to within the current scope. (Most parts of the compiler should
+ // prefer passing the Node directly, rather than relying on this field.)
+ Def Object
Block int32 // blocknumber to catch redeclaration
Lastlineno src.XPos // last declaration for diagnostic