@@ -567,39 +567,37 @@ fn build_variant_struct_wrapper_type_di_node<'ll, 'tcx>(
567567 None ,
568568 ) ) ;
569569
570- let build_assoc_const = |name : & str ,
571- type_di_node_ : & ' ll DIType ,
572- value : u64 ,
573- align : Align | unsafe {
574- // FIXME: Currently we force all DISCR_* values to be u64's as LLDB seems to have
575- // problems inspecting other value types. Since DISCR_* is typically only going to be
576- // directly inspected via the debugger visualizer - which compares it to the `tag` value
577- // (whose type is not modified at all) it shouldn't cause any real problems.
578- let ( t_di, align) = if name == ASSOC_CONST_DISCR_NAME {
579- ( type_di_node_, align. bits ( ) as u32 )
580- } else {
581- let ty_u64 = Ty :: new_uint ( cx. tcx , ty:: UintTy :: U64 ) ;
582- ( type_di_node ( cx, ty_u64) , Align :: EIGHT . bits ( ) as u32 )
570+ let build_assoc_const =
571+ |name : & str , type_di_node_ : & ' ll DIType , value : u64 , align : Align | unsafe {
572+ // FIXME: Currently we force all DISCR_* values to be u64's as LLDB seems to have
573+ // problems inspecting other value types. Since DISCR_* is typically only going to be
574+ // directly inspected via the debugger visualizer - which compares it to the `tag` value
575+ // (whose type is not modified at all) it shouldn't cause any real problems.
576+ let ( t_di, align) = if name == ASSOC_CONST_DISCR_NAME {
577+ ( type_di_node_, align. bits ( ) as u32 )
578+ } else {
579+ let ty_u64 = Ty :: new_uint ( cx. tcx , ty:: UintTy :: U64 ) ;
580+ ( type_di_node ( cx, ty_u64) , Align :: EIGHT . bits ( ) as u32 )
581+ } ;
582+
583+ // must wrap type in a `const` modifier for LLDB to be able to inspect the value of the member
584+ let field_type =
585+ llvm:: LLVMDIBuilderCreateQualifiedType ( DIB ( cx) , DW_TAG_const_type , t_di) ;
586+
587+ llvm:: LLVMRustDIBuilderCreateStaticMemberType (
588+ DIB ( cx) ,
589+ wrapper_struct_type_di_node,
590+ name. as_c_char_ptr ( ) ,
591+ name. len ( ) ,
592+ unknown_file_metadata ( cx) ,
593+ UNKNOWN_LINE_NUMBER ,
594+ field_type,
595+ DIFlags :: FlagZero ,
596+ Some ( cx. const_u64 ( value) ) ,
597+ align,
598+ )
583599 } ;
584600
585- // must wrap type in a `const` modifier for LLDB to be able to inspect the value of the member
586- let field_type =
587- llvm:: LLVMRustDIBuilderCreateQualifiedType ( DIB ( cx) , DW_TAG_const_type , t_di) ;
588-
589- llvm:: LLVMRustDIBuilderCreateStaticMemberType (
590- DIB ( cx) ,
591- wrapper_struct_type_di_node,
592- name. as_c_char_ptr ( ) ,
593- name. len ( ) ,
594- unknown_file_metadata ( cx) ,
595- UNKNOWN_LINE_NUMBER ,
596- field_type,
597- DIFlags :: FlagZero ,
598- Some ( cx. const_u64 ( value) ) ,
599- align,
600- )
601- } ;
602-
603601 // We also always have an associated constant for the discriminant value
604602 // of the variant.
605603 fields. push ( build_assoc_const (
0 commit comments