@@ -152,9 +152,8 @@ fn encode_module_item_paths(ebml_w: ebml::writer, ecx: @encode_ctxt,
152
152
encode_def_id ( ebml_w, local_def ( it. id ) ) ;
153
153
ebml_w. end_tag ( ) ;
154
154
ebml_w. start_tag ( tag_paths) ;
155
- /* a bit confused -- adding the same ident twice
156
- (once for class, once for ctor) */
157
155
add_to_index ( ebml_w, path, index, it. ident ) ;
156
+ #debug ( "ctor id: %d" , ctor. node . id ) ;
158
157
encode_named_def_id ( ebml_w, it. ident , local_def ( ctor. node . id ) ) ;
159
158
encode_class_item_paths ( ebml_w, items, path + [ it. ident ] ,
160
159
index) ;
@@ -364,7 +363,7 @@ fn encode_info_for_class(ecx: @encode_ctxt, ebml_w: ebml::writer,
364
363
ebml_w. start_tag ( tag_items_class_member) ; // ???
365
364
alt ci. node . decl {
366
365
instance_var ( nm, _, _, id) {
367
- #debug ( "encode_info_for_class: doing %s" , nm) ;
366
+ #debug ( "encode_info_for_class: doing %s %d " , nm, id ) ;
368
367
encode_family ( ebml_w, 'g' ) ;
369
368
encode_name ( ebml_w, nm) ;
370
369
encode_type ( ecx, ebml_w, node_id_to_type ( tcx, id) ) ;
@@ -500,13 +499,13 @@ fn encode_info_for_item(ecx: @encode_ctxt, ebml_w: ebml::writer, item: @item,
500
499
encode_enum_variant_info ( ecx, ebml_w, item. id , variants,
501
500
path, index, tps) ;
502
501
}
503
- item_class ( tps, items, _ ) {
502
+ item_class ( tps, items, ctor ) {
504
503
/* We're not forgetting about the ctor here! It gets
505
- encoded elsewhere */
506
- ebml_w. start_tag ( tag_items_data_item) ;
507
- encode_info_for_class ( ecx, ebml_w, item. id , path, item. ident ,
504
+ encoded elsewhere */
505
+ ebml_w. start_tag ( tag_items_data_item) ;
506
+ encode_info_for_class ( ecx, ebml_w, item. id , path, item. ident ,
508
507
tps, items) ;
509
- ebml_w. end_tag ( ) ;
508
+ ebml_w. end_tag ( ) ;
510
509
}
511
510
item_res ( _, tps, _, _, ctor_id) {
512
511
let fn_ty = node_id_to_type ( tcx, ctor_id) ;
@@ -639,23 +638,22 @@ fn encode_info_for_items(ecx: @encode_ctxt, ebml_w: ebml::writer,
639
638
alt check ecx. ccx . tcx . items . get ( i. id ) {
640
639
ast_map:: node_item ( _, pt) {
641
640
encode_info_for_item ( ecx, ebml_w, i, index, * pt) ;
642
- }
643
- /* TODO: encode info for class items! */
644
- /* encode ctor, then encode items */
645
- ast_map:: node_ctor ( i, path) {
646
- alt i. node {
647
- item_class ( tps, _, ctor) {
648
- #debug ( "class, encoding a fn: %d" , ctor. node . id ) ;
641
+ /* TODO: encode info for class items! */
642
+ /* encode ctor, then encode items */
643
+ alt i. node {
644
+ item_class ( tps, _, ctor) {
649
645
/* this is assuming that ctors aren't inlined...
650
646
probably shouldn't assume that */
647
+ #debug ( "encoding info for ctor %s %d" , i. ident ,
648
+ ctor. node . id ) ;
649
+ * index += [ { val: ctor. node . id , pos: ebml_w. writer . tell ( ) } ] ;
651
650
encode_info_for_fn ( ecx, ebml_w, ctor. node . id , i. ident ,
652
- * path , none, tps, ctor. node . dec )
653
- }
654
- _ { /* TODO: should handle item_res, probably */ }
651
+ * pt , none, tps, ctor. node . dec )
652
+ }
653
+ _ { }
655
654
}
655
+ }
656
656
}
657
-
658
- }
659
657
} ,
660
658
visit_native_item: { |ni, cx, v|
661
659
visit:: visit_native_item ( ni, cx, v) ;
0 commit comments