diff options
| author | Eduard Burtescu <edy.burt@gmail.com> | 2016-05-03 05:23:22 +0300 |
|---|---|---|
| committer | Eduard Burtescu <edy.burt@gmail.com> | 2016-05-11 04:14:58 +0300 |
| commit | 76affa5d6f5d1b8c3afcd4e0c6bbaee1fb0daeb4 (patch) | |
| tree | 106d9822eeb61381393aed89eb5133f1d28135cb /src/librustc_incremental | |
| parent | 166dbc3273ab760004c97d8598b9f30853e6f85a (diff) | |
| download | rust-76affa5d6f5d1b8c3afcd4e0c6bbaee1fb0daeb4.tar.gz rust-76affa5d6f5d1b8c3afcd4e0c6bbaee1fb0daeb4.zip | |
rustc: Split 'tcx into 'gcx and 'tcx for InferCtxt and its users.
Diffstat (limited to 'src/librustc_incremental')
| -rw-r--r-- | src/librustc_incremental/assert_dep_graph.rs | 10 | ||||
| -rw-r--r-- | src/librustc_incremental/calculate_svh.rs | 6 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/directory.rs | 4 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/dirty_clean.rs | 4 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/load.rs | 16 | ||||
| -rw-r--r-- | src/librustc_incremental/persist/save.rs | 6 |
6 files changed, 25 insertions, 21 deletions
diff --git a/src/librustc_incremental/assert_dep_graph.rs b/src/librustc_incremental/assert_dep_graph.rs index 3a41a377d20..b74e7e21226 100644 --- a/src/librustc_incremental/assert_dep_graph.rs +++ b/src/librustc_incremental/assert_dep_graph.rs @@ -63,7 +63,7 @@ const IF_THIS_CHANGED: &'static str = "rustc_if_this_changed"; const THEN_THIS_WOULD_NEED: &'static str = "rustc_then_this_would_need"; const ID: &'static str = "id"; -pub fn assert_dep_graph(tcx: TyCtxt) { +pub fn assert_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { let _ignore = tcx.dep_graph.in_ignore(); if tcx.sess.opts.debugging_opts.dump_dep_graph { @@ -98,7 +98,7 @@ type TargetHashMap = FnvHashSet<(Span, InternedString, ast::NodeId, DepNode<DefId>)>>; struct IfThisChanged<'a, 'tcx:'a> { - tcx: TyCtxt<'a, 'tcx>, + tcx: TyCtxt<'a, 'tcx, 'tcx>, if_this_changed: SourceHashMap, then_this_would_need: TargetHashMap, } @@ -172,9 +172,9 @@ impl<'a, 'tcx> Visitor<'tcx> for IfThisChanged<'a, 'tcx> { } } -fn check_paths(tcx: TyCtxt, - if_this_changed: &SourceHashMap, - then_this_would_need: &TargetHashMap) +fn check_paths<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, + if_this_changed: &SourceHashMap, + then_this_would_need: &TargetHashMap) { // Return early here so as not to construct the query, which is not cheap. if if_this_changed.is_empty() { diff --git a/src/librustc_incremental/calculate_svh.rs b/src/librustc_incremental/calculate_svh.rs index 73af4acfe49..ef3ac4c3426 100644 --- a/src/librustc_incremental/calculate_svh.rs +++ b/src/librustc_incremental/calculate_svh.rs @@ -27,7 +27,7 @@ pub trait SvhCalculate { fn calculate_item_hash(self, def_id: DefId) -> u64; } -impl<'a, 'tcx> SvhCalculate for TyCtxt<'a, 'tcx> { +impl<'a, 'tcx> SvhCalculate for TyCtxt<'a, 'tcx, 'tcx> { fn calculate_krate_hash(self) -> Svh { // FIXME (#14132): This is better than it used to be, but it still not // ideal. We now attempt to hash only the relevant portions of the @@ -118,13 +118,13 @@ mod svh_visitor { use std::hash::{Hash, SipHasher}; pub struct StrictVersionHashVisitor<'a, 'tcx: 'a> { - pub tcx: TyCtxt<'a, 'tcx>, + pub tcx: TyCtxt<'a, 'tcx, 'tcx>, pub st: &'a mut SipHasher, } impl<'a, 'tcx> StrictVersionHashVisitor<'a, 'tcx> { pub fn new(st: &'a mut SipHasher, - tcx: TyCtxt<'a, 'tcx>) + tcx: TyCtxt<'a, 'tcx, 'tcx>) -> Self { StrictVersionHashVisitor { st: st, tcx: tcx } } diff --git a/src/librustc_incremental/persist/directory.rs b/src/librustc_incremental/persist/directory.rs index 299254959c7..e256b7cf7d0 100644 --- a/src/librustc_incremental/persist/directory.rs +++ b/src/librustc_incremental/persist/directory.rs @@ -63,13 +63,13 @@ impl RetracedDefIdDirectory { } pub struct DefIdDirectoryBuilder<'a,'tcx:'a> { - tcx: TyCtxt<'a, 'tcx>, + tcx: TyCtxt<'a, 'tcx, 'tcx>, hash: DefIdMap<Option<DefPathIndex>>, directory: DefIdDirectory, } impl<'a,'tcx> DefIdDirectoryBuilder<'a,'tcx> { - pub fn new(tcx: TyCtxt<'a, 'tcx>) -> DefIdDirectoryBuilder<'a, 'tcx> { + pub fn new(tcx: TyCtxt<'a, 'tcx, 'tcx>) -> DefIdDirectoryBuilder<'a, 'tcx> { DefIdDirectoryBuilder { tcx: tcx, hash: DefIdMap(), diff --git a/src/librustc_incremental/persist/dirty_clean.rs b/src/librustc_incremental/persist/dirty_clean.rs index 9c1452acb84..dee4d667b8d 100644 --- a/src/librustc_incremental/persist/dirty_clean.rs +++ b/src/librustc_incremental/persist/dirty_clean.rs @@ -38,7 +38,7 @@ const CLEAN: &'static str = "rustc_clean"; const LABEL: &'static str = "label"; const CFG: &'static str = "cfg"; -pub fn check_dirty_clean_annotations(tcx: TyCtxt) { +pub fn check_dirty_clean_annotations<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { let _ignore = tcx.dep_graph.in_ignore(); let query = tcx.dep_graph.query(); let krate = tcx.map.krate(); @@ -49,7 +49,7 @@ pub fn check_dirty_clean_annotations(tcx: TyCtxt) { } pub struct DirtyCleanVisitor<'a, 'tcx:'a> { - tcx: TyCtxt<'a, 'tcx>, + tcx: TyCtxt<'a, 'tcx, 'tcx>, query: &'a DepGraphQuery<DefId>, } diff --git a/src/librustc_incremental/persist/load.rs b/src/librustc_incremental/persist/load.rs index fbebb732e99..f9e479745d1 100644 --- a/src/librustc_incremental/persist/load.rs +++ b/src/librustc_incremental/persist/load.rs @@ -37,7 +37,7 @@ type CleanEdges = Vec<(DepNode<DefId>, DepNode<DefId>)>; /// early in compilation, before we've really done any work, but /// actually it doesn't matter all that much.) See `README.md` for /// more general overview. -pub fn load_dep_graph(tcx: TyCtxt) { +pub fn load_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { let _ignore = tcx.dep_graph.in_ignore(); if let Some(dep_graph) = dep_graph_path(tcx) { @@ -47,7 +47,7 @@ pub fn load_dep_graph(tcx: TyCtxt) { } } -pub fn load_dep_graph_if_exists(tcx: TyCtxt, path: &Path) { +pub fn load_dep_graph_if_exists<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, path: &Path) { if !path.exists() { return; } @@ -74,7 +74,9 @@ pub fn load_dep_graph_if_exists(tcx: TyCtxt, path: &Path) { } } -pub fn decode_dep_graph(tcx: TyCtxt, data: &[u8]) -> Result<(), Error> +pub fn decode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, + data: &[u8]) + -> Result<(), Error> { // Deserialize the directory and dep-graph. let mut decoder = Decoder::new(data, 0); @@ -128,10 +130,10 @@ pub fn decode_dep_graph(tcx: TyCtxt, data: &[u8]) -> Result<(), Error> Ok(()) } -fn initial_dirty_nodes(tcx: TyCtxt, - hashed_items: &[SerializedHash], - retraced: &RetracedDefIdDirectory) - -> DirtyNodes { +fn initial_dirty_nodes<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, + hashed_items: &[SerializedHash], + retraced: &RetracedDefIdDirectory) + -> DirtyNodes { let mut items_removed = false; let mut dirty_nodes = FnvHashSet(); for hashed_item in hashed_items { diff --git a/src/librustc_incremental/persist/save.rs b/src/librustc_incremental/persist/save.rs index 2d40e78dee2..cbb3464f3ef 100644 --- a/src/librustc_incremental/persist/save.rs +++ b/src/librustc_incremental/persist/save.rs @@ -20,7 +20,7 @@ use super::data::*; use super::directory::*; use super::util::*; -pub fn save_dep_graph(tcx: TyCtxt) { +pub fn save_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) { let _ignore = tcx.dep_graph.in_ignore(); if let Some(dep_graph) = dep_graph_path(tcx) { @@ -68,7 +68,9 @@ pub fn save_dep_graph(tcx: TyCtxt) { } } -pub fn encode_dep_graph(tcx: TyCtxt, encoder: &mut Encoder) -> io::Result<()> { +pub fn encode_dep_graph<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, + encoder: &mut Encoder) + -> io::Result<()> { // Here we take advantage of how RBML allows us to skip around // and encode the depgraph as a two-part structure: // |
