MCPcopy Create free account
hub / github.com/Amanieu/regalloc3 / finalize

Method finalize

src/debug_utils/generic_function/arbitrary.rs:838–850  ·  view source on GitHub ↗

Finalizes the function by assigning instruction numbers to each instruction, in block order.

(&mut self)

Source from the content-addressed store, hash-verified

836 /// Finalizes the function by assigning instruction numbers to each
837 /// instruction, in block order.
838 fn finalize(&mut self) -> Result<()> {
839 for (block, blockdata) in &mut self.func.blocks {
840 // Instructions were generated in reverse, un-reverse them and add them
841 // to the block.
842 let from = self.func.insts.next_key();
843 for inst_data in self.block_insts[block].drain(..).rev() {
844 self.func.insts.push(inst_data);
845 }
846 let to = self.func.insts.next_key();
847 blockdata.insts = InstRange::new(from, to);
848 }
849 Ok(())
850 }
851}

Callers 1

arbitrary_with_configMethod · 0.80

Calls 2

next_keyMethod · 0.80
pushMethod · 0.80

Tested by

no test coverage detected