diff options
| author | Santiago Pastorino <spastorino@gmail.com> | 2023-04-20 12:37:32 -0300 |
|---|---|---|
| committer | Santiago Pastorino <spastorino@gmail.com> | 2023-05-03 18:38:15 -0300 |
| commit | 7dd59fceef202e6849f575dd057bb90351362eba (patch) | |
| tree | 2f3ffd365eaab09475302324ee84e63704715ad6 /compiler/rustc_smir | |
| parent | 9b99ff76b28605ad2e2c49e369721ae400e6a665 (diff) | |
| download | rust-7dd59fceef202e6849f575dd057bb90351362eba.tar.gz rust-7dd59fceef202e6849f575dd057bb90351362eba.zip | |
Add Drop terminator to SMIR
Diffstat (limited to 'compiler/rustc_smir')
| -rw-r--r-- | compiler/rustc_smir/src/rustc_smir/mod.rs | 6 | ||||
| -rw-r--r-- | compiler/rustc_smir/src/stable_mir/mir/body.rs | 2 |
2 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_smir/src/rustc_smir/mod.rs b/compiler/rustc_smir/src/rustc_smir/mod.rs index 09cb6fd22d5..57ceb89969d 100644 --- a/compiler/rustc_smir/src/rustc_smir/mod.rs +++ b/compiler/rustc_smir/src/rustc_smir/mod.rs @@ -162,7 +162,11 @@ fn rustc_terminator_to_terminator( Terminate => Terminator::Abort, Return => Terminator::Return, Unreachable => Terminator::Unreachable, - Drop { .. } => todo!(), + Drop { place, target, unwind } => Terminator::Drop { + place: rustc_place_to_place(place), + target: target.as_usize(), + unwind: rustc_unwind_to_unwind(unwind), + }, Call { func, args, destination, target, unwind, from_hir_call: _, fn_span: _ } => { Terminator::Call { func: rustc_op_to_op(func), diff --git a/compiler/rustc_smir/src/stable_mir/mir/body.rs b/compiler/rustc_smir/src/stable_mir/mir/body.rs index bd5e6b68a12..b3d0a835733 100644 --- a/compiler/rustc_smir/src/stable_mir/mir/body.rs +++ b/compiler/rustc_smir/src/stable_mir/mir/body.rs @@ -26,7 +26,7 @@ pub enum Terminator { Drop { place: Place, target: usize, - unwind: Option<usize>, + unwind: UnwindAction, }, Call { func: Operand, |
