ir.cpp
/* Enumerate blocks and instructions.
 * The block-enumeration is unordered!
 * We do not really use the block enumreation, however
 * the instruction enumeration is important for life-ranges.
 */
Enumerate blocks and instructions.
The block-enumeration is unordered.
We do not really use the block enumreation, however
the instruction enumeration is important for life-ranges.
Enumerate blocks and instructions . The block - enumeration is unordered . We do not really use the block enumreation however the instruction enumeration is important for life - ranges .
void ir_function_enumerate(ir_function *self)
{
    size_t instruction_id = 0;
    size_t block_eid = 0;
    for (auto& block : self->m_blocks)
    {
        block->m_entry_id = instruction_id;
        block->m_eid      = block_eid;
        ++instruction_id;
        ++block_eid;
        ir_block_enumerate(block.get(), &instruction_id);
    }
}
void ir_function_enumerate ( ir_function * self ) { size_t instruction_id = 0 ; size_t block_eid = 0 ; for ( auto & block : self -> m_blocks ) { block -> m_entry_id = instruction_id ; block -> m_eid = block_eid ; ++ instruction_id ; ++ block_eid ; ir_block_enumerate ( block . get ( ) , & instruction_id ) ; } }
Enumerate blocks and instructions.
Enumerate blocks and instructions .
/* each block now gets an additional "entry" instruction id
         * we can use to avoid point-life issues
         */