Skip to content

Commit 2f1b526

Browse files
committed
---
yaml --- r: 63440 b: refs/heads/snap-stage3 c: 2b45591 h: refs/heads/master v: v3
1 parent 735f326 commit 2f1b526

File tree

2 files changed

+24
-6
lines changed

2 files changed

+24
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 2d28d645422c1617be58c8ca7ad9a457264ca850
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: 51d82f572fe3e286f45b60a9594a2fafd286cb39
4+
refs/heads/snap-stage3: 2b45591daf9edb09d95007ecc658ac6cbaa7ee8a
55
refs/heads/try: 7b78b52e602bb3ea8174f9b2006bff3315f03ef9
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/ndm: f3868061cd7988080c30d6d5bf352a5a5fe2460b

branches/snap-stage3/src/librustc/middle/trans/debuginfo.rs

Lines changed: 23 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -482,6 +482,17 @@ fn create_fn_ty(cx: @CrateContext, fn_ty: ty::t, inputs: ~[ty::t], output: ty::t
482482
};
483483
}
484484

485+
fn create_unimpl_ty(cx: @CrateContext, t: ty::t) -> DIType {
486+
let dcx = dbg_cx(cx);
487+
let name = ty_to_str(cx.tcx, t);
488+
let md = do as_c_str(fmt!("NYI<%s>", name)) |name| { unsafe {
489+
llvm::LLVMDIBuilderCreateBasicType(
490+
dcx.builder, name,
491+
0_u64, 8_u64, DW_ATE_unsigned as c_uint)
492+
}};
493+
return md;
494+
}
495+
485496
fn create_ty(cx: @CrateContext, t: ty::t, span: span) -> DIType {
486497
let dcx = dbg_cx(cx);
487498
let ty_id = ty::type_id(t);
@@ -512,7 +523,8 @@ fn create_ty(cx: @CrateContext, t: ty::t, span: span) -> DIType {
512523
}
513524
},
514525
ty::ty_enum(_did, ref _substs) => {
515-
cx.sess.span_bug(span, "debuginfo for enum NYI")
526+
cx.sess.span_note(span, "debuginfo for enum NYI");
527+
create_unimpl_ty(cx, t)
516528
}
517529
ty::ty_box(ref mt) | ty::ty_uniq(ref mt) => {
518530
let boxed = create_ty(cx, mt.ty, span);
@@ -538,18 +550,21 @@ fn create_ty(cx: @CrateContext, t: ty::t, span: span) -> DIType {
538550
create_pointer_type(cx, t, span, pointee)
539551
},
540552
ty::ty_rptr(ref _region, ref _mt) => {
541-
cx.sess.span_bug(span, "debuginfo for rptr NYI")
553+
cx.sess.span_note(span, "debuginfo for rptr NYI");
554+
create_unimpl_ty(cx, t)
542555
},
543556
ty::ty_bare_fn(ref barefnty) => {
544557
let inputs = barefnty.sig.inputs.map(|a| *a);
545558
let output = barefnty.sig.output;
546559
create_fn_ty(cx, t, inputs, output, span)
547560
},
548561
ty::ty_closure(ref _closurety) => {
549-
cx.sess.span_bug(span, "debuginfo for closure NYI")
562+
cx.sess.span_note(span, "debuginfo for closure NYI");
563+
create_unimpl_ty(cx, t)
550564
},
551565
ty::ty_trait(_did, ref _substs, ref _vstore, _) => {
552-
cx.sess.span_bug(span, "debuginfo for trait NYI")
566+
cx.sess.span_note(span, "debuginfo for trait NYI");
567+
create_unimpl_ty(cx, t)
553568
},
554569
ty::ty_struct(did, ref substs) => {
555570
let fields = ty::struct_fields(cx.tcx, did, substs);
@@ -572,7 +587,10 @@ pub fn create_local_var(bcx: block, local: @ast::local) -> DIVariable {
572587
let ident = match local.node.pat.node {
573588
ast::pat_ident(_, pth, _) => ast_util::path_to_ident(pth),
574589
// FIXME this should be handled (#2533)
575-
_ => fail!("no single variable name for local")
590+
_ => {
591+
bcx.sess().span_note(local.span, "debuginfo for pattern bindings NYI");
592+
return ptr::null();
593+
}
576594
};
577595
let name: &str = cx.sess.str_of(ident);
578596
debug!("create_local_var: %s", name);

0 commit comments

Comments
 (0)