commit b5d5fce67e0924acced64ca3b4542a238ea1c678
Author: Roberto E. Vargas Caballero <[email protected]>
AuthorDate: Fri Aug 12 11:06:51 2016 +0200
Commit: Roberto E. Vargas Caballero <[email protected]>
CommitDate: Fri Aug 12 11:06:51 2016 +0200
[cc2-qbe] move the call to setlabel() to cgen()
Cgen() is the function called to generate the asm code
for a C statement, and it means that it will receive the node
which has the label.
diff --git a/cc2/arch/qbe/cgen.c b/cc2/arch/qbe/cgen.c
index 4f94dde..e360c77 100644
--- a/cc2/arch/qbe/cgen.c
+++ b/cc2/arch/qbe/cgen.c
@@ -241,7 +241,6 @@ rhs(Node *np, Node *ret)
char *tbl;
Symbol *true, *false;
- setlabel(np->label);
tp = &np->type;
switch (np->op) {
@@ -323,6 +322,7 @@ cgen(Node *np)
Node n, *aux, *next, *ifyes, *ifno;
Symbol *label1, *label2;
+ setlabel(np->label);
switch (np->op) {
case OJMP:
ifyes = label2node(np->u.sym);