Drop unused labels rather than adding them to the statement block.

However, even unused labels create a new statement block if necessary.
This commit is contained in:
Bill Currie 2011-03-03 17:35:06 +09:00
parent b5e7e666e9
commit ed901bd48f

View file

@ -827,9 +827,13 @@ statement_label (sblock_t *sblock, expr_t *e)
sblock->next = new_sblock ();
sblock = sblock->next;
}
e->e.label.dest = sblock;
e->e.label.next = sblock->labels;
sblock->labels = &e->e.label;
if (e->e.label.used) {
e->e.label.dest = sblock;
e->e.label.next = sblock->labels;
sblock->labels = &e->e.label;
} else {
debug (e, "dropping unused label %s\n", e->e.label.name);
}
return sblock;
}