Commit 8f2e780e authored by Dave Cheney's avatar Dave Cheney

cmd/compile/internal: unexport gc.Oconv

Updates #15462

Semi automatic change with gofmt -r and hand fixups for callers outside
internal/gc.

All the uses of gc.Oconv outside cmd/compile/internal/gc were for the
Oconv(op, 0) form, which is already handled the Op.String method.

Replace the use of gc.Oconv(op, 0) with op itself, which will call
Op.String via the %v or %s verb. Unexport Oconv.

Change-Id: I84da2a2e4381b35f52efce427b2d6a3bccdf2526
Reviewed-on: https://go-review.googlesource.com/22496
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
parent 707aed03
...@@ -722,7 +722,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As { ...@@ -722,7 +722,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As {
a := obj.AXXX a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default: default:
gc.Fatalf("optoas: no entry %v-%v", gc.Oconv(op, 0), t) gc.Fatalf("optoas: no entry %v-%v", op, t)
case OADDR_ | gc.TPTR32: case OADDR_ | gc.TPTR32:
a = x86.ALEAL a = x86.ALEAL
......
...@@ -19,7 +19,7 @@ func cgen64(n *gc.Node, res *gc.Node) { ...@@ -19,7 +19,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
if res.Op != gc.OINDREG && res.Op != gc.ONAME { if res.Op != gc.OINDREG && res.Op != gc.ONAME {
gc.Dump("n", n) gc.Dump("n", n)
gc.Dump("res", res) gc.Dump("res", res)
gc.Fatalf("cgen64 %v of %v", gc.Oconv(n.Op, 0), gc.Oconv(res.Op, 0)) gc.Fatalf("cgen64 %v of %v", n.Op, res.Op)
} }
l := n.Left l := n.Left
...@@ -35,7 +35,7 @@ func cgen64(n *gc.Node, res *gc.Node) { ...@@ -35,7 +35,7 @@ func cgen64(n *gc.Node, res *gc.Node) {
split64(l, &lo1, &hi1) split64(l, &lo1, &hi1)
switch n.Op { switch n.Op {
default: default:
gc.Fatalf("cgen64 %v", gc.Oconv(n.Op, 0)) gc.Fatalf("cgen64 %v", n.Op)
case gc.OMINUS: case gc.OMINUS:
var lo2 gc.Node var lo2 gc.Node
...@@ -793,7 +793,7 @@ func cmp64(nl *gc.Node, nr *gc.Node, op gc.Op, likely int, to *obj.Prog) { ...@@ -793,7 +793,7 @@ func cmp64(nl *gc.Node, nr *gc.Node, op gc.Op, likely int, to *obj.Prog) {
var br *obj.Prog var br *obj.Prog
switch op { switch op {
default: default:
gc.Fatalf("cmp64 %v %v", gc.Oconv(op, 0), t) gc.Fatalf("cmp64 %v %v", op, t)
// cmp hi // cmp hi
// bne L // bne L
......
...@@ -719,7 +719,7 @@ func raddr(n *gc.Node, p *obj.Prog) { ...@@ -719,7 +719,7 @@ func raddr(n *gc.Node, p *obj.Prog) {
gc.Naddr(&a, n) gc.Naddr(&a, n)
if a.Type != obj.TYPE_REG { if a.Type != obj.TYPE_REG {
if n != nil { if n != nil {
gc.Fatalf("bad in raddr: %v", gc.Oconv(n.Op, 0)) gc.Fatalf("bad in raddr: %v", n.Op)
} else { } else {
gc.Fatalf("bad in raddr: <null>") gc.Fatalf("bad in raddr: <null>")
} }
...@@ -790,7 +790,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As { ...@@ -790,7 +790,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As {
a := obj.AXXX a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default: default:
gc.Fatalf("optoas: no entry %v-%v etype %v simtype %v", gc.Oconv(op, 0), t, gc.Types[t.Etype], gc.Types[gc.Simtype[t.Etype]]) gc.Fatalf("optoas: no entry %v-%v etype %v simtype %v", op, t, gc.Types[t.Etype], gc.Types[gc.Simtype[t.Etype]])
/* case CASE(OADDR, TPTR32): /* case CASE(OADDR, TPTR32):
a = ALEAL; a = ALEAL;
......
...@@ -567,7 +567,7 @@ func raddr(n *gc.Node, p *obj.Prog) { ...@@ -567,7 +567,7 @@ func raddr(n *gc.Node, p *obj.Prog) {
gc.Naddr(&a, n) gc.Naddr(&a, n)
if a.Type != obj.TYPE_REG { if a.Type != obj.TYPE_REG {
if n != nil { if n != nil {
gc.Fatalf("bad in raddr: %v", gc.Oconv(n.Op, 0)) gc.Fatalf("bad in raddr: %v", n.Op)
} else { } else {
gc.Fatalf("bad in raddr: <null>") gc.Fatalf("bad in raddr: <null>")
} }
...@@ -579,7 +579,7 @@ func raddr(n *gc.Node, p *obj.Prog) { ...@@ -579,7 +579,7 @@ func raddr(n *gc.Node, p *obj.Prog) {
func gcmp(as obj.As, lhs *gc.Node, rhs *gc.Node) *obj.Prog { func gcmp(as obj.As, lhs *gc.Node, rhs *gc.Node) *obj.Prog {
if lhs.Op != gc.OREGISTER { if lhs.Op != gc.OREGISTER {
gc.Fatalf("bad operands to gcmp: %v %v", gc.Oconv(lhs.Op, 0), gc.Oconv(rhs.Op, 0)) gc.Fatalf("bad operands to gcmp: %v %v", lhs.Op, rhs.Op)
} }
p := rawgins(as, rhs, nil) p := rawgins(as, rhs, nil)
...@@ -622,7 +622,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As { ...@@ -622,7 +622,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As {
a := obj.AXXX a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default: default:
gc.Fatalf("optoas: no entry for op=%v type=%v", gc.Oconv(op, 0), t) gc.Fatalf("optoas: no entry for op=%v type=%v", op, t)
case OEQ_ | gc.TBOOL, case OEQ_ | gc.TBOOL,
OEQ_ | gc.TINT8, OEQ_ | gc.TINT8,
......
...@@ -501,7 +501,7 @@ func (p *exporter) obj(sym *Sym) { ...@@ -501,7 +501,7 @@ func (p *exporter) obj(sym *Sym) {
} }
default: default:
Fatalf("exporter: unexpected export symbol: %v %v", Oconv(n.Op, 0), sym) Fatalf("exporter: unexpected export symbol: %v %v", oconv(n.Op, 0), sym)
} }
} }
......
...@@ -1807,7 +1807,7 @@ func bgenx(n, res *Node, wantTrue bool, likely int, to *obj.Prog) { ...@@ -1807,7 +1807,7 @@ func bgenx(n, res *Node, wantTrue bool, likely int, to *obj.Prog) {
} }
if !n.Type.IsBoolean() { if !n.Type.IsBoolean() {
Fatalf("bgen: bad type %v for %v", n.Type, Oconv(n.Op, 0)) Fatalf("bgen: bad type %v for %v", n.Type, oconv(n.Op, 0))
} }
for n.Op == OCONVNOP { for n.Op == OCONVNOP {
...@@ -2454,7 +2454,7 @@ func Ginscall(f *Node, proc int) { ...@@ -2454,7 +2454,7 @@ func Ginscall(f *Node, proc int) {
func cgen_callinter(n *Node, res *Node, proc int) { func cgen_callinter(n *Node, res *Node, proc int) {
i := n.Left i := n.Left
if i.Op != ODOTINTER { if i.Op != ODOTINTER {
Fatalf("cgen_callinter: not ODOTINTER %v", Oconv(i.Op, 0)) Fatalf("cgen_callinter: not ODOTINTER %v", oconv(i.Op, 0))
} }
i = i.Left // interface i = i.Left // interface
......
...@@ -695,7 +695,7 @@ func evconst(n *Node) { ...@@ -695,7 +695,7 @@ func evconst(n *Node) {
switch uint32(n.Op)<<16 | uint32(v.Ctype()) { switch uint32(n.Op)<<16 | uint32(v.Ctype()) {
default: default:
if n.Diag == 0 { if n.Diag == 0 {
Yyerror("illegal constant expression %v %v", Oconv(n.Op, 0), nl.Type) Yyerror("illegal constant expression %v %v", oconv(n.Op, 0), nl.Type)
n.Diag = 1 n.Diag = 1
} }
return return
...@@ -1179,7 +1179,7 @@ setfalse: ...@@ -1179,7 +1179,7 @@ setfalse:
illegal: illegal:
if n.Diag == 0 { if n.Diag == 0 {
Yyerror("illegal constant expression: %v %v %v", nl.Type, Oconv(n.Op, 0), nr.Type) Yyerror("illegal constant expression: %v %v %v", nl.Type, oconv(n.Op, 0), nr.Type)
n.Diag = 1 n.Diag = 1
} }
} }
......
...@@ -399,7 +399,7 @@ func Complexgen(n *Node, res *Node) { ...@@ -399,7 +399,7 @@ func Complexgen(n *Node, res *Node) {
switch n.Op { switch n.Op {
default: default:
Dump("complexgen: unknown op", n) Dump("complexgen: unknown op", n)
Fatalf("complexgen: unknown op %v", Oconv(n.Op, 0)) Fatalf("complexgen: unknown op %v", oconv(n.Op, 0))
case ODOT, case ODOT,
ODOTPTR, ODOTPTR,
...@@ -458,7 +458,7 @@ func Complexgen(n *Node, res *Node) { ...@@ -458,7 +458,7 @@ func Complexgen(n *Node, res *Node) {
switch n.Op { switch n.Op {
default: default:
Fatalf("complexgen: unknown op %v", Oconv(n.Op, 0)) Fatalf("complexgen: unknown op %v", oconv(n.Op, 0))
case OCONV: case OCONV:
Complexmove(nl, res) Complexmove(nl, res)
......
...@@ -551,7 +551,7 @@ func funchdr(n *Node) { ...@@ -551,7 +551,7 @@ func funchdr(n *Node) {
func funcargs(nt *Node) { func funcargs(nt *Node) {
if nt.Op != OTFUNC { if nt.Op != OTFUNC {
Fatalf("funcargs %v", Oconv(nt.Op, 0)) Fatalf("funcargs %v", oconv(nt.Op, 0))
} }
// re-start the variable generation number // re-start the variable generation number
...@@ -565,7 +565,7 @@ func funcargs(nt *Node) { ...@@ -565,7 +565,7 @@ func funcargs(nt *Node) {
if nt.Left != nil { if nt.Left != nil {
n := nt.Left n := nt.Left
if n.Op != ODCLFIELD { if n.Op != ODCLFIELD {
Fatalf("funcargs receiver %v", Oconv(n.Op, 0)) Fatalf("funcargs receiver %v", oconv(n.Op, 0))
} }
if n.Left != nil { if n.Left != nil {
n.Left.Op = ONAME n.Left.Op = ONAME
...@@ -580,7 +580,7 @@ func funcargs(nt *Node) { ...@@ -580,7 +580,7 @@ func funcargs(nt *Node) {
for _, n := range nt.List.Slice() { for _, n := range nt.List.Slice() {
if n.Op != ODCLFIELD { if n.Op != ODCLFIELD {
Fatalf("funcargs in %v", Oconv(n.Op, 0)) Fatalf("funcargs in %v", oconv(n.Op, 0))
} }
if n.Left != nil { if n.Left != nil {
n.Left.Op = ONAME n.Left.Op = ONAME
...@@ -598,7 +598,7 @@ func funcargs(nt *Node) { ...@@ -598,7 +598,7 @@ func funcargs(nt *Node) {
var i int = 0 var i int = 0
for _, n := range nt.Rlist.Slice() { for _, n := range nt.Rlist.Slice() {
if n.Op != ODCLFIELD { if n.Op != ODCLFIELD {
Fatalf("funcargs out %v", Oconv(n.Op, 0)) Fatalf("funcargs out %v", oconv(n.Op, 0))
} }
if n.Left == nil { if n.Left == nil {
......
...@@ -998,8 +998,8 @@ func escassign(e *EscState, dst, src *Node, step *EscStep) { ...@@ -998,8 +998,8 @@ func escassign(e *EscState, dst, src *Node, step *EscStep) {
if Debug['m'] > 2 { if Debug['m'] > 2 {
fmt.Printf("%v:[%d] %v escassign: %v(%v)[%v] = %v(%v)[%v]\n", fmt.Printf("%v:[%d] %v escassign: %v(%v)[%v] = %v(%v)[%v]\n",
linestr(lineno), e.loopdepth, funcSym(Curfn), linestr(lineno), e.loopdepth, funcSym(Curfn),
Nconv(dst, FmtShort), Jconv(dst, FmtShort), Oconv(dst.Op, 0), Nconv(dst, FmtShort), Jconv(dst, FmtShort), oconv(dst.Op, 0),
Nconv(src, FmtShort), Jconv(src, FmtShort), Oconv(src.Op, 0)) Nconv(src, FmtShort), Jconv(src, FmtShort), oconv(src.Op, 0))
} }
setlineno(dst) setlineno(dst)
...@@ -1741,7 +1741,7 @@ func escwalkBody(e *EscState, level Level, dst *Node, src *Node, step *EscStep, ...@@ -1741,7 +1741,7 @@ func escwalkBody(e *EscState, level Level, dst *Node, src *Node, step *EscStep,
if Debug['m'] > 2 { if Debug['m'] > 2 {
fmt.Printf("escwalk: level:%d depth:%d %.*s op=%v %v(%v) scope:%v[%d] extraloopdepth=%v\n", fmt.Printf("escwalk: level:%d depth:%d %.*s op=%v %v(%v) scope:%v[%d] extraloopdepth=%v\n",
level, e.pdepth, e.pdepth, "\t\t\t\t\t\t\t\t\t\t", Oconv(src.Op, 0), Nconv(src, FmtShort), Jconv(src, FmtShort), e.curfnSym(src), srcE.Escloopdepth, extraloopdepth) level, e.pdepth, e.pdepth, "\t\t\t\t\t\t\t\t\t\t", oconv(src.Op, 0), Nconv(src, FmtShort), Jconv(src, FmtShort), e.curfnSym(src), srcE.Escloopdepth, extraloopdepth)
} }
e.pdepth++ e.pdepth++
......
...@@ -354,7 +354,7 @@ func dumpsym(s *Sym) { ...@@ -354,7 +354,7 @@ func dumpsym(s *Sym) {
switch s.Def.Op { switch s.Def.Op {
default: default:
Yyerror("unexpected export symbol: %v %v", Oconv(s.Def.Op, 0), s) Yyerror("unexpected export symbol: %v %v", oconv(s.Def.Op, 0), s)
case OLITERAL: case OLITERAL:
dumpexportconst(s) dumpexportconst(s)
......
...@@ -193,7 +193,7 @@ var goopnames = []string{ ...@@ -193,7 +193,7 @@ var goopnames = []string{
} }
// Fmt "%O": Node opcodes // Fmt "%O": Node opcodes
func Oconv(o Op, flag FmtFlag) string { func oconv(o Op, flag FmtFlag) string {
if (flag&FmtSharp != 0) || fmtmode != FDbg { if (flag&FmtSharp != 0) || fmtmode != FDbg {
if o >= 0 && int(o) < len(goopnames) && goopnames[o] != "" { if o >= 0 && int(o) < len(goopnames) && goopnames[o] != "" {
return goopnames[o] return goopnames[o]
...@@ -454,7 +454,7 @@ func (e EType) String() string { ...@@ -454,7 +454,7 @@ func (e EType) String() string {
} }
func (o Op) String() string { func (o Op) String() string {
return Oconv(o, 0) return oconv(o, 0)
} }
// Fmt "%S": syms // Fmt "%S": syms
...@@ -840,7 +840,7 @@ func stmtfmt(n *Node) string { ...@@ -840,7 +840,7 @@ func stmtfmt(n *Node) string {
break break
} }
f += fmt.Sprintf("%v %v= %v", n.Left, Oconv(Op(n.Etype), FmtSharp), n.Right) f += fmt.Sprintf("%v %v= %v", n.Left, oconv(Op(n.Etype), FmtSharp), n.Right)
case OAS2: case OAS2:
if n.Colas && !complexinit { if n.Colas && !complexinit {
...@@ -914,11 +914,11 @@ func stmtfmt(n *Node) string { ...@@ -914,11 +914,11 @@ func stmtfmt(n *Node) string {
case OSELECT, OSWITCH: case OSELECT, OSWITCH:
if fmtmode == FErr { if fmtmode == FErr {
f += fmt.Sprintf("%v statement", Oconv(n.Op, 0)) f += fmt.Sprintf("%v statement", oconv(n.Op, 0))
break break
} }
f += Oconv(n.Op, FmtSharp) f += oconv(n.Op, FmtSharp)
if simpleinit { if simpleinit {
f += fmt.Sprintf(" %v;", n.Ninit.First()) f += fmt.Sprintf(" %v;", n.Ninit.First())
} }
...@@ -941,9 +941,9 @@ func stmtfmt(n *Node) string { ...@@ -941,9 +941,9 @@ func stmtfmt(n *Node) string {
OFALL, OFALL,
OXFALL: OXFALL:
if n.Left != nil { if n.Left != nil {
f += fmt.Sprintf("%v %v", Oconv(n.Op, FmtSharp), n.Left) f += fmt.Sprintf("%v %v", oconv(n.Op, FmtSharp), n.Left)
} else { } else {
f += Oconv(n.Op, FmtSharp) f += oconv(n.Op, FmtSharp)
} }
case OEMPTY: case OEMPTY:
...@@ -1337,7 +1337,7 @@ func exprfmt(n *Node, prec int) string { ...@@ -1337,7 +1337,7 @@ func exprfmt(n *Node, prec int) string {
return buf.String() return buf.String()
case OCOPY, OCOMPLEX: case OCOPY, OCOMPLEX:
return fmt.Sprintf("%v(%v, %v)", Oconv(n.Op, FmtSharp), n.Left, n.Right) return fmt.Sprintf("%v(%v, %v)", oconv(n.Op, FmtSharp), n.Left, n.Right)
case OCONV, case OCONV,
OCONVIFACE, OCONVIFACE,
...@@ -1369,12 +1369,12 @@ func exprfmt(n *Node, prec int) string { ...@@ -1369,12 +1369,12 @@ func exprfmt(n *Node, prec int) string {
OPRINT, OPRINT,
OPRINTN: OPRINTN:
if n.Left != nil { if n.Left != nil {
return fmt.Sprintf("%v(%v)", Oconv(n.Op, FmtSharp), n.Left) return fmt.Sprintf("%v(%v)", oconv(n.Op, FmtSharp), n.Left)
} }
if n.Isddd { if n.Isddd {
return fmt.Sprintf("%v(%v...)", Oconv(n.Op, FmtSharp), Hconv(n.List, FmtComma)) return fmt.Sprintf("%v(%v...)", oconv(n.Op, FmtSharp), Hconv(n.List, FmtComma))
} }
return fmt.Sprintf("%v(%v)", Oconv(n.Op, FmtSharp), Hconv(n.List, FmtComma)) return fmt.Sprintf("%v(%v)", oconv(n.Op, FmtSharp), Hconv(n.List, FmtComma))
case OCALL, OCALLFUNC, OCALLINTER, OCALLMETH, OGETG: case OCALL, OCALLFUNC, OCALLINTER, OCALLMETH, OGETG:
var f string var f string
...@@ -1408,9 +1408,9 @@ func exprfmt(n *Node, prec int) string { ...@@ -1408,9 +1408,9 @@ func exprfmt(n *Node, prec int) string {
ORECV: ORECV:
var f string var f string
if n.Left.Op == n.Op { if n.Left.Op == n.Op {
f += fmt.Sprintf("%v ", Oconv(n.Op, FmtSharp)) f += fmt.Sprintf("%v ", oconv(n.Op, FmtSharp))
} else { } else {
f += Oconv(n.Op, FmtSharp) f += oconv(n.Op, FmtSharp)
} }
f += exprfmt(n.Left, nprec+1) f += exprfmt(n.Left, nprec+1)
return f return f
...@@ -1439,7 +1439,7 @@ func exprfmt(n *Node, prec int) string { ...@@ -1439,7 +1439,7 @@ func exprfmt(n *Node, prec int) string {
var f string var f string
f += exprfmt(n.Left, nprec) f += exprfmt(n.Left, nprec)
f += fmt.Sprintf(" %v ", Oconv(n.Op, FmtSharp)) f += fmt.Sprintf(" %v ", oconv(n.Op, FmtSharp))
f += exprfmt(n.Right, nprec+1) f += exprfmt(n.Right, nprec+1)
return f return f
...@@ -1460,7 +1460,7 @@ func exprfmt(n *Node, prec int) string { ...@@ -1460,7 +1460,7 @@ func exprfmt(n *Node, prec int) string {
var f string var f string
f += exprfmt(n.Left, nprec) f += exprfmt(n.Left, nprec)
// TODO(marvin): Fix Node.EType type union. // TODO(marvin): Fix Node.EType type union.
f += fmt.Sprintf(" %v ", Oconv(Op(n.Etype), FmtSharp)) f += fmt.Sprintf(" %v ", oconv(Op(n.Etype), FmtSharp))
f += exprfmt(n.Right, nprec+1) f += exprfmt(n.Right, nprec+1)
return f return f
...@@ -1472,7 +1472,7 @@ func exprfmt(n *Node, prec int) string { ...@@ -1472,7 +1472,7 @@ func exprfmt(n *Node, prec int) string {
} }
} }
return fmt.Sprintf("<node %v>", Oconv(n.Op, 0)) return fmt.Sprintf("<node %v>", oconv(n.Op, 0))
} }
func nodefmt(n *Node, flag FmtFlag) string { func nodefmt(n *Node, flag FmtFlag) string {
...@@ -1527,40 +1527,40 @@ func nodedump(n *Node, flag FmtFlag) string { ...@@ -1527,40 +1527,40 @@ func nodedump(n *Node, flag FmtFlag) string {
} }
if n.Ninit.Len() != 0 { if n.Ninit.Len() != 0 {
fmt.Fprintf(&buf, "%v-init%v", Oconv(n.Op, 0), n.Ninit) fmt.Fprintf(&buf, "%v-init%v", oconv(n.Op, 0), n.Ninit)
indent(&buf) indent(&buf)
} }
} }
switch n.Op { switch n.Op {
default: default:
fmt.Fprintf(&buf, "%v%v", Oconv(n.Op, 0), Jconv(n, 0)) fmt.Fprintf(&buf, "%v%v", oconv(n.Op, 0), Jconv(n, 0))
case OREGISTER, OINDREG: case OREGISTER, OINDREG:
fmt.Fprintf(&buf, "%v-%v%v", Oconv(n.Op, 0), obj.Rconv(int(n.Reg)), Jconv(n, 0)) fmt.Fprintf(&buf, "%v-%v%v", oconv(n.Op, 0), obj.Rconv(int(n.Reg)), Jconv(n, 0))
case OLITERAL: case OLITERAL:
fmt.Fprintf(&buf, "%v-%v%v", Oconv(n.Op, 0), Vconv(n.Val(), 0), Jconv(n, 0)) fmt.Fprintf(&buf, "%v-%v%v", oconv(n.Op, 0), Vconv(n.Val(), 0), Jconv(n, 0))
case ONAME, ONONAME: case ONAME, ONONAME:
if n.Sym != nil { if n.Sym != nil {
fmt.Fprintf(&buf, "%v-%v%v", Oconv(n.Op, 0), n.Sym, Jconv(n, 0)) fmt.Fprintf(&buf, "%v-%v%v", oconv(n.Op, 0), n.Sym, Jconv(n, 0))
} else { } else {
fmt.Fprintf(&buf, "%v%v", Oconv(n.Op, 0), Jconv(n, 0)) fmt.Fprintf(&buf, "%v%v", oconv(n.Op, 0), Jconv(n, 0))
} }
if recur && n.Type == nil && n.Name != nil && n.Name.Param != nil && n.Name.Param.Ntype != nil { if recur && n.Type == nil && n.Name != nil && n.Name.Param != nil && n.Name.Param.Ntype != nil {
indent(&buf) indent(&buf)
fmt.Fprintf(&buf, "%v-ntype%v", Oconv(n.Op, 0), n.Name.Param.Ntype) fmt.Fprintf(&buf, "%v-ntype%v", oconv(n.Op, 0), n.Name.Param.Ntype)
} }
case OASOP: case OASOP:
fmt.Fprintf(&buf, "%v-%v%v", Oconv(n.Op, 0), Oconv(Op(n.Etype), 0), Jconv(n, 0)) fmt.Fprintf(&buf, "%v-%v%v", oconv(n.Op, 0), oconv(Op(n.Etype), 0), Jconv(n, 0))
case OTYPE: case OTYPE:
fmt.Fprintf(&buf, "%v %v%v type=%v", Oconv(n.Op, 0), n.Sym, Jconv(n, 0), n.Type) fmt.Fprintf(&buf, "%v %v%v type=%v", oconv(n.Op, 0), n.Sym, Jconv(n, 0), n.Type)
if recur && n.Type == nil && n.Name.Param.Ntype != nil { if recur && n.Type == nil && n.Name.Param.Ntype != nil {
indent(&buf) indent(&buf)
fmt.Fprintf(&buf, "%v-ntype%v", Oconv(n.Op, 0), n.Name.Param.Ntype) fmt.Fprintf(&buf, "%v-ntype%v", oconv(n.Op, 0), n.Name.Param.Ntype)
} }
} }
...@@ -1581,17 +1581,17 @@ func nodedump(n *Node, flag FmtFlag) string { ...@@ -1581,17 +1581,17 @@ func nodedump(n *Node, flag FmtFlag) string {
} }
if n.List.Len() != 0 { if n.List.Len() != 0 {
indent(&buf) indent(&buf)
fmt.Fprintf(&buf, "%v-list%v", Oconv(n.Op, 0), n.List) fmt.Fprintf(&buf, "%v-list%v", oconv(n.Op, 0), n.List)
} }
if n.Rlist.Len() != 0 { if n.Rlist.Len() != 0 {
indent(&buf) indent(&buf)
fmt.Fprintf(&buf, "%v-rlist%v", Oconv(n.Op, 0), n.Rlist) fmt.Fprintf(&buf, "%v-rlist%v", oconv(n.Op, 0), n.Rlist)
} }
if n.Nbody.Len() != 0 { if n.Nbody.Len() != 0 {
indent(&buf) indent(&buf)
fmt.Fprintf(&buf, "%v-body%v", Oconv(n.Op, 0), n.Nbody) fmt.Fprintf(&buf, "%v-body%v", oconv(n.Op, 0), n.Nbody)
} }
} }
......
...@@ -218,7 +218,7 @@ func Genlist(l Nodes) { ...@@ -218,7 +218,7 @@ func Genlist(l Nodes) {
func cgen_proc(n *Node, proc int) { func cgen_proc(n *Node, proc int) {
switch n.Left.Op { switch n.Left.Op {
default: default:
Fatalf("cgen_proc: unknown call %v", Oconv(n.Left.Op, 0)) Fatalf("cgen_proc: unknown call %v", oconv(n.Left.Op, 0))
case OCALLMETH: case OCALLMETH:
cgen_callmeth(n.Left, proc) cgen_callmeth(n.Left, proc)
......
...@@ -327,7 +327,7 @@ func Naddr(a *obj.Addr, n *Node) { ...@@ -327,7 +327,7 @@ func Naddr(a *obj.Addr, n *Node) {
a := a // copy to let escape into Ctxt.Dconv a := a // copy to let escape into Ctxt.Dconv
Debug['h'] = 1 Debug['h'] = 1
Dump("naddr", n) Dump("naddr", n)
Fatalf("naddr: bad %v %v", Oconv(n.Op, 0), Ctxt.Dconv(a)) Fatalf("naddr: bad %v %v", oconv(n.Op, 0), Ctxt.Dconv(a))
case OREGISTER: case OREGISTER:
a.Type = obj.TYPE_REG a.Type = obj.TYPE_REG
...@@ -422,7 +422,7 @@ func Naddr(a *obj.Addr, n *Node) { ...@@ -422,7 +422,7 @@ func Naddr(a *obj.Addr, n *Node) {
if !n.Left.Type.IsStruct() || n.Left.Type.Field(0).Sym != n.Sym { if !n.Left.Type.IsStruct() || n.Left.Type.Field(0).Sym != n.Sym {
Debug['h'] = 1 Debug['h'] = 1
Dump("naddr", n) Dump("naddr", n)
Fatalf("naddr: bad %v %v", Oconv(n.Op, 0), Ctxt.Dconv(a)) Fatalf("naddr: bad %v %v", oconv(n.Op, 0), Ctxt.Dconv(a))
} }
Naddr(a, n.Left) Naddr(a, n.Left)
...@@ -465,7 +465,7 @@ func Naddr(a *obj.Addr, n *Node) { ...@@ -465,7 +465,7 @@ func Naddr(a *obj.Addr, n *Node) {
} }
if a.Type != obj.TYPE_MEM { if a.Type != obj.TYPE_MEM {
a := a // copy to let escape into Ctxt.Dconv a := a // copy to let escape into Ctxt.Dconv
Fatalf("naddr: OADDR %v (from %v)", Ctxt.Dconv(a), Oconv(n.Left.Op, 0)) Fatalf("naddr: OADDR %v (from %v)", Ctxt.Dconv(a), oconv(n.Left.Op, 0))
} }
a.Type = obj.TYPE_ADDR a.Type = obj.TYPE_ADDR
......
...@@ -165,7 +165,7 @@ func ordersafeexpr(n *Node, order *Order) *Node { ...@@ -165,7 +165,7 @@ func ordersafeexpr(n *Node, order *Order) *Node {
a.Right = r a.Right = r
return typecheck(&a, Erv) return typecheck(&a, Erv)
default: default:
Fatalf("ordersafeexpr %v", Oconv(n.Op, 0)) Fatalf("ordersafeexpr %v", oconv(n.Op, 0))
return nil // not reached return nil // not reached
} }
} }
...@@ -416,7 +416,7 @@ func ordercall(n *Node, order *Order) { ...@@ -416,7 +416,7 @@ func ordercall(n *Node, order *Order) {
func ordermapassign(n *Node, order *Order) { func ordermapassign(n *Node, order *Order) {
switch n.Op { switch n.Op {
default: default:
Fatalf("ordermapassign %v", Oconv(n.Op, 0)) Fatalf("ordermapassign %v", oconv(n.Op, 0))
case OAS: case OAS:
order.out = append(order.out, n) order.out = append(order.out, n)
...@@ -478,7 +478,7 @@ func orderstmt(n *Node, order *Order) { ...@@ -478,7 +478,7 @@ func orderstmt(n *Node, order *Order) {
switch n.Op { switch n.Op {
default: default:
Fatalf("orderstmt %v", Oconv(n.Op, 0)) Fatalf("orderstmt %v", oconv(n.Op, 0))
case OVARKILL, OVARLIVE: case OVARKILL, OVARLIVE:
order.out = append(order.out, n) order.out = append(order.out, n)
...@@ -790,7 +790,7 @@ func orderstmt(n *Node, order *Order) { ...@@ -790,7 +790,7 @@ func orderstmt(n *Node, order *Order) {
var r *Node var r *Node
for _, n2 := range n.List.Slice() { for _, n2 := range n.List.Slice() {
if n2.Op != OXCASE { if n2.Op != OXCASE {
Fatalf("order select case %v", Oconv(n2.Op, 0)) Fatalf("order select case %v", oconv(n2.Op, 0))
} }
r = n2.Left r = n2.Left
setlineno(n2) setlineno(n2)
...@@ -803,7 +803,7 @@ func orderstmt(n *Node, order *Order) { ...@@ -803,7 +803,7 @@ func orderstmt(n *Node, order *Order) {
if r != nil { if r != nil {
switch r.Op { switch r.Op {
default: default:
Yyerror("unknown op in select %v", Oconv(r.Op, 0)) Yyerror("unknown op in select %v", oconv(r.Op, 0))
Dump("select case", r) Dump("select case", r)
// If this is case x := <-ch or case x, y := <-ch, the case has // If this is case x := <-ch or case x, y := <-ch, the case has
...@@ -943,7 +943,7 @@ func orderstmt(n *Node, order *Order) { ...@@ -943,7 +943,7 @@ func orderstmt(n *Node, order *Order) {
n.Left = orderexpr(n.Left, order, nil) n.Left = orderexpr(n.Left, order, nil)
for _, n4 := range n.List.Slice() { for _, n4 := range n.List.Slice() {
if n4.Op != OXCASE { if n4.Op != OXCASE {
Fatalf("order switch case %v", Oconv(n4.Op, 0)) Fatalf("order switch case %v", oconv(n4.Op, 0))
} }
orderexprlistinplace(n4.List, order) orderexprlistinplace(n4.List, order)
orderblockNodes(&n4.Nbody) orderblockNodes(&n4.Nbody)
......
...@@ -91,7 +91,7 @@ func gvardefx(n *Node, as obj.As) { ...@@ -91,7 +91,7 @@ func gvardefx(n *Node, as obj.As) {
Fatalf("gvardef nil") Fatalf("gvardef nil")
} }
if n.Op != ONAME { if n.Op != ONAME {
Yyerror("gvardef %v; %v", Oconv(n.Op, FmtSharp), n) Yyerror("gvardef %v; %v", oconv(n.Op, FmtSharp), n)
return return
} }
......
...@@ -132,7 +132,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) { ...@@ -132,7 +132,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) {
switch n.Op { switch n.Op {
default: default:
Fatalf("instrument: unknown node type %v", Oconv(n.Op, 0)) Fatalf("instrument: unknown node type %v", oconv(n.Op, 0))
case OAS, OASWB, OAS2FUNC: case OAS, OASWB, OAS2FUNC:
instrumentnode(&n.Left, init, 1, 0) instrumentnode(&n.Left, init, 1, 0)
...@@ -374,13 +374,13 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) { ...@@ -374,13 +374,13 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) {
OAS2RECV, OAS2RECV,
OAS2MAPR, OAS2MAPR,
OASOP: OASOP:
Yyerror("instrument: %v must be lowered by now", Oconv(n.Op, 0)) Yyerror("instrument: %v must be lowered by now", oconv(n.Op, 0))
goto ret goto ret
// impossible nodes: only appear in backend. // impossible nodes: only appear in backend.
case ORROTC, OEXTEND: case ORROTC, OEXTEND:
Yyerror("instrument: %v cannot exist now", Oconv(n.Op, 0)) Yyerror("instrument: %v cannot exist now", oconv(n.Op, 0))
goto ret goto ret
case OGETG: case OGETG:
......
...@@ -18,7 +18,7 @@ func typecheckselect(sel *Node) { ...@@ -18,7 +18,7 @@ func typecheckselect(sel *Node) {
ncase = n1 ncase = n1
setlineno(ncase) setlineno(ncase)
if ncase.Op != OXCASE { if ncase.Op != OXCASE {
Fatalf("typecheckselect %v", Oconv(ncase.Op, 0)) Fatalf("typecheckselect %v", oconv(ncase.Op, 0))
} }
if ncase.List.Len() == 0 { if ncase.List.Len() == 0 {
...@@ -120,7 +120,7 @@ func walkselect(sel *Node) { ...@@ -120,7 +120,7 @@ func walkselect(sel *Node) {
var ch *Node var ch *Node
switch n.Op { switch n.Op {
default: default:
Fatalf("select %v", Oconv(n.Op, 0)) Fatalf("select %v", oconv(n.Op, 0))
// ok already // ok already
case OSEND: case OSEND:
...@@ -218,7 +218,7 @@ func walkselect(sel *Node) { ...@@ -218,7 +218,7 @@ func walkselect(sel *Node) {
r.Ninit.Set(cas.Ninit.Slice()) r.Ninit.Set(cas.Ninit.Slice())
switch n.Op { switch n.Op {
default: default:
Fatalf("select %v", Oconv(n.Op, 0)) Fatalf("select %v", oconv(n.Op, 0))
// if selectnbsend(c, v) { body } else { default body } // if selectnbsend(c, v) { body } else { default body }
case OSEND: case OSEND:
...@@ -282,7 +282,7 @@ func walkselect(sel *Node) { ...@@ -282,7 +282,7 @@ func walkselect(sel *Node) {
} else { } else {
switch n.Op { switch n.Op {
default: default:
Fatalf("select %v", Oconv(n.Op, 0)) Fatalf("select %v", oconv(n.Op, 0))
// selectsend(sel *byte, hchan *chan any, elem *any) (selected bool); // selectsend(sel *byte, hchan *chan any, elem *any) (selected bool);
case OSEND: case OSEND:
......
...@@ -2563,7 +2563,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value { ...@@ -2563,7 +2563,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value {
// want to set it here. // want to set it here.
case OCALLINTER: case OCALLINTER:
if fn.Op != ODOTINTER { if fn.Op != ODOTINTER {
Fatalf("OCALLINTER: n.Left not an ODOTINTER: %v", Oconv(fn.Op, 0)) Fatalf("OCALLINTER: n.Left not an ODOTINTER: %v", oconv(fn.Op, 0))
} }
i := s.expr(fn.Left) i := s.expr(fn.Left)
itab := s.newValue1(ssa.OpITab, Types[TUINTPTR], i) itab := s.newValue1(ssa.OpITab, Types[TUINTPTR], i)
...@@ -2787,7 +2787,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value { ...@@ -2787,7 +2787,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value {
return s.call(n, callNormal) return s.call(n, callNormal)
default: default:
s.Unimplementedf("unhandled addr %v", Oconv(n.Op, 0)) s.Unimplementedf("unhandled addr %v", oconv(n.Op, 0))
return nil return nil
} }
} }
......
...@@ -1203,9 +1203,9 @@ func printframenode(n *Node) { ...@@ -1203,9 +1203,9 @@ func printframenode(n *Node) {
} }
switch n.Op { switch n.Op {
case ONAME: case ONAME:
fmt.Printf("%v %v G%d %v width=%d\n", Oconv(n.Op, 0), n.Sym, n.Name.Vargen, n.Type, w) fmt.Printf("%v %v G%d %v width=%d\n", oconv(n.Op, 0), n.Sym, n.Name.Vargen, n.Type, w)
case OTYPE: case OTYPE:
fmt.Printf("%v %v width=%d\n", Oconv(n.Op, 0), n.Type, w) fmt.Printf("%v %v width=%d\n", oconv(n.Op, 0), n.Type, w)
} }
} }
...@@ -1286,7 +1286,7 @@ func badtype(op Op, tl *Type, tr *Type) { ...@@ -1286,7 +1286,7 @@ func badtype(op Op, tl *Type, tr *Type) {
} }
s := fmt_ s := fmt_
Yyerror("illegal types for operand: %v%s", Oconv(op, 0), s) Yyerror("illegal types for operand: %v%s", oconv(op, 0), s)
} }
// Brcom returns !(op). // Brcom returns !(op).
...@@ -1306,7 +1306,7 @@ func Brcom(op Op) Op { ...@@ -1306,7 +1306,7 @@ func Brcom(op Op) Op {
case OGE: case OGE:
return OLT return OLT
} }
Fatalf("brcom: no com for %v\n", Oconv(op, 0)) Fatalf("brcom: no com for %v\n", oconv(op, 0))
return op return op
} }
...@@ -1327,7 +1327,7 @@ func Brrev(op Op) Op { ...@@ -1327,7 +1327,7 @@ func Brrev(op Op) Op {
case OGE: case OGE:
return OLE return OLE
} }
Fatalf("brrev: no rev for %v\n", Oconv(op, 0)) Fatalf("brrev: no rev for %v\n", oconv(op, 0))
return op return op
} }
......
...@@ -350,7 +350,7 @@ func casebody(sw *Node, typeswvar *Node) { ...@@ -350,7 +350,7 @@ func casebody(sw *Node, typeswvar *Node) {
for i, n := range sw.List.Slice() { for i, n := range sw.List.Slice() {
setlineno(n) setlineno(n)
if n.Op != OXCASE { if n.Op != OXCASE {
Fatalf("casebody %v", Oconv(n.Op, 0)) Fatalf("casebody %v", oconv(n.Op, 0))
} }
n.Op = OCASE n.Op = OCASE
needvar := n.List.Len() != 1 || n.List.First().Op == OLITERAL needvar := n.List.Len() != 1 || n.List.First().Op == OLITERAL
......
...@@ -278,7 +278,7 @@ OpSwitch: ...@@ -278,7 +278,7 @@ OpSwitch:
default: default:
Dump("typecheck", n) Dump("typecheck", n)
Fatalf("typecheck %v", Oconv(n.Op, 0)) Fatalf("typecheck %v", oconv(n.Op, 0))
// names // names
case OLITERAL: case OLITERAL:
...@@ -611,7 +611,7 @@ OpSwitch: ...@@ -611,7 +611,7 @@ OpSwitch:
aop = assignop(l.Type, r.Type, nil) aop = assignop(l.Type, r.Type, nil)
if aop != 0 { if aop != 0 {
if r.Type.IsInterface() && !l.Type.IsInterface() && !l.Type.IsComparable() { if r.Type.IsInterface() && !l.Type.IsInterface() && !l.Type.IsComparable() {
Yyerror("invalid operation: %v (operator %v not defined on %s)", n, Oconv(op, 0), typekind(l.Type)) Yyerror("invalid operation: %v (operator %v not defined on %s)", n, oconv(op, 0), typekind(l.Type))
n.Type = nil n.Type = nil
return n return n
} }
...@@ -633,7 +633,7 @@ OpSwitch: ...@@ -633,7 +633,7 @@ OpSwitch:
aop = assignop(r.Type, l.Type, nil) aop = assignop(r.Type, l.Type, nil)
if aop != 0 { if aop != 0 {
if l.Type.IsInterface() && !r.Type.IsInterface() && !r.Type.IsComparable() { if l.Type.IsInterface() && !r.Type.IsInterface() && !r.Type.IsComparable() {
Yyerror("invalid operation: %v (operator %v not defined on %s)", n, Oconv(op, 0), typekind(r.Type)) Yyerror("invalid operation: %v (operator %v not defined on %s)", n, oconv(op, 0), typekind(r.Type))
n.Type = nil n.Type = nil
return n return n
} }
...@@ -664,7 +664,7 @@ OpSwitch: ...@@ -664,7 +664,7 @@ OpSwitch:
} }
if !okfor[op][et] { if !okfor[op][et] {
Yyerror("invalid operation: %v (operator %v not defined on %s)", n, Oconv(op, 0), typekind(t)) Yyerror("invalid operation: %v (operator %v not defined on %s)", n, oconv(op, 0), typekind(t))
n.Type = nil n.Type = nil
return n return n
} }
...@@ -774,7 +774,7 @@ OpSwitch: ...@@ -774,7 +774,7 @@ OpSwitch:
return n return n
} }
if !okfor[n.Op][t.Etype] { if !okfor[n.Op][t.Etype] {
Yyerror("invalid operation: %v %v", Oconv(n.Op, 0), t) Yyerror("invalid operation: %v %v", oconv(n.Op, 0), t)
n.Type = nil n.Type = nil
return n return n
} }
...@@ -1314,7 +1314,7 @@ OpSwitch: ...@@ -1314,7 +1314,7 @@ OpSwitch:
case OCAP, OLEN, OREAL, OIMAG: case OCAP, OLEN, OREAL, OIMAG:
ok |= Erv ok |= Erv
if !onearg(n, "%v", Oconv(n.Op, 0)) { if !onearg(n, "%v", oconv(n.Op, 0)) {
n.Type = nil n.Type = nil
return n return n
} }
...@@ -1380,7 +1380,7 @@ OpSwitch: ...@@ -1380,7 +1380,7 @@ OpSwitch:
break OpSwitch break OpSwitch
badcall1: badcall1:
Yyerror("invalid argument %v for %v", Nconv(n.Left, FmtLong), Oconv(n.Op, 0)) Yyerror("invalid argument %v for %v", Nconv(n.Left, FmtLong), oconv(n.Op, 0))
n.Type = nil n.Type = nil
return n return n
...@@ -1463,7 +1463,7 @@ OpSwitch: ...@@ -1463,7 +1463,7 @@ OpSwitch:
break OpSwitch break OpSwitch
case OCLOSE: case OCLOSE:
if !onearg(n, "%v", Oconv(n.Op, 0)) { if !onearg(n, "%v", oconv(n.Op, 0)) {
n.Type = nil n.Type = nil
return n return n
} }
...@@ -2284,19 +2284,19 @@ func twoarg(n *Node) bool { ...@@ -2284,19 +2284,19 @@ func twoarg(n *Node) bool {
return true return true
} }
if n.List.Len() == 0 { if n.List.Len() == 0 {
Yyerror("missing argument to %v - %v", Oconv(n.Op, 0), n) Yyerror("missing argument to %v - %v", oconv(n.Op, 0), n)
return false return false
} }
n.Left = n.List.First() n.Left = n.List.First()
if n.List.Len() == 1 { if n.List.Len() == 1 {
Yyerror("missing argument to %v - %v", Oconv(n.Op, 0), n) Yyerror("missing argument to %v - %v", oconv(n.Op, 0), n)
n.List.Set(nil) n.List.Set(nil)
return false return false
} }
if n.List.Len() > 2 { if n.List.Len() > 2 {
Yyerror("too many arguments to %v - %v", Oconv(n.Op, 0), n) Yyerror("too many arguments to %v - %v", oconv(n.Op, 0), n)
n.List.Set(nil) n.List.Set(nil)
return false return false
} }
...@@ -2662,7 +2662,7 @@ func typecheckaste(op Op, call *Node, isddd bool, tstruct *Type, nl Nodes, desc ...@@ -2662,7 +2662,7 @@ func typecheckaste(op Op, call *Node, isddd bool, tstruct *Type, nl Nodes, desc
if call != nil { if call != nil {
Yyerror("invalid use of ... in call to %v", call) Yyerror("invalid use of ... in call to %v", call)
} else { } else {
Yyerror("invalid use of ... in %v", Oconv(op, 0)) Yyerror("invalid use of ... in %v", oconv(op, 0))
} }
} }
...@@ -2682,7 +2682,7 @@ notenough: ...@@ -2682,7 +2682,7 @@ notenough:
Yyerror("not enough arguments in call to %v", call) Yyerror("not enough arguments in call to %v", call)
} }
} else { } else {
Yyerror("not enough arguments to %v", Oconv(op, 0)) Yyerror("not enough arguments to %v", oconv(op, 0))
} }
if n != nil { if n != nil {
n.Diag = 1 n.Diag = 1
...@@ -2695,7 +2695,7 @@ toomany: ...@@ -2695,7 +2695,7 @@ toomany:
if call != nil { if call != nil {
Yyerror("too many arguments in call to %v", call) Yyerror("too many arguments in call to %v", call)
} else { } else {
Yyerror("too many arguments to %v", Oconv(op, 0)) Yyerror("too many arguments to %v", oconv(op, 0))
} }
goto out goto out
} }
...@@ -3606,7 +3606,7 @@ func typecheckdef(n *Node) *Node { ...@@ -3606,7 +3606,7 @@ func typecheckdef(n *Node) *Node {
switch n.Op { switch n.Op {
default: default:
Fatalf("typecheckdef %v", Oconv(n.Op, 0)) Fatalf("typecheckdef %v", oconv(n.Op, 0))
// not really syms // not really syms
case OGOTO, OLABEL: case OGOTO, OLABEL:
......
...@@ -82,7 +82,7 @@ func unsafenmagic(nn *Node) *Node { ...@@ -82,7 +82,7 @@ func unsafenmagic(nn *Node) *Node {
v += r1.Xoffset v += r1.Xoffset
default: default:
Dump("unsafenmagic", r) Dump("unsafenmagic", r)
Fatalf("impossible %v node after dot insertion", Oconv(r1.Op, FmtSharp)) Fatalf("impossible %v node after dot insertion", oconv(r1.Op, FmtSharp))
goto bad goto bad
} }
} }
......
...@@ -159,7 +159,7 @@ func walkstmt(n *Node) *Node { ...@@ -159,7 +159,7 @@ func walkstmt(n *Node) *Node {
if n.Op == ONAME { if n.Op == ONAME {
Yyerror("%v is not a top level statement", n.Sym) Yyerror("%v is not a top level statement", n.Sym)
} else { } else {
Yyerror("%v is not a top level statement", Oconv(n.Op, 0)) Yyerror("%v is not a top level statement", oconv(n.Op, 0))
} }
Dump("nottop", n) Dump("nottop", n)
...@@ -1505,7 +1505,7 @@ opswitch: ...@@ -1505,7 +1505,7 @@ opswitch:
// ifaceeq(i1 any-1, i2 any-2) (ret bool); // ifaceeq(i1 any-1, i2 any-2) (ret bool);
case OCMPIFACE: case OCMPIFACE:
if !Eqtype(n.Left.Type, n.Right.Type) { if !Eqtype(n.Left.Type, n.Right.Type) {
Fatalf("ifaceeq %v %v %v", Oconv(n.Op, 0), n.Left.Type, n.Right.Type) Fatalf("ifaceeq %v %v %v", oconv(n.Op, 0), n.Left.Type, n.Right.Type)
} }
var fn *Node var fn *Node
if n.Left.Type.IsEmptyInterface() { if n.Left.Type.IsEmptyInterface() {
...@@ -1651,7 +1651,7 @@ func ascompatee(op Op, nl, nr []*Node, init *Nodes) []*Node { ...@@ -1651,7 +1651,7 @@ func ascompatee(op Op, nl, nr []*Node, init *Nodes) []*Node {
var nln, nrn Nodes var nln, nrn Nodes
nln.Set(nl) nln.Set(nl)
nrn.Set(nr) nrn.Set(nr)
Yyerror("error in shape across %v %v %v / %d %d [%s]", Hconv(nln, FmtSign), Oconv(op, 0), Hconv(nrn, FmtSign), len(nl), len(nr), Curfn.Func.Nname.Sym.Name) Yyerror("error in shape across %v %v %v / %d %d [%s]", Hconv(nln, FmtSign), oconv(op, 0), Hconv(nrn, FmtSign), len(nl), len(nr), Curfn.Func.Nname.Sym.Name)
} }
return nn return nn
} }
...@@ -1866,9 +1866,9 @@ func ascompatte(op Op, call *Node, isddd bool, nl *Type, lr []*Node, fp int, ini ...@@ -1866,9 +1866,9 @@ func ascompatte(op Op, call *Node, isddd bool, nl *Type, lr []*Node, fp int, ini
l1 := dumptypes(nl, "expected") l1 := dumptypes(nl, "expected")
l2 := dumpnodetypes(lr0, "given") l2 := dumpnodetypes(lr0, "given")
if l != nil { if l != nil {
Yyerror("not enough arguments to %v\n\t%s\n\t%s", Oconv(op, 0), l1, l2) Yyerror("not enough arguments to %v\n\t%s\n\t%s", oconv(op, 0), l1, l2)
} else { } else {
Yyerror("too many arguments to %v\n\t%s\n\t%s", Oconv(op, 0), l1, l2) Yyerror("too many arguments to %v\n\t%s\n\t%s", oconv(op, 0), l1, l2)
} }
} }
...@@ -2142,7 +2142,7 @@ func applywritebarrier(n *Node) *Node { ...@@ -2142,7 +2142,7 @@ func applywritebarrier(n *Node) *Node {
func convas(n *Node, init *Nodes) *Node { func convas(n *Node, init *Nodes) *Node {
if n.Op != OAS { if n.Op != OAS {
Fatalf("convas: not OAS %v", Oconv(n.Op, 0)) Fatalf("convas: not OAS %v", oconv(n.Op, 0))
} }
n.Typecheck = 1 n.Typecheck = 1
...@@ -2285,7 +2285,7 @@ func reorder3(all []*Node) []*Node { ...@@ -2285,7 +2285,7 @@ func reorder3(all []*Node) []*Node {
switch l.Op { switch l.Op {
default: default:
Fatalf("reorder3 unexpected lvalue %v", Oconv(l.Op, FmtSharp)) Fatalf("reorder3 unexpected lvalue %v", oconv(l.Op, FmtSharp))
case ONAME: case ONAME:
break break
...@@ -3788,7 +3788,7 @@ func usefield(n *Node) { ...@@ -3788,7 +3788,7 @@ func usefield(n *Node) {
switch n.Op { switch n.Op {
default: default:
Fatalf("usefield %v", Oconv(n.Op, 0)) Fatalf("usefield %v", oconv(n.Op, 0))
case ODOT, ODOTPTR: case ODOT, ODOTPTR:
break break
......
...@@ -148,7 +148,7 @@ func ginscmp(op gc.Op, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog { ...@@ -148,7 +148,7 @@ func ginscmp(op gc.Op, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog {
case gc.TFLOAT32: case gc.TFLOAT32:
switch op { switch op {
default: default:
gc.Fatalf("ginscmp: no entry for op=%v type=%v", gc.Oconv(op, 0), t) gc.Fatalf("ginscmp: no entry for op=%s type=%v", op, t)
case gc.OEQ, case gc.OEQ,
gc.ONE: gc.ONE:
...@@ -165,7 +165,7 @@ func ginscmp(op gc.Op, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog { ...@@ -165,7 +165,7 @@ func ginscmp(op gc.Op, t *gc.Type, n1, n2 *gc.Node, likely int) *obj.Prog {
case gc.TFLOAT64: case gc.TFLOAT64:
switch op { switch op {
default: default:
gc.Fatalf("ginscmp: no entry for op=%v type=%v", gc.Oconv(op, 0), t) gc.Fatalf("ginscmp: no entry for op=%s type=%v", op, t)
case gc.OEQ, case gc.OEQ,
gc.ONE: gc.ONE:
...@@ -715,7 +715,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As { ...@@ -715,7 +715,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As {
a := obj.AXXX a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default: default:
gc.Fatalf("optoas: no entry for op=%v type=%v", gc.Oconv(op, 0), t) gc.Fatalf("optoas: no entry for op=%s type=%v", op, t)
case OEQ_ | gc.TBOOL, case OEQ_ | gc.TBOOL,
OEQ_ | gc.TINT8, OEQ_ | gc.TINT8,
......
...@@ -712,7 +712,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As { ...@@ -712,7 +712,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As {
a := obj.AXXX a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default: default:
gc.Fatalf("optoas: no entry for op=%v type=%v", gc.Oconv(op, 0), t) gc.Fatalf("optoas: no entry for op=%v type=%v", op, t)
case OEQ_ | gc.TBOOL, case OEQ_ | gc.TBOOL,
OEQ_ | gc.TINT8, OEQ_ | gc.TINT8,
......
...@@ -639,7 +639,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As { ...@@ -639,7 +639,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As {
a := obj.AXXX a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default: default:
gc.Fatalf("optoas: no entry for op=%v type=%v", gc.Oconv(op, 0), t) gc.Fatalf("optoas: no entry for op=%v type=%v", op, t)
case OEQ_ | gc.TBOOL, case OEQ_ | gc.TBOOL,
OEQ_ | gc.TINT8, OEQ_ | gc.TINT8,
......
...@@ -19,12 +19,12 @@ func cgen64(n *gc.Node, res *gc.Node) { ...@@ -19,12 +19,12 @@ func cgen64(n *gc.Node, res *gc.Node) {
if res.Op != gc.OINDREG && res.Op != gc.ONAME { if res.Op != gc.OINDREG && res.Op != gc.ONAME {
gc.Dump("n", n) gc.Dump("n", n)
gc.Dump("res", res) gc.Dump("res", res)
gc.Fatalf("cgen64 %v of %v", gc.Oconv(n.Op, 0), gc.Oconv(res.Op, 0)) gc.Fatalf("cgen64 %v of %v", n.Op, res.Op)
} }
switch n.Op { switch n.Op {
default: default:
gc.Fatalf("cgen64 %v", gc.Oconv(n.Op, 0)) gc.Fatalf("cgen64 %v", n.Op)
case gc.OMINUS: case gc.OMINUS:
gc.Cgen(n.Left, res) gc.Cgen(n.Left, res)
...@@ -531,7 +531,7 @@ func cmp64(nl *gc.Node, nr *gc.Node, op gc.Op, likely int, to *obj.Prog) { ...@@ -531,7 +531,7 @@ func cmp64(nl *gc.Node, nr *gc.Node, op gc.Op, likely int, to *obj.Prog) {
var br *obj.Prog var br *obj.Prog
switch op { switch op {
default: default:
gc.Fatalf("cmp64 %v %v", gc.Oconv(op, 0), t) gc.Fatalf("cmp64 %v %v", op, t)
// cmp hi // cmp hi
// jne L // jne L
......
...@@ -661,7 +661,7 @@ func cgen_floatsse(n *gc.Node, res *gc.Node) { ...@@ -661,7 +661,7 @@ func cgen_floatsse(n *gc.Node, res *gc.Node) {
switch n.Op { switch n.Op {
default: default:
gc.Dump("cgen_floatsse", n) gc.Dump("cgen_floatsse", n)
gc.Fatalf("cgen_floatsse %v", gc.Oconv(n.Op, 0)) gc.Fatalf("cgen_floatsse %v", n.Op)
return return
case gc.OMINUS, case gc.OMINUS,
......
...@@ -91,7 +91,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As { ...@@ -91,7 +91,7 @@ func optoas(op gc.Op, t *gc.Type) obj.As {
a := obj.AXXX a := obj.AXXX
switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) { switch uint32(op)<<16 | uint32(gc.Simtype[t.Etype]) {
default: default:
gc.Fatalf("optoas: no entry %v-%v", gc.Oconv(op, 0), t) gc.Fatalf("optoas: no entry %v-%v", op, t)
case OADDR_ | gc.TPTR32: case OADDR_ | gc.TPTR32:
a = x86.ALEAL a = x86.ALEAL
...@@ -454,7 +454,7 @@ func foptoas(op gc.Op, t *gc.Type, flg int) obj.As { ...@@ -454,7 +454,7 @@ func foptoas(op gc.Op, t *gc.Type, flg int) obj.As {
if !gc.Thearch.Use387 { if !gc.Thearch.Use387 {
switch uint32(op)<<16 | uint32(et) { switch uint32(op)<<16 | uint32(et) {
default: default:
gc.Fatalf("foptoas-sse: no entry %v-%v", gc.Oconv(op, 0), t) gc.Fatalf("foptoas-sse: no entry %v-%v", op, t)
case OCMP_ | gc.TFLOAT32: case OCMP_ | gc.TFLOAT32:
a = x86.AUCOMISS a = x86.AUCOMISS
...@@ -587,7 +587,7 @@ func foptoas(op gc.Op, t *gc.Type, flg int) obj.As { ...@@ -587,7 +587,7 @@ func foptoas(op gc.Op, t *gc.Type, flg int) obj.As {
return x86.AFCHS return x86.AFCHS
} }
gc.Fatalf("foptoas %v %v %#x", gc.Oconv(op, 0), t, flg) gc.Fatalf("foptoas %v %v %#x", op, t, flg)
return 0 return 0
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment