remove the "misc-items" from meta-data
It was duplicating information available elsewhere.
This commit is contained in:
parent
2a84449169
commit
4c2f3ff442
3 changed files with 9 additions and 41 deletions
|
|
@ -149,9 +149,9 @@ pub const tag_items_data_item_visibility: usize = 0x78;
|
|||
pub const tag_items_data_item_inherent_impl: usize = 0x79;
|
||||
// GAP 0x7a
|
||||
pub const tag_mod_child: usize = 0x7b;
|
||||
pub const tag_misc_info: usize = 0x108; // top-level only
|
||||
pub const tag_misc_info_crate_items: usize = 0x7c;
|
||||
// GAP 0x7c
|
||||
|
||||
// GAP 0x108
|
||||
pub const tag_impls: usize = 0x109; // top-level only
|
||||
pub const tag_impls_trait: usize = 0x7d;
|
||||
pub const tag_impls_trait_impl: usize = 0x7e;
|
||||
|
|
|
|||
|
|
@ -23,6 +23,7 @@ use index;
|
|||
use tls_context;
|
||||
use tydecode::TyDecoder;
|
||||
|
||||
use rustc::hir::def_id::CRATE_DEF_INDEX;
|
||||
use rustc::hir::svh::Svh;
|
||||
use rustc::hir::map as hir_map;
|
||||
use rustc::hir::map::DefKey;
|
||||
|
|
@ -732,15 +733,7 @@ pub fn each_top_level_item_of_crate<F, G>(cdata: Cmd, get_crate_data: G, callbac
|
|||
where F: FnMut(DefLike, ast::Name, ty::Visibility),
|
||||
G: FnMut(ast::CrateNum) -> Rc<CrateMetadata>,
|
||||
{
|
||||
let root_doc = rbml::Doc::new(cdata.data());
|
||||
let misc_info_doc = reader::get_doc(root_doc, tag_misc_info);
|
||||
let crate_items_doc = reader::get_doc(misc_info_doc,
|
||||
tag_misc_info_crate_items);
|
||||
|
||||
each_child_of_item_or_crate(cdata,
|
||||
crate_items_doc,
|
||||
get_crate_data,
|
||||
callback)
|
||||
each_child_of_item(cdata, CRATE_DEF_INDEX, get_crate_data, callback)
|
||||
}
|
||||
|
||||
pub fn get_item_name(cdata: Cmd, id: DefIndex) -> ast::Name {
|
||||
|
|
|
|||
|
|
@ -1693,30 +1693,6 @@ fn encode_impls<'a>(ecx: &'a EncodeContext,
|
|||
rbml_w.end_tag();
|
||||
}
|
||||
|
||||
fn encode_misc_info(ecx: &EncodeContext,
|
||||
krate: &hir::Crate,
|
||||
rbml_w: &mut Encoder) {
|
||||
rbml_w.start_tag(tag_misc_info);
|
||||
rbml_w.start_tag(tag_misc_info_crate_items);
|
||||
for item_id in &krate.module.item_ids {
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(ecx.tcx.map.local_def_id(item_id.id)));
|
||||
|
||||
let item = ecx.tcx.map.expect_item(item_id.id);
|
||||
each_auxiliary_node_id(item, |auxiliary_node_id| {
|
||||
rbml_w.wr_tagged_u64(tag_mod_child,
|
||||
def_to_u64(ecx.tcx.map.local_def_id(auxiliary_node_id)));
|
||||
true
|
||||
});
|
||||
}
|
||||
|
||||
// Encode reexports for the root module.
|
||||
encode_reexports(ecx, rbml_w, 0);
|
||||
|
||||
rbml_w.end_tag();
|
||||
rbml_w.end_tag();
|
||||
}
|
||||
|
||||
// Encodes all reachable symbols in this crate into the metadata.
|
||||
//
|
||||
// This pass is seeded off the reachability list calculated in the
|
||||
|
|
@ -1861,7 +1837,7 @@ fn encode_metadata_inner(rbml_w: &mut Encoder,
|
|||
codemap_bytes: u64,
|
||||
macro_defs_bytes: u64,
|
||||
impl_bytes: u64,
|
||||
misc_bytes: u64,
|
||||
reachable_bytes: u64,
|
||||
item_bytes: u64,
|
||||
index_bytes: u64,
|
||||
xref_bytes: u64,
|
||||
|
|
@ -1877,7 +1853,7 @@ fn encode_metadata_inner(rbml_w: &mut Encoder,
|
|||
codemap_bytes: 0,
|
||||
macro_defs_bytes: 0,
|
||||
impl_bytes: 0,
|
||||
misc_bytes: 0,
|
||||
reachable_bytes: 0,
|
||||
item_bytes: 0,
|
||||
index_bytes: 0,
|
||||
xref_bytes: 0,
|
||||
|
|
@ -1931,11 +1907,10 @@ fn encode_metadata_inner(rbml_w: &mut Encoder,
|
|||
encode_impls(&ecx, krate, rbml_w);
|
||||
stats.impl_bytes = rbml_w.writer.seek(SeekFrom::Current(0)).unwrap() - i;
|
||||
|
||||
// Encode miscellaneous info.
|
||||
// Encode reachability info.
|
||||
i = rbml_w.writer.seek(SeekFrom::Current(0)).unwrap();
|
||||
encode_misc_info(&ecx, krate, rbml_w);
|
||||
encode_reachable(&ecx, rbml_w);
|
||||
stats.misc_bytes = rbml_w.writer.seek(SeekFrom::Current(0)).unwrap() - i;
|
||||
stats.reachable_bytes = rbml_w.writer.seek(SeekFrom::Current(0)).unwrap() - i;
|
||||
|
||||
// Encode and index the items.
|
||||
rbml_w.start_tag(tag_items);
|
||||
|
|
@ -1972,7 +1947,7 @@ fn encode_metadata_inner(rbml_w: &mut Encoder,
|
|||
println!(" codemap bytes: {}", stats.codemap_bytes);
|
||||
println!(" macro def bytes: {}", stats.macro_defs_bytes);
|
||||
println!(" impl bytes: {}", stats.impl_bytes);
|
||||
println!(" misc bytes: {}", stats.misc_bytes);
|
||||
println!(" reachable bytes: {}", stats.reachable_bytes);
|
||||
println!(" item bytes: {}", stats.item_bytes);
|
||||
println!(" index bytes: {}", stats.index_bytes);
|
||||
println!(" xref bytes: {}", stats.xref_bytes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue