Skip to content

Commit

Permalink
Auto merge of #42537 - michaelwoerister:tcx-for-dep-node, r=nikomatsakis
Browse files Browse the repository at this point in the history
incr.comp.: Make DepNode `Copy` and valid across compilation sessions

This PR moves `DepNode` to a representation that does not need retracing and thus simplifies comparing dep-graphs from different compilation sessions. The code also gets a lot simpler in many places, since we don't need the generic parameter on `DepNode` anymore.  See #42294 for details.

~~NOTE: Only the last commit of this is new, the rest is already reviewed in #42504

This PR is almost done but there are some things I still want to do:
- [x] Add some module-level documentation to `dep_node.rs`, explaining especially what the `define_dep_nodes!()` macro is about.
- [x] Do another pass over the dep-graph loading logic. I suspect that we can get rid of building the `edges` map and also use arrays instead of hash maps in some places.

cc @rust-lang/compiler
r? @nikomatsakis
  • Loading branch information
bors committed Jun 12, 2017
2 parents 0a5218b + fdff2d3 commit 3f8b936
Show file tree
Hide file tree
Showing 39 changed files with 1,007 additions and 785 deletions.
11 changes: 5 additions & 6 deletions src/librustc/dep_graph/debug.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@

use super::dep_node::DepNode;
use std::error::Error;
use std::fmt::Debug;

/// A dep-node filter goes from a user-defined string to a query over
/// nodes. Right now the format is like this:
Expand All @@ -39,7 +38,7 @@ impl DepNodeFilter {
}

/// Tests whether `node` meets the filter, returning true if so.
pub fn test<D: Clone + Debug>(&self, node: &DepNode<D>) -> bool {
pub fn test(&self, node: &DepNode) -> bool {
let debug_str = format!("{:?}", node);
self.text.split("&")
.map(|s| s.trim())
Expand Down Expand Up @@ -67,10 +66,10 @@ impl EdgeFilter {
}
}

pub fn test<D: Clone + Debug>(&self,
source: &DepNode<D>,
target: &DepNode<D>)
-> bool {
pub fn test(&self,
source: &DepNode,
target: &DepNode)
-> bool {
self.source.test(source) && self.target.test(target)
}
}
Loading

0 comments on commit 3f8b936

Please sign in to comment.