for (size_t i = 0; i != vec_size(m_instr); ++i)
delete m_instr[i];
vec_free(m_instr);
- vec_free(m_exits);
}
static void ir_block_delete_quick(ir_block* self)
vec_push(self->m_instr, in);
- vec_push(self->m_exits, ontrue);
- vec_push(self->m_exits, onfalse);
+ self->m_exits.push_back(ontrue);
+ self->m_exits.push_back(onfalse);
ontrue->m_entries.push_back(self);
onfalse->m_entries.push_back(self);
return true;
in->m_bops[0] = to;
vec_push(self->m_instr, in);
- vec_push(self->m_exits, to);
+ self->m_exits.push_back(to);
to->m_entries.push_back(self);
return true;
}
{
ir_instr *instr;
ir_value *value;
- size_t i, o, p, mem;
+ size_t i, o, mem;
// bitmasks which operands are read from or written to
size_t read, write;
self->m_living.clear();
- p = vec_size(self->m_exits);
- for (i = 0; i < p; ++i) {
- ir_block *prev = self->m_exits[i];
+ for (auto &prev : self->m_exits) {
for (auto &it : prev->m_living)
if (!vec_ir_value_find(self->m_living, it, nullptr))
self->m_living.push_back(it);
ir_instr **m_instr = nullptr;
std::vector<ir_block *> m_entries;
- ir_block **m_exits = nullptr;
+ std::vector<ir_block *> m_exits;
std::vector<ir_value *> m_living;
/* For the temp-allocation */