Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
29 commits
Select commit Hold shift + click to select a range
dff0c07
rustc: Move a few more cstore methods to queries
alexcrichton Aug 28, 2017
ed6f868
rustc: Move `impl_defaultness` to a query
alexcrichton Aug 28, 2017
98b74c5
rustc: Migrate `CStore::expored_symbols` to a query
alexcrichton Aug 29, 2017
205bc9a
rustc: Migrate `CStore::native_libraries` to a query
alexcrichton Aug 29, 2017
2d4445f
rustc: Move {plugin,derive}_registrar_fn to queries
alexcrichton Aug 29, 2017
ebc1fd3
rustc: Move crate_disambiguator to queries
alexcrichton Aug 29, 2017
d6c88f4
rustc: Move crate_hash to a query
alexcrichton Aug 29, 2017
52b67f9
rustc: Move original_crate_name to a query
alexcrichton Aug 29, 2017
4af1284
Ignore failing incremental tests
alexcrichton Aug 29, 2017
4dec2a8
rustc: Fix a borrow mut error with debug assertions
alexcrichton Aug 30, 2017
1c7294e
rustc: Move implementations_of_trait to a query
alexcrichton Aug 30, 2017
87ea0a1
Ignore failing tests harder
alexcrichton Aug 30, 2017
64a7034
rustc: Remove a number of mutable fields in cstore
alexcrichton Aug 30, 2017
fd61fa5
rustc: Hide the `named_region_map` behind queries
alexcrichton Aug 30, 2017
43ae380
rustc: Flag some CrateStore methods as "untracked"
alexcrichton Aug 31, 2017
a2e2aba
rustc: Migrate lang items to a query
alexcrichton Aug 31, 2017
953490d
rustc: Remove lang item methods from CrateStore
alexcrichton Aug 31, 2017
84ae4b7
rustc: Migrate `CrateStore::item_body` to a query
alexcrichton Aug 31, 2017
88399a9
rustc: Migrate `visible_parent_map` to a query
alexcrichton Aug 31, 2017
0b7e0aa
rustc: Classify two more CrateStore methods untracked
alexcrichton Aug 31, 2017
490f34a
rustc: Remove `CrateStore::used_crate*`
alexcrichton Aug 31, 2017
bf5550b
rustc: Convert `freevars` to a query
alexcrichton Aug 31, 2017
7d9c98e
rustc: Hide `maybe_unused_*` fields in queries
alexcrichton Aug 31, 2017
0182c8b
rustc: Rename item_body query to extern_const_body
alexcrichton Aug 31, 2017
9a23196
rustc: Move stability functionality into queries
alexcrichton Aug 31, 2017
0cdc58a
rustc: Store InternedString in `DefPathData`
alexcrichton Sep 1, 2017
c6445ba
Clarify failure condition on tests
alexcrichton Sep 5, 2017
2ee7493
Add some more with_ignore to get tests passing
alexcrichton Sep 7, 2017
fd0aa64
rustc: Remove `CrateStore::crates` as a method
alexcrichton Sep 7, 2017
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rustc: Rename item_body query to extern_const_body
Should hopefully more accurately reflect what's happening! This commit also
removes the cache in the cstore implementation as it's already cached through
the query infrastructure.
  • Loading branch information
alexcrichton committed Sep 5, 2017
commit 0182c8bbda094c7a6abf89b6c45185ba1e5d38b3
2 changes: 1 addition & 1 deletion src/librustc/dep_graph/dep_node.rs
Original file line number Diff line number Diff line change
Expand Up @@ -563,7 +563,7 @@ define_dep_nodes!( <'tcx>
[] GetLangItems,
[] DefinedLangItems(CrateNum),
[] MissingLangItems(CrateNum),
[] ItemBody(DefId),
[] ExternConstBody(DefId),
[] VisibleParentMap,
[] IsDirectExternCrate(CrateNum),
[] MissingExternCrateItem(CrateNum),
Expand Down
2 changes: 1 addition & 1 deletion src/librustc/ty/maps.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1357,7 +1357,7 @@ define_maps! { <'tcx>
[] get_lang_items: get_lang_items_node(CrateNum) -> Rc<LanguageItems>,
[] defined_lang_items: DefinedLangItems(CrateNum) -> Rc<Vec<(DefIndex, usize)>>,
[] missing_lang_items: MissingLangItems(CrateNum) -> Rc<Vec<LangItem>>,
[] item_body: ItemBody(DefId) -> &'tcx hir::Body,
[] extern_const_body: ExternConstBody(DefId) -> &'tcx hir::Body,
[] visible_parent_map: visible_parent_map_node(CrateNum)
-> Rc<DefIdMap<DefId>>,
[] missing_extern_crate_item: MissingExternCrateItem(CrateNum) -> bool,
Expand Down
4 changes: 2 additions & 2 deletions src/librustc_const_eval/eval.rs
Original file line number Diff line number Diff line change
Expand Up @@ -354,7 +354,7 @@ fn eval_const_expr_partial<'a, 'tcx>(cx: &ConstContext<'a, 'tcx>,
}
} else {
if tcx.is_const_fn(def_id) {
tcx.item_body(def_id)
tcx.extern_const_body(def_id)
} else {
signal!(e, TypeckError)
}
Expand Down Expand Up @@ -774,7 +774,7 @@ fn const_eval<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
tcx.mir_const_qualif(def_id);
tcx.hir.body(tcx.hir.body_owned_by(id))
} else {
tcx.item_body(def_id)
tcx.extern_const_body(def_id)
};
ConstContext::new(tcx, key.param_env.and(substs), tables).eval(&body.value)
}
2 changes: 1 addition & 1 deletion src/librustc_const_eval/pattern.rs
Original file line number Diff line number Diff line change
Expand Up @@ -609,7 +609,7 @@ impl<'a, 'tcx> PatternContext<'a, 'tcx> {
let body = if let Some(id) = self.tcx.hir.as_local_node_id(def_id) {
self.tcx.hir.body(self.tcx.hir.body_owned_by(id))
} else {
self.tcx.item_body(def_id)
self.tcx.extern_const_body(def_id)
};
let pat = self.lower_const_expr(&body.value, pat_id, span);
self.tables = old_tables;
Expand Down
7 changes: 2 additions & 5 deletions src/librustc_metadata/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -215,12 +215,9 @@ provide! { <'tcx> tcx, def_id, other, cdata,
defined_lang_items => { Rc::new(cdata.get_lang_items(&tcx.dep_graph)) }
missing_lang_items => { Rc::new(cdata.get_missing_lang_items(&tcx.dep_graph)) }

item_body => {
if let Some(cached) = tcx.hir.get_inlined_body_untracked(def_id) {
return cached;
}
extern_const_body => {
debug!("item_body({:?}): inlining item", def_id);
cdata.item_body(tcx, def_id.index)
cdata.extern_const_body(tcx, def_id.index)
}

missing_extern_crate_item => {
Expand Down
8 changes: 4 additions & 4 deletions src/librustc_metadata/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -759,10 +759,10 @@ impl<'a, 'tcx> CrateMetadata {
}
}

pub fn item_body(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
id: DefIndex)
-> &'tcx hir::Body {
pub fn extern_const_body(&self,
tcx: TyCtxt<'a, 'tcx, 'tcx>,
id: DefIndex)
-> &'tcx hir::Body {
assert!(!self.is_proc_macro(id));
let ast = self.entry(id).ast.unwrap();
let def_id = self.local_def_id(id);
Expand Down
2 changes: 1 addition & 1 deletion src/librustdoc/clean/inline.rs
Original file line number Diff line number Diff line change
Expand Up @@ -474,7 +474,7 @@ impl hir::print::PpAnn for InlinedConst {
}

fn print_inlined_const(cx: &DocContext, did: DefId) -> String {
let body = cx.tcx.item_body(did);
let body = cx.tcx.extern_const_body(did);
let inlined = InlinedConst {
nested_bodies: cx.tcx.item_body_nested_bodies(did)
};
Expand Down