diff options
| author | Matt Weber <30441572+mweber15@users.noreply.github.com> | 2024-03-01 23:33:46 -0500 |
|---|---|---|
| committer | Matt Weber <30441572+mweber15@users.noreply.github.com> | 2024-11-06 22:26:18 -0500 |
| commit | 21c58b1b2ca37b6a09a1302b035a30878bffd96a (patch) | |
| tree | 87975c6ec324ad1862f478c808888b2e694afb74 /compiler/rustc_codegen_llvm | |
| parent | 4692d46a461502ed5732a80cd0848db50cfc678a (diff) | |
| download | rust-21c58b1b2ca37b6a09a1302b035a30878bffd96a.tar.gz rust-21c58b1b2ca37b6a09a1302b035a30878bffd96a.zip | |
Rename option and add doc
Diffstat (limited to 'compiler/rustc_codegen_llvm')
4 files changed, 40 insertions, 45 deletions
diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs index 0a442f44a8d..d68da52be11 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata.rs @@ -998,12 +998,12 @@ fn build_field_di_node<'ll, 'tcx>( type_di_node: &'ll DIType, def_id: Option<DefId>, ) -> &'ll DIType { - let (file_metadata, line_number) = - if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { - file_metadata_from_def_id(cx, def_id) - } else { - (unknown_file_metadata(cx), UNKNOWN_LINE_NUMBER) - }; + let (file_metadata, line_number) = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers + { + file_metadata_from_def_id(cx, def_id) + } else { + (unknown_file_metadata(cx), UNKNOWN_LINE_NUMBER) + }; unsafe { llvm::LLVMRustDIBuilderCreateMemberType( DIB(cx), @@ -1055,7 +1055,7 @@ fn build_struct_type_di_node<'ll, 'tcx>( let containing_scope = get_namespace_for_item(cx, adt_def.did()); let struct_type_and_layout = cx.layout_of(struct_type); let variant_def = adt_def.non_enum_variant(); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id(cx, Some(adt_def.did()))) } else { None @@ -1088,8 +1088,7 @@ fn build_struct_type_di_node<'ll, 'tcx>( Cow::Borrowed(f.name.as_str()) }; let field_layout = struct_type_and_layout.field(cx, i); - let def_id = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo - { + let def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(f.did) } else { None @@ -1221,7 +1220,7 @@ fn build_closure_env_di_node<'ll, 'tcx>( let containing_scope = get_namespace_for_item(cx, def_id); let type_name = compute_debuginfo_type_name(cx.tcx, closure_env_type, false); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id(cx, Some(def_id))) } else { None @@ -1258,7 +1257,7 @@ fn build_union_type_di_node<'ll, 'tcx>( let containing_scope = get_namespace_for_item(cx, union_def_id); let union_ty_and_layout = cx.layout_of(union_type); let type_name = compute_debuginfo_type_name(cx.tcx, union_type, false); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id(cx, Some(union_def_id))) } else { None @@ -1284,8 +1283,7 @@ fn build_union_type_di_node<'ll, 'tcx>( .enumerate() .map(|(i, f)| { let field_layout = union_ty_and_layout.field(cx, i); - let def_id = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo - { + let def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(f.did) } else { None diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs index 83a0af851bd..81a77ef4e98 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/cpp_like.rs @@ -192,7 +192,7 @@ pub(super) fn build_enum_type_di_node<'ll, 'tcx>( assert!(!wants_c_like_enum_debuginfo(cx.tcx, enum_type_and_layout)); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id(cx, Some(enum_adt_def.did()))) } else { None @@ -269,7 +269,7 @@ pub(super) fn build_coroutine_di_node<'ll, 'tcx>( unique_type_id: UniqueTypeId<'tcx>, ) -> DINodeCreationResult<'ll> { let coroutine_type = unique_type_id.expect_ty(); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { let &ty::Coroutine(coroutine_def_id, _) = coroutine_type.kind() else { bug!("build_coroutine_di_node() called with non-coroutine type: `{:?}`", coroutine_type) }; @@ -337,7 +337,7 @@ fn build_single_variant_union_fields<'ll, 'tcx>( let tag_base_type_di_node = type_di_node(cx, tag_base_type); let tag_base_type_align = cx.align_of(tag_base_type); - let enum_adt_def_id = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let enum_adt_def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(enum_adt_def.did()) } else { None @@ -408,7 +408,7 @@ fn build_union_fields_for_enum<'ll, 'tcx>( ) -> SmallVec<&'ll DIType> { let tag_base_type = tag_base_type(cx.tcx, enum_type_and_layout); - let enum_adt_def_id = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let enum_adt_def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(enum_adt_def.did()) } else { None @@ -721,7 +721,7 @@ fn build_union_fields_for_direct_tag_coroutine<'ll, 'tcx>( variant_range .clone() .map(|variant_index| (variant_index, CoroutineArgs::variant_name(variant_index))), - if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(coroutine_def_id) } else { None @@ -818,7 +818,7 @@ fn build_union_fields_for_direct_tag_enum_or_coroutine<'ll, 'tcx>( tag_base_type_di_node, tag_base_type, variant_member_info.discr, - if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { variant_member_info.source_info } else { None diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs index 16ae8dc37e5..1486096ddcb 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/mod.rs @@ -68,7 +68,7 @@ fn build_c_style_enum_di_node<'ll, 'tcx>( enum_type_and_layout: TyAndLayout<'tcx>, ) -> DINodeCreationResult<'ll> { let containing_scope = get_namespace_for_item(cx, enum_adt_def.did()); - let enum_adt_def_id = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let enum_adt_def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(enum_adt_def.did()) } else { None @@ -122,12 +122,12 @@ fn build_enumeration_type_di_node<'ll, 'tcx>( }) .collect(); - let (file_metadata, line_number) = - if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { - file_metadata_from_def_id(cx, def_id) - } else { - (unknown_file_metadata(cx), UNKNOWN_LINE_NUMBER) - }; + let (file_metadata, line_number) = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers + { + file_metadata_from_def_id(cx, def_id) + } else { + (unknown_file_metadata(cx), UNKNOWN_LINE_NUMBER) + }; unsafe { llvm::LLVMRustDIBuilderCreateEnumerationType( @@ -207,7 +207,7 @@ fn build_enum_variant_struct_type_di_node<'ll, 'tcx>( ) -> &'ll DIType { assert_eq!(variant_layout.ty, enum_type_and_layout.ty); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id(cx, Some(variant_def.def_id))) } else { None diff --git a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs index 326aba7d2f3..3b4c6ea0893 100644 --- a/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs +++ b/compiler/rustc_codegen_llvm/src/debuginfo/metadata/enums/native.rs @@ -56,7 +56,7 @@ pub(super) fn build_enum_type_di_node<'ll, 'tcx>( assert!(!wants_c_like_enum_debuginfo(cx.tcx, enum_type_and_layout)); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id(cx, Some(enum_adt_def.did()))) } else { None @@ -92,8 +92,7 @@ pub(super) fn build_enum_type_di_node<'ll, 'tcx>( enum_type_and_layout.for_variant(cx, variant_index), visibility_flags, ), - source_info: if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo - { + source_info: if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id( cx, Some(enum_adt_def.variant(variant_index).def_id), @@ -104,8 +103,7 @@ pub(super) fn build_enum_type_di_node<'ll, 'tcx>( }) .collect(); - let enum_adt_def_id = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo - { + let enum_adt_def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(enum_adt_def.did()) } else { None @@ -157,7 +155,7 @@ pub(super) fn build_coroutine_di_node<'ll, 'tcx>( let coroutine_type_name = compute_debuginfo_type_name(cx.tcx, coroutine_type, false); - let def_location = if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { + let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { Some(file_metadata_from_def_id(cx, Some(coroutine_def_id))) } else { None @@ -227,12 +225,11 @@ pub(super) fn build_coroutine_di_node<'ll, 'tcx>( }) .collect(); - let generator_def_id = - if cx.sess().opts.unstable_opts.more_source_locations_in_debuginfo { - Some(generator_def_id) - } else { - None - }; + let coroutine_def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers { + Some(coroutine_def_id) + } else { + None + }; smallvec