@@ -370,7 +370,7 @@ fn create_compile_unit(cx: @mut CrateContext) {
370370 } } } } } } ;
371371}
372372
373- fn create_file ( cx : @ mut CrateContext , full_path : & str ) -> DIFile {
373+ fn create_file ( cx : & mut CrateContext , full_path : & str ) -> DIFile {
374374 match dbg_cx ( cx) . created_files . find_equiv ( & full_path) {
375375 Some ( file_md) => return * file_md,
376376 None => ( )
@@ -440,7 +440,7 @@ fn create_block(bcx: block) -> DILexicalBlock {
440440
441441
442442
443- fn create_basic_type ( cx : @ mut CrateContext , t : ty:: t , _span : span ) -> DIType {
443+ fn create_basic_type ( cx : & mut CrateContext , t : ty:: t , _span : span ) -> DIType {
444444 let ty_id = ty:: type_id ( t) ;
445445 match dbg_cx ( cx) . created_types . find ( & ty_id) {
446446 Some ( ty_md) => return * ty_md,
@@ -492,7 +492,7 @@ fn create_basic_type(cx: @mut CrateContext, t: ty::t, _span: span) -> DIType {
492492 return ty_md;
493493}
494494
495- fn create_pointer_type ( cx : @ mut CrateContext , t : ty:: t , _span : span , pointee : DIType ) -> DIType {
495+ fn create_pointer_type ( cx : & mut CrateContext , t : ty:: t , _span : span , pointee : DIType ) -> DIType {
496496 let ( size, align) = size_and_align_of ( cx, t) ;
497497 let name = ty_to_str ( cx. tcx , t) ;
498498 let ptr_md = do as_c_str ( name) |name| { unsafe {
@@ -517,9 +517,9 @@ struct StructContext {
517517}
518518
519519impl StructContext {
520- fn new ( cx : & CrateContext , name : ~str , file : DIFile , line : uint ) -> ~ StructContext {
520+ fn new ( cx : & CrateContext , name : ~str , file : DIFile , line : uint ) -> StructContext {
521521 debug ! ( "StructContext::create: %s" , name) ;
522- let scx = ~ StructContext {
522+ return StructContext {
523523 builder : DIB ( cx) ,
524524 file : file,
525525 name : name,
@@ -528,7 +528,6 @@ impl StructContext {
528528 total_size : 0 ,
529529 align : 1
530530 } ;
531- return scx;
532531 }
533532
534533 fn add_member ( & mut self , name : & str , line : uint , size : uint , align : uint , ty : DIType ) {
@@ -569,17 +568,19 @@ impl StructContext {
569568 // let size_with_alignment = self.get_total_size_with_alignment();
570569
571570 // if st.size != size_with_alignment {
572- // ccx.sess.bug("StructContext(%s)::verify_against_struct_or_tuple_type: invalid type size. Expected = %u, actual = %u",
571+ // ccx.sess.bug("StructContext(%s)::verify_against_struct_or_tuple_type:
572+ // invalid type size. Expected = %u, actual = %u",
573573 // st.size, size_with_alignment);
574574 // }
575575
576576 // if st.align != self.align {
577- // ccx.sess.bug("StructContext(%s)::verify_against_struct_or_tuple_type: invalid type alignment. Expected = %u, actual = %u",
577+ // ccx.sess.bug("StructContext(%s)::verify_against_struct_or_tuple_type:
578+ // invalid type alignment. Expected = %u, actual = %u",
578579 // st.align, self.align);
579580 // }
580581 // },
581- // _ => ccx.sess.bug(fmt!("StructContext(%s)::verify_against_struct_or_tuple_type: called with invalid type %?",
582- // self.name, t))
582+ // _ => ccx.sess.bug(fmt!("StructContext(%s)::verify_against_struct_or_tuple_type:
583+ // called with invalid type %?", self.name, t))
583584 // }
584585 //}
585586
@@ -613,14 +614,14 @@ impl StructContext {
613614 }
614615}
615616
616- fn create_struct ( cx : @ mut CrateContext , struct_type : ty:: t , fields : ~[ ty:: field ] , span : span )
617+ fn create_struct ( cx : & mut CrateContext , struct_type : ty:: t , fields : ~[ ty:: field ] , span : span )
617618 -> DICompositeType {
618619 debug ! ( "create_struct: %?" , ty:: get( struct_type) ) ;
619620
620621 let loc = span_start ( cx, span) ;
621622 let file_md = create_file ( cx, loc. file . name ) ;
622623
623- let mut scx = StructContext :: new ( cx, ty_to_str ( cx. tcx , t ) , file_md, loc. line ) ;
624+ let mut scx = StructContext :: new ( cx, ty_to_str ( cx. tcx , struct_type ) , file_md, loc. line ) ;
624625 for fields. iter( ) . advance |field| {
625626 let field_t = field. mt. ty;
626627 let ty_md = create_ty( cx, field_t, span) ;
@@ -631,7 +632,7 @@ fn create_struct(cx: @mut CrateContext, struct_type: ty::t, fields: ~[ty::field]
631632}
632633
633634// returns (void* type as a ValueRef, size in bytes, align in bytes)
634- fn voidptr ( cx : @ mut CrateContext ) -> ( DIDerivedType , uint , uint ) {
635+ fn voidptr ( cx : & mut CrateContext ) -> ( DIDerivedType , uint , uint ) {
635636 let size = sys:: size_of :: < ValueRef > ( ) ;
636637 let align = sys:: min_align_of :: < ValueRef > ( ) ;
637638 let vp = do as_c_str ( "*void" ) |name| { unsafe {
@@ -645,7 +646,7 @@ fn voidptr(cx: @mut CrateContext) -> (DIDerivedType, uint, uint) {
645646 return ( vp, size, align) ;
646647}
647648
648- fn create_tuple ( cx : @ mut CrateContext , tuple_type : ty:: t , elements : & [ ty:: t ] , span : span )
649+ fn create_tuple ( cx : & mut CrateContext , tuple_type : ty:: t , elements : & [ ty:: t ] , span : span )
649650 -> DICompositeType {
650651 debug ! ( "create_tuple: %?" , ty:: get( tuple_type) ) ;
651652
@@ -662,7 +663,7 @@ fn create_tuple(cx: @mut CrateContext, tuple_type: ty::t, elements: &[ty::t], sp
662663 return scx. finalize ( ) ;
663664}
664665
665- fn create_boxed_type ( cx : @ mut CrateContext , contents : ty:: t ,
666+ fn create_boxed_type ( cx : & mut CrateContext , contents : ty:: t ,
666667 span : span , boxed : DIType ) -> DICompositeType {
667668 debug ! ( "create_boxed_type: %?" , ty:: get( contents) ) ;
668669
@@ -686,7 +687,7 @@ fn create_boxed_type(cx: @mut CrateContext, contents: ty::t,
686687 return scx. finalize ( ) ;
687688}
688689
689- fn create_fixed_vec ( cx : @ mut CrateContext , _vec_t : ty:: t , elem_t : ty:: t ,
690+ fn create_fixed_vec ( cx : & mut CrateContext , _vec_t : ty:: t , elem_t : ty:: t ,
690691 len : uint , span : span ) -> DIType {
691692 debug ! ( "create_fixed_vec: %?" , ty:: get( _vec_t) ) ;
692693
@@ -708,7 +709,7 @@ fn create_fixed_vec(cx: @mut CrateContext, _vec_t: ty::t, elem_t: ty::t,
708709 } ;
709710}
710711
711- fn create_boxed_vec ( cx : @ mut CrateContext , vec_t : ty:: t , elem_t : ty:: t ,
712+ fn create_boxed_vec ( cx : & mut CrateContext , vec_t : ty:: t , elem_t : ty:: t ,
712713 vec_ty_span : span ) -> DICompositeType {
713714 debug ! ( "create_boxed_vec: %?" , ty:: get( vec_t) ) ;
714715
@@ -778,7 +779,7 @@ fn create_boxed_vec(cx: @mut CrateContext, vec_t: ty::t, elem_t: ty::t,
778779 return mdval;
779780}
780781
781- fn create_vec_slice ( cx : @ mut CrateContext , vec_t : ty:: t , elem_t : ty:: t , span : span )
782+ fn create_vec_slice ( cx : & mut CrateContext , vec_t : ty:: t , elem_t : ty:: t , span : span )
782783 -> DICompositeType {
783784 debug ! ( "create_vec_slice: %?" , ty:: get( vec_t) ) ;
784785
@@ -795,7 +796,7 @@ fn create_vec_slice(cx: @mut CrateContext, vec_t: ty::t, elem_t: ty::t, span: sp
795796 return scx. finalize ( ) ;
796797}
797798
798- fn create_fn_ty ( cx : @ mut CrateContext , _fn_ty : ty:: t , inputs : ~[ ty:: t ] , output : ty:: t ,
799+ fn create_fn_ty ( cx : & mut CrateContext , _fn_ty : ty:: t , inputs : ~[ ty:: t ] , output : ty:: t ,
799800 span : span ) -> DICompositeType {
800801 debug ! ( "create_fn_ty: %?" , ty:: get( _fn_ty) ) ;
801802
@@ -815,7 +816,7 @@ fn create_fn_ty(cx: @mut CrateContext, _fn_ty: ty::t, inputs: ~[ty::t], output:
815816 } ;
816817}
817818
818- fn create_unimpl_ty ( cx : @ mut CrateContext , t : ty:: t ) -> DIType {
819+ fn create_unimpl_ty ( cx : & mut CrateContext , t : ty:: t ) -> DIType {
819820 debug ! ( "create_unimpl_ty: %?" , ty:: get( t) ) ;
820821
821822 let name = ty_to_str ( cx. tcx , t) ;
@@ -830,7 +831,7 @@ fn create_unimpl_ty(cx: @mut CrateContext, t: ty::t) -> DIType {
830831 return md;
831832}
832833
833- fn create_ty ( cx : @ mut CrateContext , t : ty:: t , span : span ) -> DIType {
834+ fn create_ty ( cx : & mut CrateContext , t : ty:: t , span : span ) -> DIType {
834835 let ty_id = ty:: type_id ( t) ;
835836 match dbg_cx ( cx) . created_types . find ( & ty_id) {
836837 Some ( ty_md) => return * ty_md,
@@ -951,7 +952,7 @@ fn span_start(cx: &CrateContext, span: span) -> codemap::Loc {
951952 cx. sess . codemap . lookup_char_pos ( span. lo )
952953}
953954
954- fn size_and_align_of ( cx : @ mut CrateContext , t : ty:: t ) -> ( uint , uint ) {
955+ fn size_and_align_of ( cx : & mut CrateContext , t : ty:: t ) -> ( uint , uint ) {
955956 let llty = type_of:: type_of ( cx, t) ;
956957 ( machine:: llsize_of_real ( cx, llty) , machine:: llalign_of_min ( cx, llty) )
957958}
0 commit comments