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/gen.go b/src/cmd/compile/internal/gc/gen.go
index 764895f..4e03012 100644
--- a/src/cmd/compile/internal/gc/gen.go
+++ b/src/cmd/compile/internal/gc/gen.go
@@ -62,7 +62,7 @@
n.Name.Param.Stackparam.Type = n.Type
n.Name.Param.Stackparam.Addable = true
if n.Xoffset == BADWIDTH {
- Fatal("addrescapes before param assignment")
+ Fatalf("addrescapes before param assignment")
}
n.Name.Param.Stackparam.Xoffset = n.Xoffset
fallthrough
@@ -226,7 +226,7 @@
func cgen_proc(n *Node, proc int) {
switch n.Left.Op {
default:
- Fatal("cgen_proc: unknown call %v", Oconv(int(n.Left.Op), 0))
+ Fatalf("cgen_proc: unknown call %v", Oconv(int(n.Left.Op), 0))
case OCALLMETH:
cgen_callmeth(n.Left, proc)
@@ -250,7 +250,7 @@
}
if n.Op != ONAME {
Dump("cgen_dcl", n)
- Fatal("cgen_dcl")
+ Fatalf("cgen_dcl")
}
if n.Class&PHEAP == 0 {
@@ -360,7 +360,7 @@
Mpmovecfix(z.Val().U.(*Mpint), 0)
default:
- Fatal("clearslim called on type %v", n.Type)
+ Fatalf("clearslim called on type %v", n.Type)
}
ullmancalc(&z)
@@ -561,7 +561,7 @@
case ODOT:
if n.Xoffset == BADWIDTH {
Dump("bad width in dotoffset", n)
- Fatal("bad width in dotoffset")
+ Fatalf("bad width in dotoffset")
}
i = Dotoffset(n.Left, oary, nn)
@@ -582,7 +582,7 @@
case ODOTPTR:
if n.Xoffset == BADWIDTH {
Dump("bad width in dotoffset", n)
- Fatal("bad width in dotoffset")
+ Fatalf("bad width in dotoffset")
}
i = Dotoffset(n.Left, oary, nn)
@@ -607,7 +607,7 @@
*/
func Tempname(nn *Node, t *Type) {
if Curfn == nil {
- Fatal("no curfn for tempname")
+ Fatalf("no curfn for tempname")
}
if t == nil {
@@ -661,7 +661,7 @@
switch n.Op {
default:
- Fatal("gen: unknown op %v", Nconv(n, obj.FmtShort|obj.FmtSign))
+ Fatalf("gen: unknown op %v", Nconv(n, obj.FmtShort|obj.FmtSign))
case OCASE,
OFALL,
@@ -897,7 +897,7 @@
ret:
if Anyregalloc() != wasregalloc {
Dump("node", n)
- Fatal("registers left allocated")
+ Fatalf("registers left allocated")
}
lineno = lno
@@ -963,7 +963,7 @@
l := n.Left
if l.Op != ODOTMETH {
- Fatal("cgen_callmeth: not dotmethod: %v", l)
+ Fatalf("cgen_callmeth: not dotmethod: %v", l)
}
n2 := *n
@@ -1002,7 +1002,7 @@
}
if lab.Gotopc != nil {
- Fatal("label %v never resolved", lab.Sym)
+ Fatalf("label %v never resolved", lab.Sym)
}
for l = lab.Use; l != nil; l = l.Next {
checkgoto(l.N, lab.Def)
@@ -1136,7 +1136,7 @@
nodr = *nr
if !cadable(nr) {
if nr.Ullman >= UINF && nodl.Op == OINDREG {
- Fatal("miscompile")
+ Fatalf("miscompile")
}
Igen(nr, &nodr, nil)
defer Regfree(&nodr)
@@ -1157,7 +1157,7 @@
visitComponents(nl.Type, 0, func(t *Type, offset int64) bool {
if wb && int(Simtype[t.Etype]) == Tptr && t != itable {
if ptrType != nil {
- Fatal("componentgen_wb %v", Tconv(nl.Type, 0))
+ Fatalf("componentgen_wb %v", Tconv(nl.Type, 0))
}
ptrType = t
ptrOffset = offset
@@ -1197,7 +1197,7 @@
// NOTE: Assuming little endian (signed top half at offset 4).
// We don't have any 32-bit big-endian systems.
if Thearch.Thechar != '5' && Thearch.Thechar != '8' {
- Fatal("unknown 32-bit architecture")
+ Fatalf("unknown 32-bit architecture")
}
return f(Types[TUINT32], startOffset) &&
f(Types[TINT32], startOffset+4)
@@ -1254,12 +1254,12 @@
// in code introduced in CL 6932045 to fix issue #4518.
// But the test case in issue 4518 does not trigger this anymore,
// so maybe this complication is no longer needed.
- Fatal("struct not at offset 0")
+ Fatalf("struct not at offset 0")
}
for field := t.Type; field != nil; field = field.Down {
if field.Etype != TFIELD {
- Fatal("bad struct")
+ Fatalf("bad struct")
}
if !visitComponents(field.Type, startOffset+field.Width, f) {
return false