File tree Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Expand file tree Collapse file tree 1 file changed +21
-9
lines changed Original file line number Diff line number Diff line change @@ -361,6 +361,11 @@ define!(
361
361
#[ doc( hidden) ]
362
362
fn __internal_make_place<T >( place: T ) -> * mut T
363
363
) ;
364
+ define ! (
365
+ "mir_debuginfo" ,
366
+ #[ doc( hidden) ]
367
+ fn __debuginfo<T >( name: & ' static str , s: T )
368
+ ) ;
364
369
365
370
/// Macro for generating custom MIR.
366
371
///
@@ -371,6 +376,7 @@ pub macro mir {
371
376
(
372
377
$( type RET = $ret_ty: ty ; ) ?
373
378
$( let $local_decl: ident $( : $local_decl_ty: ty) ? ; ) *
379
+ $( debug $dbg_name: ident => $dbg_data: expr ; ) *
374
380
375
381
{
376
382
$( $entry: tt) *
@@ -394,26 +400,32 @@ pub macro mir {
394
400
$(
395
401
let $local_decl $( : $local_decl_ty) ? ;
396
402
) *
397
-
398
403
:: core:: intrinsics:: mir:: __internal_extract_let!( $( $entry) * ) ;
399
404
$(
400
405
:: core:: intrinsics:: mir:: __internal_extract_let!( $( $block) * ) ;
401
406
) *
402
407
403
408
{
404
- // Finally, the contents of the basic blocks
405
- :: core:: intrinsics:: mir:: __internal_remove_let!( {
406
- { }
407
- { $( $entry) * }
408
- } ) ;
409
+ // Now debuginfo
409
410
$(
411
+ __debuginfo ( stringify ! ( $dbg_name) , $dbg_data) ;
412
+ ) *
413
+
414
+ {
415
+ // Finally, the contents of the basic blocks
410
416
:: core:: intrinsics:: mir:: __internal_remove_let!( {
411
417
{ }
412
- { $( $block ) * }
418
+ { $( $entry ) * }
413
419
} ) ;
414
- ) *
420
+ $(
421
+ :: core:: intrinsics:: mir:: __internal_remove_let!( {
422
+ { }
423
+ { $( $block) * }
424
+ } ) ;
425
+ ) *
415
426
416
- RET
427
+ RET
428
+ }
417
429
}
418
430
}
419
431
} }
You can’t perform that action at this time.
0 commit comments