Skip to content

Commit 1610c3e

Browse files
committed
---
yaml --- r: 220733 b: refs/heads/master c: 9175a16 h: refs/heads/master i: 220731: 7786610 v: v3
1 parent a254b75 commit 1610c3e

File tree

3 files changed

+18
-2
lines changed

3 files changed

+18
-2
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 47128b8c7ed38b28e1e7788bc9d5197959d450e8
2+
refs/heads/master: 9175a16bd8c5b37c485dfe36fea8f9df96e02bf0
33
refs/heads/snap-stage3: d4432b37378ec55450e06799f5344b4b0f4b94e0
44
refs/heads/try: b53c0f93eedcdedd4fd89bccc5a3a09d1c5cd23e
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105

trunk/src/librustc_trans/trans/debuginfo/metadata.rs

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -796,7 +796,20 @@ pub fn type_metadata<'a, 'tcx>(cx: &CrateContext<'a, 'tcx>,
796796
}
797797
}
798798
ty::TyBareFn(_, ref barefnty) => {
799-
subroutine_type_metadata(cx, unique_type_id, &barefnty.sig, usage_site_span)
799+
let fn_metadata = subroutine_type_metadata(cx,
800+
unique_type_id,
801+
&barefnty.sig,
802+
usage_site_span).metadata;
803+
match debug_context(cx).type_map
804+
.borrow()
805+
.find_metadata_for_unique_id(unique_type_id) {
806+
Some(metadata) => return metadata,
807+
None => { /* proceed normally */ }
808+
};
809+
810+
// This is actually a function pointer, so wrap it in pointer DI
811+
MetadataCreationResult::new(pointer_type_metadata(cx, t, fn_metadata), false)
812+
800813
}
801814
ty::TyClosure(def_id, substs) => {
802815
let infcx = infer::normalizing_infer_ctxt(cx.tcx(), &cx.tcx().tables);

trunk/src/test/debuginfo/basic-types-metadata.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,8 @@
4242
// gdb-check:type = f32
4343
// gdb-command:whatis f64
4444
// gdb-check:type = f64
45+
// gdb-command:whatis fnptr
46+
// gdb-check:type = void (*)(void)
4547
// gdb-command:info functions _yyy
4648
// gdb-check:[...]![...]_yyy([...]);
4749
// gdb-command:continue
@@ -65,6 +67,7 @@ fn main() {
6567
let u64: u64 = 64;
6668
let f32: f32 = 2.5;
6769
let f64: f64 = 3.5;
70+
let fnptr : fn() = _zzz;
6871
_zzz(); // #break
6972
if 1 == 1 { _yyy(); }
7073
}

0 commit comments

Comments
 (0)