Skip to content

Commit 0e3cd7a

Browse files
committed
Add InlineAsm Terminator conversion from MIR to SMIR
1 parent 3572d74 commit 0e3cd7a

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

compiler/rustc_smir/src/rustc_smir/mod.rs

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,15 @@ fn rustc_terminator_to_terminator(
334334
GeneratorDrop => Terminator::GeneratorDrop,
335335
FalseEdge { .. } => todo!(),
336336
FalseUnwind { .. } => todo!(),
337-
InlineAsm { .. } => todo!(),
337+
InlineAsm { template, operands, options, line_spans, destination, unwind } => {
338+
Terminator::InlineAsm {
339+
template: format!("{:?}", template),
340+
operands: format!("{:?}", operands),
341+
options: format!("{:?}", options),
342+
line_spans: format!("{:?}", line_spans),
343+
destination: destination.map(|d| d.as_usize()),
344+
unwind: rustc_unwind_to_unwind(unwind),
345+
}
346+
}
338347
}
339348
}

compiler/rustc_smir/src/stable_mir/mir/body.rs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,14 @@ pub enum Terminator {
4646
unwind: UnwindAction,
4747
},
4848
GeneratorDrop,
49+
InlineAsm {
50+
template: String,
51+
operands: String,
52+
options: String,
53+
line_spans: String,
54+
destination: Option<usize>,
55+
unwind: UnwindAction,
56+
},
4957
}
5058

5159
#[derive(Clone, Debug)]

0 commit comments

Comments
 (0)