pub(in crate::native) mod graph;
pub(super) mod loopforest;
pub(super) mod clone_crossarm;
mod repair;
mod exit_check;
mod ssa_demote;
mod loop_split;
pub(super) mod structured_emit;
mod blocks;
pub(super) mod structured_order;
pub(super) use clone_crossarm::{
clone_cross_arm_shared, lower_unreachable_to_ret, privatize_region_cross_arm, rename_tokens,
unify_returns,
};
pub(super) use loop_split::split_multientry_loop_selection_exits;
pub(super) use ssa_demote::demote_nondominating_values;
pub(super) use structured_emit::{
cond_other_witness_lines, cond_phi_shared_witness_lines, construct_tree_gate_witness_lines,
construct_tree_reject_reason, renest_cond_phi_shared_own_arm, renest_straddle_loop_merge,
restructure_straddle_loop_merges, straddle_witness_lines, structured_plan,
structured_plan_construct_tree, structured_reject_reason,
};
pub(super) use blocks::{
implicit_entry_block_name, infer_branch_merges, infer_loop_merges, infer_switch_merges,
lower_unstructured_switches, split_body_blocks,
};
pub(super) use repair::{block_index_by_label, id_ref_operand};
#[derive(Clone, Debug)]
pub(super) struct LoopMergeInfo {
pub(super) merge: String,
pub(super) continue_target: String,
}
#[derive(Clone, Copy, Debug, Default, PartialEq, Eq)]
pub(super) enum BlockRole {
#[default]
Normal,
LMerge,
TerminalExitReturn,
SwitchBypass,
ConstructTreeRoute,
}
#[derive(Clone, Debug)]
pub(super) struct BodyBlock {
pub(super) name: String,
pub(super) role: BlockRole,
pub(super) typed: Option<crate::native::tir::TirBlock>,
}
impl BodyBlock {
#[cfg(test)]
pub(super) fn lines(&self) -> Vec<String> {
crate::native::tir::render_block_lines(
self.typed
.as_ref()
.expect("test fixture block must have a typed carrier"),
)
}
}