Add location info for f16
This commit is contained in:
parent
64dd582166
commit
f9ac7aca5d
1 changed files with 18 additions and 0 deletions
|
@ -728,6 +728,14 @@ fn build_cpp_f16_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) -> DINodeCreation
|
||||||
// `f16`'s value to be displayed using a Natvis visualiser in `intrinsic.natvis`.
|
// `f16`'s value to be displayed using a Natvis visualiser in `intrinsic.natvis`.
|
||||||
let float_ty = cx.tcx.types.f16;
|
let float_ty = cx.tcx.types.f16;
|
||||||
let bits_ty = cx.tcx.types.u16;
|
let bits_ty = cx.tcx.types.u16;
|
||||||
|
let def_location = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers {
|
||||||
|
match float_ty.kind() {
|
||||||
|
ty::Adt(def, _) => Some(file_metadata_from_def_id(cx, Some(def.did()))),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
type_map::build_type_with_children(
|
type_map::build_type_with_children(
|
||||||
cx,
|
cx,
|
||||||
type_map::stub(
|
type_map::stub(
|
||||||
|
@ -735,12 +743,21 @@ fn build_cpp_f16_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) -> DINodeCreation
|
||||||
Stub::Struct,
|
Stub::Struct,
|
||||||
UniqueTypeId::for_ty(cx.tcx, float_ty),
|
UniqueTypeId::for_ty(cx.tcx, float_ty),
|
||||||
"f16",
|
"f16",
|
||||||
|
def_location,
|
||||||
cx.size_and_align_of(float_ty),
|
cx.size_and_align_of(float_ty),
|
||||||
NO_SCOPE_METADATA,
|
NO_SCOPE_METADATA,
|
||||||
DIFlags::FlagZero,
|
DIFlags::FlagZero,
|
||||||
),
|
),
|
||||||
// Fields:
|
// Fields:
|
||||||
|cx, float_di_node| {
|
|cx, float_di_node| {
|
||||||
|
let def_id = if cx.sess().opts.unstable_opts.debug_info_type_line_numbers {
|
||||||
|
match bits_ty.kind() {
|
||||||
|
ty::Adt(def, _) => Some(def.did()),
|
||||||
|
_ => None,
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
smallvec![build_field_di_node(
|
smallvec![build_field_di_node(
|
||||||
cx,
|
cx,
|
||||||
float_di_node,
|
float_di_node,
|
||||||
|
@ -749,6 +766,7 @@ fn build_cpp_f16_di_node<'ll, 'tcx>(cx: &CodegenCx<'ll, 'tcx>) -> DINodeCreation
|
||||||
Size::ZERO,
|
Size::ZERO,
|
||||||
DIFlags::FlagZero,
|
DIFlags::FlagZero,
|
||||||
type_di_node(cx, bits_ty),
|
type_di_node(cx, bits_ty),
|
||||||
|
def_id,
|
||||||
)]
|
)]
|
||||||
},
|
},
|
||||||
NO_GENERICS,
|
NO_GENERICS,
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue