Top-level function for the checker.
(&mut self)
| 189 | impl<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<()> { |
no test coverage detected