{
int bitset_words = BITSET_WORDS(c->num_temps);
- c->temp_start = reralloc(c, c->temp_start, int, c->num_temps);
- c->temp_end = reralloc(c, c->temp_end, int, c->num_temps);
+ /* If we called this function more than once, then we should be
+ * freeing the previous arrays.
+ */
+ assert(!c->temp_start);
+
+ c->temp_start = rzalloc_array(c, int, c->num_temps);
+ c->temp_end = rzalloc_array(c, int, c->num_temps);
for (int i = 0; i < c->num_temps; i++) {
c->temp_start[i] = MAX_INSTRUCTION;
}
qir_for_each_block(block, c) {
- block->def = reralloc(c, block->def, BITSET_WORD, bitset_words);
- block->use = reralloc(c, block->use, BITSET_WORD, bitset_words);
- block->live_in = reralloc(c, block->live_in, BITSET_WORD, bitset_words);
- block->live_out = reralloc(c, block->live_out, BITSET_WORD, bitset_words);
+ block->def = rzalloc_array(c, BITSET_WORD, bitset_words);
+ block->use = rzalloc_array(c, BITSET_WORD, bitset_words);
+ block->live_in = rzalloc_array(c, BITSET_WORD, bitset_words);
+ block->live_out = rzalloc_array(c, BITSET_WORD, bitset_words);
}
qir_setup_def_use(c);