Specify unsealed / unfilled blocks
This commit is contained in:
@@ -459,19 +459,23 @@ impl<'a> FunctionBuilder<'a> {
|
|||||||
/// for another function.
|
/// for another function.
|
||||||
pub fn finalize(&mut self) {
|
pub fn finalize(&mut self) {
|
||||||
// Check that all the `Block`s are filled and sealed.
|
// Check that all the `Block`s are filled and sealed.
|
||||||
debug_assert!(
|
#[cfg(debug_assertions)]
|
||||||
self.func_ctx.blocks.iter().all(
|
{
|
||||||
|(block, block_data)| block_data.pristine || self.func_ctx.ssa.is_sealed(block)
|
for (block, block_data) in self.func_ctx.blocks.iter() {
|
||||||
),
|
if !(block_data.pristine || self.func_ctx.ssa.is_sealed(block)) {
|
||||||
"all blocks should be sealed before dropping a FunctionBuilder"
|
panic!(
|
||||||
|
"FunctionBuilder finalized, but block {} is not sealed",
|
||||||
|
block
|
||||||
);
|
);
|
||||||
debug_assert!(
|
}
|
||||||
self.func_ctx
|
if !(block_data.pristine || block_data.filled) {
|
||||||
.blocks
|
panic!(
|
||||||
.values()
|
"FunctionBuilder finalized, but block {} is not filled",
|
||||||
.all(|block_data| block_data.pristine || block_data.filled),
|
block
|
||||||
"all blocks should be filled before dropping a FunctionBuilder"
|
|
||||||
);
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// In debug mode, check that all blocks are valid basic blocks.
|
// In debug mode, check that all blocks are valid basic blocks.
|
||||||
#[cfg(debug_assertions)]
|
#[cfg(debug_assertions)]
|
||||||
|
|||||||
Reference in New Issue
Block a user