@@ -471,26 +471,22 @@ pub(crate) fn type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) ->
471471// FIXME(mw): Cache this via a regular UniqueTypeId instead of an extra field in the debug context.
472472fn recursion_marker_type_di_node < ' ll , ' tcx > ( cx : & CodegenCx < ' ll , ' tcx > ) -> & ' ll DIType {
473473 * debug_context ( cx) . recursion_marker_type . get_or_init ( move || {
474- unsafe {
475- // The choice of type here is pretty arbitrary -
476- // anything reading the debuginfo for a recursive
477- // type is going to see *something* weird - the only
478- // question is what exactly it will see.
479- //
480- // FIXME: the name `<recur_type>` does not fit the naming scheme
481- // of other types.
482- //
483- // FIXME: it might make sense to use an actual pointer type here
484- // so that debuggers can show the address.
485- let name = "<recur_type>" ;
486- llvm:: LLVMRustDIBuilderCreateBasicType (
487- DIB ( cx) ,
488- name. as_c_char_ptr ( ) ,
489- name. len ( ) ,
490- cx. tcx . data_layout . pointer_size . bits ( ) ,
491- dwarf_const:: DW_ATE_unsigned ,
492- )
493- }
474+ // The choice of type here is pretty arbitrary -
475+ // anything reading the debuginfo for a recursive
476+ // type is going to see *something* weird - the only
477+ // question is what exactly it will see.
478+ //
479+ // FIXME: the name `<recur_type>` does not fit the naming scheme
480+ // of other types.
481+ //
482+ // FIXME: it might make sense to use an actual pointer type here
483+ // so that debuggers can show the address.
484+ DIB ( cx) . create_basic_type (
485+ "<recur_type>" ,
486+ cx. tcx . data_layout . pointer_size ,
487+ dwarf_const:: DW_ATE_unsigned ,
488+ DIFlags :: FlagZero ,
489+ )
494490 } )
495491}
496492
@@ -772,15 +768,7 @@ fn build_basic_type_di_node<'ll, 'tcx>(
772768 _ => bug ! ( "debuginfo::build_basic_type_di_node - `t` is invalid type" ) ,
773769 } ;
774770
775- let ty_di_node = unsafe {
776- llvm:: LLVMRustDIBuilderCreateBasicType (
777- DIB ( cx) ,
778- name. as_c_char_ptr ( ) ,
779- name. len ( ) ,
780- cx. size_of ( t) . bits ( ) ,
781- encoding,
782- )
783- } ;
771+ let ty_di_node = DIB ( cx) . create_basic_type ( name, cx. size_of ( t) , encoding, DIFlags :: FlagZero ) ;
784772
785773 if !cpp_like_debuginfo {
786774 return DINodeCreationResult :: new ( ty_di_node, false ) ;
0 commit comments