Add UnwindAction::Terminate
This commit is contained in:
parent
5e6ed132fa
commit
0a5dac3062
16 changed files with 126 additions and 121 deletions
|
@ -14,6 +14,7 @@ pub struct MirPatch<'tcx> {
|
|||
resume_block: Option<BasicBlock>,
|
||||
// Only for unreachable in cleanup path.
|
||||
unreachable_block: Option<BasicBlock>,
|
||||
terminate_block: Option<BasicBlock>,
|
||||
body_span: Span,
|
||||
next_local: usize,
|
||||
}
|
||||
|
@ -28,6 +29,7 @@ impl<'tcx> MirPatch<'tcx> {
|
|||
next_local: body.local_decls.len(),
|
||||
resume_block: None,
|
||||
unreachable_block: None,
|
||||
terminate_block: None,
|
||||
body_span: body.span,
|
||||
};
|
||||
|
||||
|
|
|
@ -763,6 +763,10 @@ pub enum UnwindAction {
|
|||
Continue,
|
||||
/// Triggers undefined behavior if unwind happens.
|
||||
Unreachable,
|
||||
/// Terminates the execution if unwind happens.
|
||||
///
|
||||
/// Depending on the platform and situation this may cause a non-unwindable panic or abort.
|
||||
Terminate,
|
||||
/// Cleanups to be done.
|
||||
Cleanup(BasicBlock),
|
||||
}
|
||||
|
|
|
@ -274,6 +274,7 @@ impl<'tcx> Debug for TerminatorKind<'tcx> {
|
|||
// Not needed or included in successors
|
||||
None | Some(UnwindAction::Continue) | Some(UnwindAction::Cleanup(_)) => None,
|
||||
Some(UnwindAction::Unreachable) => Some("unwind unreachable"),
|
||||
Some(UnwindAction::Terminate) => Some("unwind terminate"),
|
||||
};
|
||||
|
||||
match (successor_count, unwind) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue