[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>
This commit is contained in:
Russ Cox 2020-12-21 01:55:44 -05:00
parent cb28c96be8
commit 7c8f5356ab
8 changed files with 51 additions and 17 deletions

View file

@ -164,7 +164,7 @@ func (s *ssafn) AllocFrame(f *ssa.Func) {
dowidth(n.Type())
w := n.Type().Width
if w >= thearch.MAXWIDTH || w < 0 {
if w >= MaxWidth || w < 0 {
base.Fatalf("bad width")
}
if w == 0 && lastHasPtr {