Commit 63f4ab98 authored by Daniel Martí's avatar Daniel Martí

cmd/compile: deduplicate racewalk switch cases

Only the contiguous ones, to keep the patch simple. Remove some
unnecessary newlines, while at it.

Change-Id: Ia588f80538b49a169fbf49835979ebff5a0a7b6d
Reviewed-on: https://go-review.googlesource.com/94756
Run-TryBot: Daniel Martí <mvdan@mvdan.cc>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
parent 1178e51a
...@@ -165,10 +165,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) { ...@@ -165,10 +165,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) {
afterCall = (op == OCALLFUNC || op == OCALLMETH || op == OCALLINTER) afterCall = (op == OCALLFUNC || op == OCALLMETH || op == OCALLINTER)
} }
case ODEFER: case ODEFER, OPROC:
instrumentnode(&n.Left, init, 0, 0)
case OPROC:
instrumentnode(&n.Left, init, 0, 0) instrumentnode(&n.Left, init, 0, 0)
case OCALLINTER: case OCALLINTER:
...@@ -199,14 +196,9 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) { ...@@ -199,14 +196,9 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) {
instrumentnode(&n.Left, init, 0, 1) instrumentnode(&n.Left, init, 0, 1)
callinstr(&n, init, wr, skip) callinstr(&n, init, wr, skip)
case ODOTPTR: // dst = (*x).f with implicit *; otherwise it's ODOT+OIND case ODOTPTR, // dst = (*x).f with implicit *; otherwise it's ODOT+OIND
OIND: // *p
instrumentnode(&n.Left, init, 0, 0) instrumentnode(&n.Left, init, 0, 0)
callinstr(&n, init, wr, skip)
case OIND: // *p
instrumentnode(&n.Left, init, 0, 0)
callinstr(&n, init, wr, skip) callinstr(&n, init, wr, skip)
case OSPTR, OLEN, OCAP: case OSPTR, OLEN, OCAP:
...@@ -219,22 +211,8 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) { ...@@ -219,22 +211,8 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) {
callinstr(&n1, init, 0, skip) callinstr(&n1, init, 0, skip)
} }
case OLSH, case OLSH, ORSH, OAND, OANDNOT, OOR, OXOR, OSUB,
ORSH, OMUL, OEQ, ONE, OLT, OLE, OGE, OGT, OADD, OCOMPLEX:
OAND,
OANDNOT,
OOR,
OXOR,
OSUB,
OMUL,
OEQ,
ONE,
OLT,
OLE,
OGE,
OGT,
OADD,
OCOMPLEX:
instrumentnode(&n.Left, init, wr, 0) instrumentnode(&n.Left, init, wr, 0)
instrumentnode(&n.Right, init, wr, 0) instrumentnode(&n.Right, init, wr, 0)
...@@ -250,10 +228,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) { ...@@ -250,10 +228,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) {
case ONAME: case ONAME:
callinstr(&n, init, wr, skip) callinstr(&n, init, wr, skip)
case OCONV: case OCONV, OCONVNOP:
instrumentnode(&n.Left, init, wr, 0)
case OCONVNOP:
instrumentnode(&n.Left, init, wr, 0) instrumentnode(&n.Left, init, wr, 0)
case ODIV, OMOD: case ODIV, OMOD:
...@@ -291,10 +266,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) { ...@@ -291,10 +266,7 @@ func instrumentnode(np **Node, init *Nodes, wr int, skip int) {
case OEFACE: case OEFACE:
instrumentnode(&n.Right, init, 0, 0) instrumentnode(&n.Right, init, 0, 0)
case OITAB, OIDATA: case OITAB, OIDATA, OSTRARRAYBYTETMP:
instrumentnode(&n.Left, init, 0, 0)
case OSTRARRAYBYTETMP:
instrumentnode(&n.Left, init, 0, 0) instrumentnode(&n.Left, init, 0, 0)
case OAS2DOTTYPE: case OAS2DOTTYPE:
......
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