scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit 9fa589f963e560b02cfecd13b724664a239693b6
parent d7a8adfd00c4d92615387463382ba1e000c3b61c
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Thu, 24 Apr 2014 18:01:18 +0200

Change order of emiting in emitcase

It is better emit first the label and later the expression
because it helps to detect what it is label and what it
is expression.

Diffstat:
Mcode.c | 7+++----
1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/code.c b/code.c @@ -245,10 +245,9 @@ emitswitch(short nr, Node *np) void emitcase(Symbol *sym, Node *np) { - fputs("\tw", stdout); - (*np->code)(np); - putchar('\t'); - emitlabel(sym); + fputs("\tw\t", stdout); + printf("L%d", sym->id); + emitexp(np); } void