cmd/compile/internal/gc: rename Fatal to Fatalf
This helps vet see a real issue:
cmd/internal/gc$ go vet
gen.go:1223: unreachable code
Fixes #12106.
Change-Id: I720868b07ae6b6d5a4dc6b238baa8c9c889da6d8
Reviewed-on: https://go-review.googlesource.com/14083
Reviewed-by: Minux Ma <minux@golang.org>
Run-TryBot: Minux Ma <minux@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Keith Randall <khr@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/src/cmd/compile/internal/gc/reflect.go b/src/cmd/compile/internal/gc/reflect.go
index 9463379..80257c1 100644
--- a/src/cmd/compile/internal/gc/reflect.go
+++ b/src/cmd/compile/internal/gc/reflect.go
@@ -364,13 +364,13 @@
var method *Sym
for f := mt.Xmethod; f != nil; f = f.Down {
if f.Etype != TFIELD {
- Fatal("methods: not field %v", f)
+ Fatalf("methods: not field %v", f)
}
if f.Type.Etype != TFUNC || f.Type.Thistuple == 0 {
- Fatal("non-method on %v method %v %v\n", mt, f.Sym, f)
+ Fatalf("non-method on %v method %v %v\n", mt, f.Sym, f)
}
if getthisx(f.Type).Type == nil {
- Fatal("receiver with no type on %v method %v %v\n", mt, f.Sym, f)
+ Fatalf("receiver with no type on %v method %v %v\n", mt, f.Sym, f)
}
if f.Nointerface {
continue
@@ -401,7 +401,7 @@
a.name = method.Name
if !exportname(method.Name) {
if method.Pkg == nil {
- Fatal("methods: missing package")
+ Fatalf("methods: missing package")
}
a.pkg = method.Pkg
}
@@ -445,7 +445,7 @@
var last *Sig
for f := t.Type; f != nil; f = f.Down {
if f.Etype != TFIELD {
- Fatal("imethods: not field")
+ Fatalf("imethods: not field")
}
if f.Type.Etype != TFUNC || f.Sym == nil {
continue
@@ -455,7 +455,7 @@
a.name = method.Name
if !exportname(method.Name) {
if method.Pkg == nil {
- Fatal("imethods: missing package")
+ Fatalf("imethods: missing package")
}
a.pkg = method.Pkg
}
@@ -465,7 +465,7 @@
a.type_ = methodfunc(f.Type, nil)
if last != nil && sigcmp(last, a) >= 0 {
- Fatal("sigcmp vs sortinter %s %s", last.name, a.name)
+ Fatalf("sigcmp vs sortinter %s %s", last.name, a.name)
}
if last == nil {
all = a
@@ -707,7 +707,7 @@
ret = true
case TFIELD:
- Fatal("haspointers: unexpected type, %v", t)
+ Fatalf("haspointers: unexpected type, %v", t)
}
t.Haspointers = 1 + uint8(obj.Bool2int(ret))
@@ -758,7 +758,7 @@
return lastPtrField.Width + typeptrdata(lastPtrField.Type)
default:
- Fatal("typeptrdata: unexpected type, %v", t)
+ Fatalf("typeptrdata: unexpected type, %v", t)
return 0
}
}
@@ -772,7 +772,7 @@
func dcommontype(s *Sym, ot int, t *Type) int {
if ot != 0 {
- Fatal("dcommontype %d", ot)
+ Fatalf("dcommontype %d", ot)
}
sizeofAlg := 2 * Widthptr
@@ -825,7 +825,7 @@
i = 1
}
if i&(i-1) != 0 {
- Fatal("invalid alignment %d for %v", t.Align, t)
+ Fatalf("invalid alignment %d for %v", t.Align, t)
}
ot = duint8(s, ot, t.Align) // align
ot = duint8(s, ot, t.Align) // fieldAlign
@@ -904,7 +904,7 @@
func typenamesym(t *Type) *Sym {
if t == nil || (Isptr[t.Etype] && t.Type == nil) || isideal(t) {
- Fatal("typename %v", t)
+ Fatalf("typename %v", t)
}
s := typesym(t)
if s.Def == nil {
@@ -977,7 +977,7 @@
case TARRAY:
if Isslice(t) {
- Fatal("slice can't be a map key: %v", t)
+ Fatalf("slice can't be a map key: %v", t)
}
return isreflexive(t.Type)
@@ -991,7 +991,7 @@
return true
default:
- Fatal("bad type for map key: %v", t)
+ Fatalf("bad type for map key: %v", t)
return false
}
}
@@ -1005,7 +1005,7 @@
}
if isideal(t) {
- Fatal("dtypesym %v", t)
+ Fatalf("dtypesym %v", t)
}
s := typesym(t)
@@ -1491,7 +1491,7 @@
func dgcprog(t *Type) (*Sym, int64) {
dowidth(t)
if t.Width == BADWIDTH {
- Fatal("dgcprog: %v badwidth", t)
+ Fatalf("dgcprog: %v badwidth", t)
}
sym := typesymprefix(".gcprog", t)
var p GCProg
@@ -1500,7 +1500,7 @@
offset := p.w.BitIndex() * int64(Widthptr)
p.end()
if ptrdata := typeptrdata(t); offset < ptrdata || offset > t.Width {
- Fatal("dgcprog: %v: offset=%d but ptrdata=%d size=%d", t, offset, ptrdata, t.Width)
+ Fatalf("dgcprog: %v: offset=%d but ptrdata=%d size=%d", t, offset, ptrdata, t.Width)
}
return sym, offset
}
@@ -1547,7 +1547,7 @@
}
switch t.Etype {
default:
- Fatal("GCProg.emit: unexpected type %v", t)
+ Fatalf("GCProg.emit: unexpected type %v", t)
case TSTRING:
p.w.Ptr(offset / int64(Widthptr))
@@ -1563,7 +1563,7 @@
}
if t.Bound == 0 {
// should have been handled by haspointers check above
- Fatal("GCProg.emit: empty array")
+ Fatalf("GCProg.emit: empty array")
}
// Flatten array-of-array-of-array to just a big array by multiplying counts.