@@ -287,6 +287,27 @@ fn rustc_generator_to_generator(
287
287
}
288
288
}
289
289
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
+
290
311
fn rustc_terminator_to_terminator (
291
312
terminator : & rustc_middle:: mir:: Terminator < ' _ > ,
292
313
) -> stable_mir:: mir:: Terminator {
@@ -330,7 +351,19 @@ fn rustc_terminator_to_terminator(
330
351
target : target. as_usize ( ) ,
331
352
unwind : rustc_unwind_to_unwind ( unwind) ,
332
353
} ,
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
+ }
334
367
Yield { .. } | GeneratorDrop | FalseEdge { .. } | FalseUnwind { .. } => unreachable ! ( ) ,
335
368
}
336
369
}
0 commit comments