]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/types: add Type.OrigSym getter/setters
authorMatthew Dempsky <mdempsky@google.com>
Fri, 27 Aug 2021 00:48:01 +0000 (17:48 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Fri, 27 Aug 2021 20:43:38 +0000 (20:43 +0000)
Will be used in the next CL, so that Type.OrigSym can be unexported.

Change-Id: I085f2a886abd419343c7ec7e4ae18c19de1fbbd4
Reviewed-on: https://go-review.googlesource.com/c/go/+/345484
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
TryBot-Result: Go Bot <gobot@golang.org>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
src/cmd/compile/internal/types/type.go

index 7861effcb2330963466b5a45f5abb12d16165320..c7c8a53654610f097c5bb21126a0e99f5b201ba1 100644 (file)
@@ -243,6 +243,11 @@ func (t *Type) Kind() Kind { return t.kind }
 func (t *Type) Sym() *Sym       { return t.sym }
 func (t *Type) SetSym(sym *Sym) { t.sym = sym }
 
+// OrigSym returns the name of the original generic type that t is an
+// instantiation of, if any.
+func (t *Type) OrigSym_() *Sym      { return t.OrigSym }
+func (t *Type) SetOrigSym(sym *Sym) { t.OrigSym = sym }
+
 // Underlying returns the underlying type of type t.
 func (t *Type) Underlying() *Type { return t.underlying }