@@ -482,6 +482,17 @@ fn create_fn_ty(cx: @CrateContext, fn_ty: ty::t, inputs: ~[ty::t], output: ty::t
482
482
} ;
483
483
}
484
484
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
+
485
496
fn create_ty ( cx : @CrateContext , t : ty:: t , span : span ) -> DIType {
486
497
let dcx = dbg_cx ( cx) ;
487
498
let ty_id = ty:: type_id ( t) ;
@@ -512,7 +523,8 @@ fn create_ty(cx: @CrateContext, t: ty::t, span: span) -> DIType {
512
523
}
513
524
} ,
514
525
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)
516
528
}
517
529
ty:: ty_box( ref mt) | ty:: ty_uniq( ref mt) => {
518
530
let boxed = create_ty ( cx, mt. ty , span) ;
@@ -538,18 +550,21 @@ fn create_ty(cx: @CrateContext, t: ty::t, span: span) -> DIType {
538
550
create_pointer_type ( cx, t, span, pointee)
539
551
} ,
540
552
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)
542
555
} ,
543
556
ty:: ty_bare_fn( ref barefnty) => {
544
557
let inputs = barefnty. sig . inputs . map ( |a| * a) ;
545
558
let output = barefnty. sig . output ;
546
559
create_fn_ty ( cx, t, inputs, output, span)
547
560
} ,
548
561
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)
550
564
} ,
551
565
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)
553
568
} ,
554
569
ty:: ty_struct( did, ref substs) => {
555
570
let fields = ty:: struct_fields ( cx. tcx , did, substs) ;
@@ -572,7 +587,10 @@ pub fn create_local_var(bcx: block, local: @ast::local) -> DIVariable {
572
587
let ident = match local. node . pat . node {
573
588
ast:: pat_ident( _, pth, _) => ast_util:: path_to_ident ( pth) ,
574
589
// 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
+ }
576
594
} ;
577
595
let name: & str = cx. sess . str_of ( ident) ;
578
596
debug ! ( "create_local_var: %s" , name) ;
0 commit comments