summaryrefslogtreecommitdiff
path: root/src/cmd/gc/subr.c
diff options
context:
space:
mode:
authorKen Thompson <ken@golang.org>2009-03-05 15:49:34 -0800
committerKen Thompson <ken@golang.org>2009-03-05 15:49:34 -0800
commitf0e229f9510cf3ec9d8e9c332fcc8aa4a865a2ef (patch)
treec30dad9603ef2231028f0f2a5d0e67097f2b6bd7 /src/cmd/gc/subr.c
parentd63ac64fe49b9b16ad5b0dc694e239b9af6e7e49 (diff)
downloadgolang-f0e229f9510cf3ec9d8e9c332fcc8aa4a865a2ef.tar.gz
new switch implementation
in preparation of type switch. no functional change (yet). R=r OCL=25784 CL=25788
Diffstat (limited to 'src/cmd/gc/subr.c')
-rw-r--r--src/cmd/gc/subr.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/src/cmd/gc/subr.c b/src/cmd/gc/subr.c
index bb2c31ebd..aa8b01a53 100644
--- a/src/cmd/gc/subr.c
+++ b/src/cmd/gc/subr.c
@@ -547,8 +547,11 @@ loop:
return;
case OCASE:
- // the right side points to the next case
- print("%O%J\n", n->op, n);
+ // the right side points to label of the body
+ if(n->right != N && n->right->op == OGOTO && n->right->left->op == ONAME)
+ print("%O%J GOTO %N\n", n->op, n, n->right->left);
+ else
+ print("%O%J\n", n->op, n);
dodump(n->left, dep+1);
return;
}
@@ -654,8 +657,8 @@ opnames[] =
[OCMP] = "CMP",
[OFALL] = "FALL",
[OCOMPOS] = "COMPOS",
- [ODOTTYPE] = "DOTTYPE",
- [OCONV] = "CONV",
+ [ODOTTYPE] = "DOTTYPE",
+ [OCONV] = "CONV",
[OCOM] = "COM",
[OCONST] = "CONST",
[OCONTINUE] = "CONTINUE",
@@ -724,7 +727,7 @@ opnames[] =
[OPRINT] = "PRINT",
[OPRINTN] = "PRINTN",
[OPARAM] = "PARAM",
- [ODCL] = "DCL",
+ [ODCL] = "DCL",
[OXXX] = "XXX",
};