Implement Local and TryCatch lowering in MirBuilder

Co-authored-by: moe-charm <217100418+moe-charm@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-08-13 07:13:53 +00:00
parent 3b040f1587
commit ba568f7dfb
3 changed files with 110 additions and 28 deletions

View File

@ -103,7 +103,8 @@ impl BasicBlock {
matches!(instruction,
MirInstruction::Branch { .. } |
MirInstruction::Jump { .. } |
MirInstruction::Return { .. }
MirInstruction::Return { .. } |
MirInstruction::Throw { .. }
)
}
@ -123,6 +124,10 @@ impl BasicBlock {
MirInstruction::Return { .. } => {
// No successors for return
},
MirInstruction::Throw { .. } => {
// No normal successors for throw - control goes to exception handlers
// Exception edges are handled separately from normal control flow
},
_ => unreachable!("Non-terminator instruction in terminator position"),
}
}