Skip to content

Commit 4443ef9

Browse files
committed
---
yaml --- r: 221101 b: refs/heads/tmp c: 9175a16 h: refs/heads/master i: 221099: 58799ba v: v3
1 parent a02d6ca commit 4443ef9

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
@@ -25,7 +25,7 @@ refs/tags/0.11.0: e1247cb1d0d681be034adb4b558b5a0c0d5720f9
2525
refs/tags/0.12.0: f0c419429ef30723ceaf6b42f9b5a2aeb5d2e2d1
2626
refs/heads/beta: c8bab9d06a179028a0d5129aa62f09d694d9cc49
2727
refs/tags/1.0.0-alpha: e42bd6d93a1d3433c486200587f8f9e12590a4d7
28-
refs/heads/tmp: 47128b8c7ed38b28e1e7788bc9d5197959d450e8
28+
refs/heads/tmp: 9175a16bd8c5b37c485dfe36fea8f9df96e02bf0
2929
refs/tags/1.0.0-alpha.2: 4c705f6bc559886632d3871b04f58aab093bfa2f
3030
refs/tags/homu-tmp: e58601ab085591c71a27ae82137fc313222c2270
3131
refs/tags/1.0.0-beta: 8cbb92b53468ee2b0c2d3eeb8567005953d40828

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