Skip to content

Commit bcc0a07

Browse files
committed
---
yaml --- r: 11947 b: refs/heads/master c: 16dd6c4 h: refs/heads/master i: 11945: 79fad09 11943: f06e4c7 v: v3
1 parent 1af81de commit bcc0a07

File tree

4 files changed

+23
-23
lines changed

4 files changed

+23
-23
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: d958123d8a8f348e022e0647545b9ec920afd9ee
2+
refs/heads/master: 16dd6c4756c0bd322e0d5335181e9acb8d8076f0
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 4a81779abd786ff22d71434c6d9a5917ea4cdfff
55
refs/heads/try: 2898dcc5d97da9427ac367542382b6239d9c0bbf

trunk/src/rustc/metadata/csearch.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ fn lookup_method_purity(cstore: cstore::cstore, did: ast::def_id)
5151
}
5252
}
5353

54+
/* Returns a vector of possible def IDs for a given path,
55+
in a given crate */
5456
fn resolve_path(cstore: cstore::cstore, cnum: ast::crate_num,
5557
path: [ast::ident]) ->
5658
[(ast::crate_num, @[u8], ast::def_id)] {

trunk/src/rustc/metadata/decoder.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -177,8 +177,8 @@ fn enum_variant_ids(item: ebml::doc, cdata: cmd) -> [ast::def_id] {
177177
ret ids;
178178
}
179179

180-
// Given a path and serialized crate metadata, returns the ID of the
181-
// definition the path refers to.
180+
// Given a path and serialized crate metadata, returns the IDs of the
181+
// definitions the path may refer to.
182182
fn resolve_path(path: [ast::ident], data: @[u8]) -> [ast::def_id] {
183183
fn eq_item(data: [u8], s: str) -> bool {
184184
ret str::eq(str::from_bytes(data), s);

trunk/src/rustc/metadata/encoder.rs

Lines changed: 18 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -152,9 +152,8 @@ fn encode_module_item_paths(ebml_w: ebml::writer, ecx: @encode_ctxt,
152152
encode_def_id(ebml_w, local_def(it.id));
153153
ebml_w.end_tag();
154154
ebml_w.start_tag(tag_paths);
155-
/* a bit confused -- adding the same ident twice
156-
(once for class, once for ctor) */
157155
add_to_index(ebml_w, path, index, it.ident);
156+
#debug("ctor id: %d", ctor.node.id);
158157
encode_named_def_id(ebml_w, it.ident, local_def(ctor.node.id));
159158
encode_class_item_paths(ebml_w, items, path + [it.ident],
160159
index);
@@ -364,7 +363,7 @@ fn encode_info_for_class(ecx: @encode_ctxt, ebml_w: ebml::writer,
364363
ebml_w.start_tag(tag_items_class_member); // ???
365364
alt ci.node.decl {
366365
instance_var(nm, _, _, id) {
367-
#debug("encode_info_for_class: doing %s", nm);
366+
#debug("encode_info_for_class: doing %s %d", nm, id);
368367
encode_family(ebml_w, 'g');
369368
encode_name(ebml_w, nm);
370369
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,
500499
encode_enum_variant_info(ecx, ebml_w, item.id, variants,
501500
path, index, tps);
502501
}
503-
item_class(tps,items,_) {
502+
item_class(tps,items,ctor) {
504503
/* 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,
508507
tps, items);
509-
ebml_w.end_tag();
508+
ebml_w.end_tag();
510509
}
511510
item_res(_, tps, _, _, ctor_id) {
512511
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,
639638
alt check ecx.ccx.tcx.items.get(i.id) {
640639
ast_map::node_item(_, pt) {
641640
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) {
649645
/* this is assuming that ctors aren't inlined...
650646
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()}];
651650
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+
_ {}
655654
}
655+
}
656656
}
657-
658-
}
659657
},
660658
visit_native_item: {|ni, cx, v|
661659
visit::visit_native_item(ni, cx, v);

0 commit comments

Comments
 (0)