Refactor unwind from Option to a new enum
This commit is contained in:
parent
7f6edd3f15
commit
daeb844e0c
39 changed files with 328 additions and 250 deletions
|
@ -50,10 +50,10 @@ impl AddCallGuards {
|
|||
for block in body.basic_blocks_mut() {
|
||||
match block.terminator {
|
||||
Some(Terminator {
|
||||
kind: TerminatorKind::Call { target: Some(ref mut destination), cleanup, .. },
|
||||
kind: TerminatorKind::Call { target: Some(ref mut destination), unwind, .. },
|
||||
source_info,
|
||||
}) if pred_count[*destination] > 1
|
||||
&& (cleanup.is_some() || self == &AllCallEdges) =>
|
||||
&& (matches!(unwind, UnwindAction::Cleanup(_)) || self == &AllCallEdges) =>
|
||||
{
|
||||
// It's a critical edge, break it
|
||||
let call_guard = BasicBlockData {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue