@@ -437,11 +437,9 @@ pub fn type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -> &'ll D
437437
438438 let DINodeCreationResult { di_node, already_stored_in_typemap } = match * t. kind ( ) {
439439 ty:: Never | ty:: Bool | ty:: Char | ty:: Int ( _) | ty:: Uint ( _) | ty:: Float ( _) => {
440- DINodeCreationResult :: new ( build_basic_type_di_node ( cx, t) , false )
441- }
442- ty:: Tuple ( elements) if elements. is_empty ( ) => {
443- DINodeCreationResult :: new ( build_basic_type_di_node ( cx, t) , false )
440+ build_basic_type_di_node ( cx, t)
444441 }
442+ ty:: Tuple ( elements) if elements. is_empty ( ) => build_basic_type_di_node ( cx, t) ,
445443 ty:: Array ( ..) => build_fixed_size_array_di_node ( cx, unique_type_id, t) ,
446444 ty:: Slice ( _) | ty:: Str => build_slice_type_di_node ( cx, t, unique_type_id) ,
447445 ty:: Dynamic ( ..) => build_dyn_type_di_node ( cx, t, unique_type_id) ,
@@ -640,7 +638,10 @@ impl MsvcBasicName for ty::FloatTy {
640638 }
641639}
642640
643- fn build_basic_type_di_node < ' ll , ' tcx > ( cx : & CodegenCx < ' ll , ' tcx > , t : Ty < ' tcx > ) -> & ' ll DIType {
641+ fn build_basic_type_di_node < ' ll , ' tcx > (
642+ cx : & CodegenCx < ' ll , ' tcx > ,
643+ t : Ty < ' tcx > ,
644+ ) -> DINodeCreationResult < ' ll > {
644645 debug ! ( "build_basic_type_di_node: {:?}" , t) ;
645646
646647 // When targeting MSVC, emit MSVC style type names for compatibility with
@@ -649,7 +650,13 @@ fn build_basic_type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -
649650
650651 let ( name, encoding) = match t. kind ( ) {
651652 ty:: Never => ( "!" , DW_ATE_unsigned ) ,
652- ty:: Tuple ( elements) if elements. is_empty ( ) => ( "()" , DW_ATE_unsigned ) ,
653+ ty:: Tuple ( elements) if elements. is_empty ( ) => {
654+ if cpp_like_debuginfo {
655+ return build_tuple_type_di_node ( cx, UniqueTypeId :: for_ty ( cx. tcx , t) ) ;
656+ } else {
657+ ( "()" , DW_ATE_unsigned )
658+ }
659+ }
653660 ty:: Bool => ( "bool" , DW_ATE_boolean ) ,
654661 ty:: Char => ( "char" , DW_ATE_UTF ) ,
655662 ty:: Int ( int_ty) if cpp_like_debuginfo => ( int_ty. msvc_basic_name ( ) , DW_ATE_signed ) ,
@@ -672,14 +679,14 @@ fn build_basic_type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -
672679 } ;
673680
674681 if !cpp_like_debuginfo {
675- return ty_di_node;
682+ return DINodeCreationResult :: new ( ty_di_node, false ) ;
676683 }
677684
678685 let typedef_name = match t. kind ( ) {
679686 ty:: Int ( int_ty) => int_ty. name_str ( ) ,
680687 ty:: Uint ( uint_ty) => uint_ty. name_str ( ) ,
681688 ty:: Float ( float_ty) => float_ty. name_str ( ) ,
682- _ => return ty_di_node,
689+ _ => return DINodeCreationResult :: new ( ty_di_node, false ) ,
683690 } ;
684691
685692 let typedef_di_node = unsafe {
@@ -694,7 +701,7 @@ fn build_basic_type_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>, t: Ty<'tcx>) -
694701 )
695702 } ;
696703
697- typedef_di_node
704+ DINodeCreationResult :: new ( typedef_di_node, false )
698705}
699706
700707fn build_foreign_type_di_node < ' ll , ' tcx > (
0 commit comments