mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
cmd/compile/internal/gc: unexport more helper functions
After the removal of the old backend many types are no longer referenced outside internal/gc. Make these functions private so that tools like honnef.co/go/unused can spot when they become dead code. In doing so this CL identified several previously public helpers which are no longer used, so removes them. This should be the last of the public functions. Change-Id: I7e9c4e72f86f391b428b9dddb6f0d516529706c3 Reviewed-on: https://go-review.googlesource.com/29134 Run-TryBot: Dave Cheney <dave@cheney.net> TryBot-Result: Gobot Gobot <gobot@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
This commit is contained in:
parent
896ac677b5
commit
d7012ca282
37 changed files with 713 additions and 720 deletions
|
|
@ -21,7 +21,7 @@ func offmod(t *Type) {
|
|||
f.Offset = int64(o)
|
||||
o += int32(Widthptr)
|
||||
if int64(o) >= Thearch.MAXWIDTH {
|
||||
Yyerror("interface too large")
|
||||
yyerror("interface too large")
|
||||
o = int32(Widthptr)
|
||||
}
|
||||
}
|
||||
|
|
@ -75,7 +75,7 @@ func widstruct(errtype *Type, t *Type, o int64, flag int) int64 {
|
|||
}
|
||||
o += w
|
||||
if o >= Thearch.MAXWIDTH {
|
||||
Yyerror("type %L too large", errtype)
|
||||
yyerror("type %L too large", errtype)
|
||||
o = 8 // small but nonzero
|
||||
}
|
||||
}
|
||||
|
|
@ -208,7 +208,7 @@ func dowidth(t *Type) {
|
|||
t1 := t.ChanArgs()
|
||||
dowidth(t1) // just in case
|
||||
if t1.Elem().Width >= 1<<16 {
|
||||
Yyerror("channel element type too large (>64kB)")
|
||||
yyerror("channel element type too large (>64kB)")
|
||||
}
|
||||
t.Width = 1
|
||||
|
||||
|
|
@ -219,7 +219,7 @@ func dowidth(t *Type) {
|
|||
|
||||
case TFORW: // should have been filled in
|
||||
if !t.Broke {
|
||||
Yyerror("invalid recursive type %v", t)
|
||||
yyerror("invalid recursive type %v", t)
|
||||
}
|
||||
w = 1 // anything will do
|
||||
|
||||
|
|
@ -243,7 +243,7 @@ func dowidth(t *Type) {
|
|||
}
|
||||
if t.isDDDArray() {
|
||||
if !t.Broke {
|
||||
Yyerror("use of [...] array outside of array literal")
|
||||
yyerror("use of [...] array outside of array literal")
|
||||
t.Broke = true
|
||||
}
|
||||
break
|
||||
|
|
@ -253,7 +253,7 @@ func dowidth(t *Type) {
|
|||
if t.Elem().Width != 0 {
|
||||
cap := (uint64(Thearch.MAXWIDTH) - 1) / uint64(t.Elem().Width)
|
||||
if uint64(t.NumElem()) > cap {
|
||||
Yyerror("type %L larger than address space", t)
|
||||
yyerror("type %L larger than address space", t)
|
||||
}
|
||||
}
|
||||
w = t.NumElem() * t.Elem().Width
|
||||
|
|
@ -295,7 +295,7 @@ func dowidth(t *Type) {
|
|||
}
|
||||
|
||||
if Widthptr == 4 && w != int64(int32(w)) {
|
||||
Yyerror("type %v too large", t)
|
||||
yyerror("type %v too large", t)
|
||||
}
|
||||
|
||||
t.Width = w
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue