Struct rustc::dep_graph::DepGraph
[−]
[src]
pub struct DepGraph { /* fields omitted */ }
rustc_private
)Methods
impl DepGraph
[src]
fn new(enabled: bool) -> DepGraph
rustc_private
)fn is_fully_enabled(&self) -> bool
rustc_private
)True if we are actually building the full dep-graph.
fn query(&self) -> DepGraphQuery<DefId>
rustc_private
)fn in_ignore<'graph>(&'graph self) -> Option<IgnoreTask<'graph>>
rustc_private
)fn in_task<'graph>(&'graph self, key: DepNode<DefId>) -> Option<DepTask<'graph>>
rustc_private
)fn with_ignore<OP, R>(&self, op: OP) -> R where OP: FnOnce() -> R
rustc_private
)fn with_task<C, A, R>(&self,
key: DepNode<DefId>,
cx: C,
arg: A,
task: fn(_: C, _: A) -> R)
-> R where C: DepGraphSafe, A: DepGraphSafe
key: DepNode<DefId>,
cx: C,
arg: A,
task: fn(_: C, _: A) -> R)
-> R where C: DepGraphSafe, A: DepGraphSafe
rustc_private
)Starts a new dep-graph task. Dep-graph tasks are specified
using a free function (task
) and not a closure -- this
is intentional because we want to exercise tight control over
what state they have access to. In particular, we want to
prevent implicit 'leaks' of tracked state into the task (which
could then be read without generating correct edges in the
dep-graph -- see the README for more details on the
dep-graph). To this end, the task function gets exactly two
pieces of state: the context cx
and an argument arg
. Both
of these bits of state must be of some type that implements
DepGraphSafe
and hence does not leak.
The choice of two arguments is not fundamental. One argument
would work just as well, since multiple values can be
collected using tuples. However, using two arguments works out
to be quite convenient, since it is common to need a context
(cx
) and some argument (e.g., a DefId
identifying what
item to process).
For cases where you need some other number of arguments:
- If you only need one argument, just use
()
for thearg
parameter. - If you need 3+ arguments, use a tuple for the
arg
parameter.
fn read(&self, v: DepNode<DefId>)
rustc_private
)fn write(&self, v: DepNode<DefId>)
rustc_private
)fn insert_previous_work_product(&self,
v: &Arc<WorkProductId>,
data: WorkProduct)
v: &Arc<WorkProductId>,
data: WorkProduct)
rustc_private
)Indicates that a previous work product exists for v
. This is
invoked during initial start-up based on what nodes are clean
(and what files exist in the incr. directory).
fn insert_work_product(&self, v: &Arc<WorkProductId>, data: WorkProduct)
rustc_private
)Indicates that we created the given work-product in this run
for v
. This record will be preserved and loaded in the next
run.
fn previous_work_product(&self, v: &Arc<WorkProductId>) -> Option<WorkProduct>
rustc_private
)Check whether a previous work product exists for v
and, if
so, return the path that leads to it. Used to skip doing work.
fn work_products(&self) -> Ref<FxHashMap<Arc<WorkProductId>, WorkProduct>>
rustc_private
)Access the map of work-products created during this run. Only used during saving of the dep-graph.
fn previous_work_products(&self)
-> Ref<FxHashMap<Arc<WorkProductId>, WorkProduct>>
-> Ref<FxHashMap<Arc<WorkProductId>, WorkProduct>>
rustc_private
)Access the map of work-products created during the cached run. Only used during saving of the dep-graph.
Trait Implementations
impl Clone for DepGraph
[src]
fn clone(&self) -> DepGraph
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0
Performs copy-assignment from source
. Read more