ir: don't require a label on a block

This commit is contained in:
Wolfgang (Blub) Bumiller 2012-08-24 18:03:57 +02:00
parent ab91dea4e0
commit 2524d9c31b

4
ir.c
View file

@ -462,7 +462,7 @@ ir_block* ir_block_new(ir_function* owner, const char *name)
memset(self, 0, sizeof(*self));
self->label = NULL;
if (!ir_block_set_label(self, name)) {
if (name && !ir_block_set_label(self, name)) {
mem_d(self);
return NULL;
}
@ -491,7 +491,7 @@ MEM_VEC_FUNCTIONS_ALL(ir_block, ir_value*, living)
void ir_block_delete(ir_block* self)
{
size_t i;
mem_d(self->label);
if (self->label) mem_d(self->label);
for (i = 0; i != self->instr_count; ++i)
ir_instr_delete(self->instr[i]);
MEM_VECTOR_CLEAR(self, instr);