]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/compile/internal/types: unexport Type.widthCalculated
authorMatthew Dempsky <mdempsky@google.com>
Sat, 28 Aug 2021 05:59:26 +0000 (22:59 -0700)
committerMatthew Dempsky <mdempsky@google.com>
Mon, 30 Aug 2021 02:40:46 +0000 (02:40 +0000)
It's not needed outside of package types anymore.

Change-Id: Idadf915fc254920ca778b5f5f8de8a1300da1953
Reviewed-on: https://go-review.googlesource.com/c/go/+/345794
Trust: Matthew Dempsky <mdempsky@google.com>
Reviewed-by: Cuong Manh Le <cuong.manhle.vn@gmail.com>
Run-TryBot: Cuong Manh Le <cuong.manhle.vn@gmail.com>
TryBot-Result: Go Bot <gobot@golang.org>

src/cmd/compile/internal/types/size.go
src/cmd/compile/internal/types/type.go

index a47a26da74a84b5ac7c5d47763b89c3e504ef50b..0f3db06c1decf32650f2bbd0949a720386414b05 100644 (file)
@@ -357,7 +357,7 @@ func CalcSize(t *Type) {
                return
        }
 
-       if t.WidthCalculated() {
+       if t.widthCalculated() {
                return
        }
 
@@ -570,6 +570,10 @@ func RecalcSize(t *Type) {
        CalcSize(t)
 }
 
+func (t *Type) widthCalculated() bool {
+       return t.align > 0
+}
+
 // when a type's width should be known, we call CheckSize
 // to compute it.  during a declaration like
 //
index c510a705f20051e8849cfe5163ec45e11fccbd7d..8fb8fb377f0ecb23d59101979e8b4a04abfa1a0b 100644 (file)
@@ -1060,7 +1060,7 @@ func (t *Type) SetFields(fields []*Field) {
        // Rather than try to track and invalidate those,
        // enforce that SetFields cannot be called once
        // t's width has been calculated.
-       if t.WidthCalculated() {
+       if t.widthCalculated() {
                base.Fatalf("SetFields of %v: width previously calculated", t)
        }
        t.wantEtype(TSTRUCT)
@@ -1084,10 +1084,6 @@ func (t *Type) SetInterface(methods []*Field) {
        t.Methods().Set(methods)
 }
 
-func (t *Type) WidthCalculated() bool {
-       return t.align > 0
-}
-
 // ArgWidth returns the total aligned argument size for a function.
 // It includes the receiver, parameters, and results.
 func (t *Type) ArgWidth() int64 {