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