diff options
author | Matthew Dempsky <mdempsky@google.com> | 2021-08-26 12:05:45 -0700 |
---|---|---|
committer | Matthew Dempsky <mdempsky@google.com> | 2021-08-26 19:34:58 +0000 |
commit | eb6a07fcf99050c447097a8ff6358c484c0f8715 (patch) | |
tree | ac169b5c63e13f13bc1e490bc024d6ba1b6d9b88 /src/cmd/compile/internal/noder/decl.go | |
parent | 3836983779a8f1f1a1b6dc629832e695dcacaf36 (diff) | |
download | go-eb6a07fcf99050c447097a8ff6358c484c0f8715.tar.gz go-eb6a07fcf99050c447097a8ff6358c484c0f8715.zip |
cmd/compile: unexport Type.Vargen
This field is only used outside of packages types in two places, and
they follow the same pattern. So this CL creates a Type.Setvargen
function that they can use instead, so that Type.Vargen can be
unexported.
A bit clumsy, but it works for now.
Change-Id: I7b4f33fac635e2464df2fbc0607ab40902f6f09f
Reviewed-on: https://go-review.googlesource.com/c/go/+/345469
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src/cmd/compile/internal/noder/decl.go')
-rw-r--r-- | src/cmd/compile/internal/noder/decl.go | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/src/cmd/compile/internal/noder/decl.go b/src/cmd/compile/internal/noder/decl.go index b23dd47600..54a13b498b 100644 --- a/src/cmd/compile/internal/noder/decl.go +++ b/src/cmd/compile/internal/noder/decl.go @@ -154,8 +154,7 @@ func (g *irgen) typeDecl(out *ir.Nodes, decl *syntax.TypeDecl) { name, obj := g.def(decl.Name) ntyp, otyp := name.Type(), obj.Type() if ir.CurFunc != nil { - typecheck.TypeGen++ - ntyp.Vargen = typecheck.TypeGen + ntyp.SetVargen() } pragmas := g.pragmaFlags(decl.Pragma, typePragmas) |