From 7c8f5356abd7aadf32b028ce76a8a76cd5438258 Mon Sep 17 00:00:00 2001 From: Russ Cox Date: Mon, 21 Dec 2020 01:55:44 -0500 Subject: [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 Reviewed-by: Matthew Dempsky --- src/cmd/compile/internal/types/type.go | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'src/cmd/compile/internal/types/type.go') 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. -- cgit v1.2.3-54-g00ecf