diff options
| author | Patrick Walton <[email protected]> | 2011-03-29 14:46:42 -0700 |
|---|---|---|
| committer | Patrick Walton <[email protected]> | 2011-03-29 14:46:42 -0700 |
| commit | 94c061729b66adc777cf346417ab236a5d7d8410 (patch) | |
| tree | eadcdc9c3d3846df0a936ca30d99b37f7ebcaf62 /src/comp/middle | |
| parent | Rename trans_native to trans_native_call, for clarity. (diff) | |
| download | rust-94c061729b66adc777cf346417ab236a5d7d8410.tar.xz rust-94c061729b66adc777cf346417ab236a5d7d8410.zip | |
rustc: Resolve external modules and native modules to definition IDs as well
Diffstat (limited to 'src/comp/middle')
| -rw-r--r-- | src/comp/middle/metadata.rs | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/src/comp/middle/metadata.rs b/src/comp/middle/metadata.rs index 7a9838d7..a55fb848 100644 --- a/src/comp/middle/metadata.rs +++ b/src/comp/middle/metadata.rs @@ -210,15 +210,17 @@ fn encode_module_item_paths(&ebml.writer ebml_w, &ast._mod module) { encode_def_id(ebml_w, did); ebml.end_tag(ebml_w); } - case (ast.item_mod(?id, ?_mod, _)) { + case (ast.item_mod(?id, ?_mod, ?did)) { ebml.start_tag(ebml_w, tag_paths_mod); encode_name(ebml_w, id); + encode_def_id(ebml_w, did); encode_module_item_paths(ebml_w, _mod); ebml.end_tag(ebml_w); } - case (ast.item_native_mod(?id, ?nmod, _)) { + case (ast.item_native_mod(?id, ?nmod, ?did)) { ebml.start_tag(ebml_w, tag_paths_mod); encode_name(ebml_w, id); + encode_def_id(ebml_w, did); encode_native_module_item_paths(ebml_w, nmod); ebml.end_tag(ebml_w); } @@ -336,11 +338,17 @@ fn encode_info_for_item(@trans.crate_ctxt cx, &ebml.writer ebml_w, encode_symbol(cx, ebml_w, did); ebml.end_tag(ebml_w); } - case (ast.item_mod(_, _, _)) { - // nothing to do + case (ast.item_mod(_, _, ?did)) { + ebml.start_tag(ebml_w, tag_items_item); + encode_def_id(ebml_w, did); + encode_kind(ebml_w, 'm' as u8); + ebml.end_tag(ebml_w); } - case (ast.item_native_mod(_, _, _)) { - // nothing to do + case (ast.item_native_mod(_, _, ?did)) { + ebml.start_tag(ebml_w, tag_items_item); + encode_def_id(ebml_w, did); + encode_kind(ebml_w, 'n' as u8); + ebml.end_tag(ebml_w); } case (ast.item_ty(?id, _, ?tps, ?did, ?ann)) { ebml.start_tag(ebml_w, tag_items_item); |