Skip to content

Commit 9022ddf

Browse files
committed
---
yaml --- r: 231695 b: refs/heads/auto c: 0762f58 h: refs/heads/master i: 231693: 3e21ad1 231691: 3861a15 231687: 6f43224 231679: 12dac55 v: v3
1 parent a32e595 commit 9022ddf

File tree

10 files changed

+354
-288
lines changed

10 files changed

+354
-288
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503
88
refs/tags/release-0.3.1: 495bae036dfe5ec6ceafd3312b4dca48741e845b
99
refs/tags/release-0.4: e828ea2080499553b97dfe33b3f4d472b4562ad7
1010
refs/tags/release-0.5: 7e3bcfbf21278251ee936ad53e92e9b719702d73
11-
refs/heads/auto: 7732ad85df5a8fe0d6176aa08e6b86e6636561d1
11+
refs/heads/auto: 0762f58c1143b4ff0ae5d0cdda9cdd8249512e77
1212
refs/tags/release-0.6: b4ebcfa1812664df5e142f0134a5faea3918544c
1313
refs/tags/0.1: b19db808c2793fe2976759b85a355c3ad8c8b336
1414
refs/tags/0.2: 1754d02027f2924bed83b0160ee340c7f41d5ea1

branches/auto/src/librustc/lib.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,6 @@
5151
#![feature(rustc_diagnostic_macros)]
5252
#![feature(rustc_private)]
5353
#![feature(scoped_tls)]
54-
#![feature(slice_bytes)]
5554
#![feature(slice_splits)]
5655
#![feature(slice_patterns)]
5756
#![feature(staged_api)]

branches/auto/src/librustc/metadata/common.rs

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -45,13 +45,7 @@ pub const tag_items_data_item_is_tuple_struct_ctor: usize = 0x29;
4545

4646
pub const tag_index: usize = 0x2a;
4747

48-
pub const tag_index_buckets: usize = 0x2b;
49-
50-
pub const tag_index_buckets_bucket: usize = 0x2c;
51-
52-
pub const tag_index_buckets_bucket_elt: usize = 0x2d;
53-
54-
pub const tag_index_table: usize = 0x2e;
48+
// GAP 0x2b, 0x2c, 0x2d, 0x2e
5549

5650
pub const tag_meta_item_name_value: usize = 0x2f;
5751

branches/auto/src/librustc/metadata/creader.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -304,6 +304,7 @@ impl<'a> CrateReader<'a> {
304304
let cmeta = Rc::new(cstore::crate_metadata {
305305
name: name.to_string(),
306306
local_path: RefCell::new(SmallVector::zero()),
307+
index: decoder::load_index(metadata.as_slice()),
307308
data: metadata,
308309
cnum_map: RefCell::new(cnum_map),
309310
cnum: cnum,
@@ -521,7 +522,7 @@ impl<'a> CrateReader<'a> {
521522
}
522523

523524
let registrar = decoder::get_plugin_registrar_fn(ekrate.metadata.as_slice())
524-
.map(|id| decoder::get_symbol(ekrate.metadata.as_slice(), id));
525+
.map(|id| decoder::get_symbol_from_buf(ekrate.metadata.as_slice(), id));
525526

526527
match (ekrate.dylib.as_ref(), registrar) {
527528
(Some(dylib), Some(reg)) => Some((dylib.to_path_buf(), reg)),

branches/auto/src/librustc/metadata/csearch.rs

Lines changed: 3 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,18 @@
1111
// Searching for information from the cstore
1212

1313
use front::map as ast_map;
14-
use metadata::common::*;
1514
use metadata::cstore;
1615
use metadata::decoder;
1716
use metadata::inline::InlinedItem;
1817
use middle::def_id::DefId;
1918
use middle::lang_items;
2019
use middle::ty;
20+
use util::nodemap::FnvHashMap;
2121

22-
use rbml;
23-
use rbml::reader;
2422
use std::rc::Rc;
2523
use syntax::ast;
2624
use rustc_front::attr;
2725
use rustc_front::hir;
28-
use syntax::diagnostic::expect;
29-
30-
use std::collections::hash_map::HashMap;
3126

3227
#[derive(Copy, Clone)]
3328
pub struct MethodInfo {
@@ -38,7 +33,7 @@ pub struct MethodInfo {
3833

3934
pub fn get_symbol(cstore: &cstore::CStore, def: DefId) -> String {
4035
let cdata = cstore.get_crate_data(def.krate);
41-
decoder::get_symbol(cdata.data(), def.node)
36+
decoder::get_symbol(&cdata, def.node)
4237
}
4338

4439
/// Iterates over all the language items in the given crate.
@@ -201,7 +196,7 @@ pub fn get_struct_field_names(cstore: &cstore::CStore, def: DefId) -> Vec<ast::N
201196
decoder::get_struct_field_names(&cstore.intr, &*cdata, def.node)
202197
}
203198

204-
pub fn get_struct_field_attrs(cstore: &cstore::CStore, def: DefId) -> HashMap<ast::NodeId,
199+
pub fn get_struct_field_attrs(cstore: &cstore::CStore, def: DefId) -> FnvHashMap<ast::NodeId,
205200
Vec<hir::Attribute>> {
206201
let cdata = cstore.get_crate_data(def.krate);
207202
decoder::get_struct_field_attrs(&*cdata)
@@ -243,31 +238,6 @@ pub fn get_super_predicates<'tcx>(tcx: &ty::ctxt<'tcx>, def: DefId)
243238
decoder::get_super_predicates(&*cdata, def.node, tcx)
244239
}
245240

246-
pub fn get_field_type<'tcx>(tcx: &ty::ctxt<'tcx>, class_id: DefId,
247-
def: DefId) -> ty::TypeScheme<'tcx> {
248-
let cstore = &tcx.sess.cstore;
249-
let cdata = cstore.get_crate_data(class_id.krate);
250-
let all_items = reader::get_doc(rbml::Doc::new(cdata.data()), tag_items);
251-
let class_doc = expect(tcx.sess.diagnostic(),
252-
decoder::maybe_find_item(class_id.node, all_items),
253-
|| {
254-
(format!("get_field_type: class ID {:?} not found",
255-
class_id)).to_string()
256-
});
257-
let the_field = expect(tcx.sess.diagnostic(),
258-
decoder::maybe_find_item(def.node, class_doc),
259-
|| {
260-
(format!("get_field_type: in class {:?}, field ID {:?} not found",
261-
class_id,
262-
def)).to_string()
263-
});
264-
let ty = decoder::item_type(def, the_field, tcx, &*cdata);
265-
ty::TypeScheme {
266-
generics: ty::Generics::empty(),
267-
ty: ty,
268-
}
269-
}
270-
271241
pub fn get_impl_polarity<'tcx>(tcx: &ty::ctxt<'tcx>,
272242
def: DefId)
273243
-> Option<hir::ImplPolarity>

branches/auto/src/librustc/metadata/cstore.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ pub use self::LinkagePreference::*;
1818
pub use self::NativeLibraryKind::*;
1919

2020
use back::svh::Svh;
21-
use metadata::{creader, decoder, loader};
21+
use metadata::{creader, decoder, index, loader};
2222
use session::search_paths::PathKind;
2323
use util::nodemap::{FnvHashMap, NodeMap, NodeSet};
2424

@@ -65,6 +65,7 @@ pub struct crate_metadata {
6565
pub codemap_import_info: RefCell<Vec<ImportedFileMap>>,
6666
pub span: codemap::Span,
6767
pub staged_api: bool,
68+
pub index: index::Index,
6869

6970
/// Flag if this crate is required by an rlib version of this crate, or in
7071
/// other words whether it was explicitly linked to. An example of a crate

0 commit comments

Comments
 (0)