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

Method check_function

src/debug_utils/checker.rs:191–214  ·  view source on GitHub ↗

Top-level function for the checker.

(&mut self)

Source from the content-addressed store, hash-verified

189impl<F: Function, R: RegInfo> Context<'_, F, R> {
190 /// Top-level function for the checker.
191 fn check_function(&mut self) -> Result<()> {
192 trace!("Checking register allocator output...");
193
194 self.check_stack()?;
195
196 // Start with an empty state on each entry point and keep visiting
197 // blocks as long as their initial state has changed.
198 //
199 // The lattice meet() function guarantees that the initial state of a
200 // block can only get smaller so this will eventually settle to a fixed
201 // point at which point checking is complete.
202 self.blocks_to_check.clear();
203 for &entry in self.output.function().entry_points() {
204 self.blocks_to_check.insert(entry, ());
205 self.block_entry_state[entry] = Some(CheckerState::new(self.output));
206 }
207 while let Some((block, ())) = self.blocks_to_check.pop() {
208 self.check_block(block)?;
209 }
210
211 trace!("Check complete");
212
213 Ok(())
214 }
215
216 /// Checks the stack layout and spill slot definitions.
217 fn check_stack(&self) -> Result<()> {

Callers 1

check_outputFunction · 0.45

Calls 7

check_stackMethod · 0.80
functionMethod · 0.80
popMethod · 0.80
clearMethod · 0.45
entry_pointsMethod · 0.45
insertMethod · 0.45
check_blockMethod · 0.45

Tested by

no test coverage detected