aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/compile/internal/types/type.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2020-12-21 01:55:44 -0500
committerRuss Cox <rsc@golang.org>2020-12-22 19:31:57 +0000
commit7c8f5356abd7aadf32b028ce76a8a76cd5438258 (patch)
treedfa0df9dcdca4864abb46bd1c81309f2c3a0f24b /src/cmd/compile/internal/types/type.go
parentcb28c96be8b8010dd979e0723bf5a94b11962a93 (diff)
downloadgo-7c8f5356abd7aadf32b028ce76a8a76cd5438258.tar.gz
go-7c8f5356abd7aadf32b028ce76a8a76cd5438258.zip
[dev.regabi] cmd/compile: separate dowidth better
Having a global MaxWidth lets us avoid needing to refer to thearch from split-out packages when all they need is thearch.MAXWIDTH. And make a couple interface changes to let dowidth avoid importing package ir directly. Then it can move into package types. Change-Id: I2c12e8e22252597530e648848320e19bdd490a01 Reviewed-on: https://go-review.googlesource.com/c/go/+/279302 Trust: Russ Cox <rsc@golang.org> Reviewed-by: Matthew Dempsky <mdempsky@google.com>
Diffstat (limited to 'src/cmd/compile/internal/types/type.go')
-rw-r--r--src/cmd/compile/internal/types/type.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/cmd/compile/internal/types/type.go b/src/cmd/compile/internal/types/type.go
index 4d1d30133c..752c268fa2 100644
--- a/src/cmd/compile/internal/types/type.go
+++ b/src/cmd/compile/internal/types/type.go
@@ -20,6 +20,18 @@ type Object interface {
Type() *Type
}
+// A TypeObject is an Object representing a named type.
+type TypeObject interface {
+ Object
+ 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 EType -trimprefix T
// EType describes a kind of type.