@@ -287,6 +287,27 @@ fn rustc_generator_to_generator(
287287 }
288288}
289289
290+ fn rustc_inline_asm_operand_to_inline_asm_operand (
291+ operand : & rustc_middle:: mir:: InlineAsmOperand < ' _ > ,
292+ ) -> stable_mir:: mir:: InlineAsmOperand {
293+ use rustc_middle:: mir:: InlineAsmOperand ;
294+
295+ let ( in_value, out_place) = match operand {
296+ InlineAsmOperand :: In { value, .. } => ( Some ( rustc_op_to_op ( value) ) , None ) ,
297+ InlineAsmOperand :: Out { place, .. } => {
298+ ( None , place. map ( |place| rustc_place_to_place ( & place) ) )
299+ }
300+ InlineAsmOperand :: InOut { in_value, out_place, .. } => {
301+ ( Some ( rustc_op_to_op ( in_value) ) , out_place. map ( |place| rustc_place_to_place ( & place) ) )
302+ }
303+ InlineAsmOperand :: Const { .. }
304+ | InlineAsmOperand :: SymFn { .. }
305+ | InlineAsmOperand :: SymStatic { .. } => ( None , None ) ,
306+ } ;
307+
308+ stable_mir:: mir:: InlineAsmOperand { in_value, out_place, raw_rpr : format ! ( "{:?}" , operand) }
309+ }
310+
290311fn rustc_terminator_to_terminator (
291312 terminator : & rustc_middle:: mir:: Terminator < ' _ > ,
292313) -> stable_mir:: mir:: Terminator {
@@ -330,7 +351,19 @@ fn rustc_terminator_to_terminator(
330351 target : target. as_usize ( ) ,
331352 unwind : rustc_unwind_to_unwind ( unwind) ,
332353 } ,
333- InlineAsm { .. } => todo ! ( ) ,
354+ InlineAsm { template, operands, options, line_spans, destination, unwind } => {
355+ Terminator :: InlineAsm {
356+ template : format ! ( "{:?}" , template) ,
357+ operands : operands
358+ . iter ( )
359+ . map ( |operand| rustc_inline_asm_operand_to_inline_asm_operand ( operand) )
360+ . collect ( ) ,
361+ options : format ! ( "{:?}" , options) ,
362+ line_spans : format ! ( "{:?}" , line_spans) ,
363+ destination : destination. map ( |d| d. as_usize ( ) ) ,
364+ unwind : rustc_unwind_to_unwind ( unwind) ,
365+ }
366+ }
334367 Yield { .. } | GeneratorDrop | FalseEdge { .. } | FalseUnwind { .. } => unreachable ! ( ) ,
335368 }
336369}
0 commit comments