Commit d3c79d32 authored by Dave Cheney's avatar Dave Cheney

cmd/compile/internal/gc: remove oconv(op, 0) calls

Updates #15462

Automatic refactor with sed -e.

Replace all oconv(op, 0) to string conversion with the raw op value
which fmt's %v verb can print directly.

The remaining oconv(op, FmtSharp) will be replaced with op.GoString and
%#v in the next CL.

Change-Id: I5e2f7ee0bd35caa65c6dd6cb1a866b5e4519e641
Reviewed-on: https://go-review.googlesource.com/22499
Run-TryBot: Dave Cheney <dave@cheney.net>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
parent cbd72318
...@@ -499,7 +499,7 @@ func (p *exporter) obj(sym *Sym) { ...@@ -499,7 +499,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", n.Op, 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, n.Op)
} }
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", i.Op)
} }
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", n.Op, 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, n.Op, 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", n.Op)
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", n.Op)
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", nt.Op)
} }
// 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", n.Op)
} }
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", n.Op)
} }
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", n.Op)
} }
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), dst.Op,
Nconv(src, FmtShort), Jconv(src, FmtShort), oconv(src.Op, 0)) Nconv(src, FmtShort), Jconv(src, FmtShort), src.Op)
} }
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", src.Op, 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", s.Def.Op, s)
case OLITERAL: case OLITERAL:
dumpexportconst(s) dumpexportconst(s)
......
...@@ -914,7 +914,7 @@ func stmtfmt(n *Node) string { ...@@ -914,7 +914,7 @@ 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", n.Op)
break break
} }
...@@ -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>", n.Op)
} }
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", n.Op, 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", n.Op, 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", n.Op, 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", n.Op, 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", n.Op, n.Sym, Jconv(n, 0))
} else { } else {
fmt.Fprintf(&buf, "%v%v", oconv(n.Op, 0), Jconv(n, 0)) fmt.Fprintf(&buf, "%v%v", n.Op, 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", n.Op, 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", n.Op, Op(n.Etype), 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", n.Op, 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", n.Op, 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", n.Op, 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", n.Op, 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", n.Op, 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", n.Left.Op)
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", n.Op, 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", n.Op, 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), n.Left.Op)
} }
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", n.Op)
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", n.Op)
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", n.Op)
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", n2.Op)
} }
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", r.Op)
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", n4.Op)
} }
orderexprlistinplace(n4.List, order) orderexprlistinplace(n4.List, order)
orderblockNodes(&n4.Nbody) orderblockNodes(&n4.Nbody)
......
...@@ -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", n.Op)
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", n.Op)
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", n.Op)
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", ncase.Op)
} }
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", n.Op)
// 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", n.Op)
// 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", n.Op)
// selectsend(sel *byte, hchan *chan any, elem *any) (selected bool); // selectsend(sel *byte, hchan *chan any, elem *any) (selected bool);
case OSEND: case OSEND:
......
...@@ -2560,7 +2560,7 @@ func (s *state) call(n *Node, k callKind) *ssa.Value { ...@@ -2560,7 +2560,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", fn.Op)
} }
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)
...@@ -2784,7 +2784,7 @@ func (s *state) addr(n *Node, bounded bool) *ssa.Value { ...@@ -2784,7 +2784,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", n.Op)
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", n.Op, 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", n.Op, 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", op, 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", op)
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", op)
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", n.Op)
} }
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", n.Op)
// 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, op, 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, op, 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, op, 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", n.Op, 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", n.Op) {
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), n.Op)
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", n.Op) {
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", n.Op, 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", n.Op, 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", n.Op, 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", op)
} }
} }
...@@ -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", op)
} }
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", op)
} }
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", n.Op)
// not really syms // not really syms
case OGOTO, OLABEL: case OGOTO, OLABEL:
......
...@@ -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", n.Op)
} }
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", n.Op, 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), op, 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", op, 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", op, 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", n.Op)
} }
n.Typecheck = 1 n.Typecheck = 1
...@@ -3798,7 +3798,7 @@ func usefield(n *Node) { ...@@ -3798,7 +3798,7 @@ func usefield(n *Node) {
switch n.Op { switch n.Op {
default: default:
Fatalf("usefield %v", oconv(n.Op, 0)) Fatalf("usefield %v", n.Op)
case ODOT, ODOTPTR: case ODOT, ODOTPTR:
break break
......
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