diff options
| author | Matthew Dempsky <mdempsky@google.com> | 2021-08-27 17:57:04 -0700 |
|---|---|---|
| committer | Matthew Dempsky <mdempsky@google.com> | 2021-08-28 01:26:53 +0000 |
| commit | ef4cb2f776f1c7e861604d1b46ab8fcf2672f10d (patch) | |
| tree | fd56113c780f1114df24d7e5ddbf8c15c17c97d8 /src | |
| parent | 5fb177163bccb66a39516542e4b9e127ec771c1f (diff) | |
| download | go-ef4cb2f776f1c7e861604d1b46ab8fcf2672f10d.tar.xz | |
cmd/compile/internal/types: change NewNamed to use TypeObject
Semantically, TypeObject is the interface that go/types.TypeName would
implement, so we might as well use that instead of the more generic
Object (analog to go/types.Object) for NewNamed. In practice, this
doesn't really matter though, because we use *ir.Name for almost all
Objects anyway.
Also, remove VarObject: its last use was removed in CL 302071 (March
2021).
Change-Id: I6e987ecd419105e09f74fc8d60cadb61bcbc751f
Reviewed-on: https://go-review.googlesource.com/c/go/+/345810
Trust: Matthew Dempsky <mdempsky@google.com>
Run-TryBot: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Robert Griesemer <gri@golang.org>
TryBot-Result: Go Bot <gobot@golang.org>
Diffstat (limited to 'src')
| -rw-r--r-- | src/cmd/compile/internal/types/type.go | 8 |
1 files changed, 1 insertions, 7 deletions
diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go index dafd76c79a..f1fb93ad1b 100644 --- a/src/cmd/compile/internal/types/type.go +++ b/src/cmd/compile/internal/types/type.go @@ -27,12 +27,6 @@ type TypeObject interface { TypeDefn() *Type // for "type T Defn", returns Defn } -// A VarObject is an Object representing a function argument, variable, or struct field. -type VarObject interface { - Object - RecordFrameOffset(int64) // save frame offset -} - //go:generate stringer -type Kind -trimprefix T type.go // Kind describes a kind of type. @@ -1726,7 +1720,7 @@ var ( // type should be set later via SetUnderlying(). References to the type are // maintained until the type is filled in, so those references can be updated when // the type is complete. -func NewNamed(obj Object) *Type { +func NewNamed(obj TypeObject) *Type { t := newType(TFORW) t.sym = obj.Sym() t.nod = obj |
