Skip to content

Commit d53b477

Browse files
committed
---
yaml --- r: 220903 b: refs/heads/auto c: 9175a16 h: refs/heads/master i: 220901: 2202b89 220899: 0ca9a7b 220895: 1d3bd19 v: v3
1 parent b82b449 commit d53b477

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
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 47128b8c7ed38b28e1e7788bc9d5197959d450e8
11+
refs/heads/auto: 9175a16bd8c5b37c485dfe36fea8f9df96e02bf0
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/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);

branches/auto/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)