Struct rustc_query_system::dep_graph::graph::DepGraph [−][src]
pub struct DepGraph<K: DepKind> { data: Option<Lrc<DepGraphData<K>>>, virtual_dep_node_index: Lrc<AtomicU32>, }
Fields
data: Option<Lrc<DepGraphData<K>>>virtual_dep_node_index: Lrc<AtomicU32>Expand description
This field is used for assigning DepNodeIndices when running in
non-incremental mode. Even in non-incremental mode we make sure that
each task has a DepNodeIndex that uniquely identifies it. This unique
ID is used for self-profiling.
Implementations
impl<K: DepKind> DepGraph<K>[src]
impl<K: DepKind> DepGraph<K>[src]pub fn new(
prev_graph: PreviousDepGraph<K>,
prev_work_products: FxHashMap<WorkProductId, WorkProduct>,
encoder: FileEncoder,
record_graph: bool,
record_stats: bool
) -> DepGraph<K>[src]
prev_graph: PreviousDepGraph<K>,
prev_work_products: FxHashMap<WorkProductId, WorkProduct>,
encoder: FileEncoder,
record_graph: bool,
record_stats: bool
) -> DepGraph<K>
pub fn new_disabled() -> DepGraph<K>[src]
pub fn is_fully_enabled(&self) -> bool[src]
pub fn is_fully_enabled(&self) -> bool[src]Returns true if we are actually building the full dep-graph, and false otherwise.
pub fn with_query(&self, f: impl Fn(&DepGraphQuery<K>))[src]
pub fn assert_ignored(&self)[src]
pub fn with_ignore<OP, R>(&self, op: OP) -> R where
OP: FnOnce() -> R, [src]
OP: FnOnce() -> R,
pub fn with_task<Ctxt: HasDepContext<DepKind = K>, A, R>(
&self,
key: DepNode<K>,
cx: Ctxt,
arg: A,
task: fn(_: Ctxt, _: A) -> R,
hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex)[src]
pub fn with_task<Ctxt: HasDepContext<DepKind = K>, A, R>(
&self,
key: DepNode<K>,
cx: Ctxt,
arg: A,
task: fn(_: Ctxt, _: A) -> R,
hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex)[src]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 rustc dev guide 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 theargparameter. - If you need 3+ arguments, use a tuple for the
argparameter.
fn with_task_impl<Ctxt: HasDepContext<DepKind = K>, A, R>(
&self,
key: DepNode<K>,
cx: Ctxt,
arg: A,
task: fn(_: Ctxt, _: A) -> R,
create_task: fn(_: DepNode<K>) -> Option<TaskDeps<K>>,
hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex)[src]
&self,
key: DepNode<K>,
cx: Ctxt,
arg: A,
task: fn(_: Ctxt, _: A) -> R,
create_task: fn(_: DepNode<K>) -> Option<TaskDeps<K>>,
hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex)
pub fn with_anon_task<Ctxt: DepContext<DepKind = K>, OP, R>(
&self,
cx: Ctxt,
dep_kind: K,
op: OP
) -> (R, DepNodeIndex) where
OP: FnOnce() -> R, [src]
pub fn with_anon_task<Ctxt: DepContext<DepKind = K>, OP, R>(
&self,
cx: Ctxt,
dep_kind: K,
op: OP
) -> (R, DepNodeIndex) where
OP: FnOnce() -> R, [src]Executes something within an “anonymous” task, that is, a task the
DepNode of which is determined by the list of inputs it read from.
pub fn with_eval_always_task<Ctxt: HasDepContext<DepKind = K>, A, R>(
&self,
key: DepNode<K>,
cx: Ctxt,
arg: A,
task: fn(_: Ctxt, _: A) -> R,
hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex)[src]
pub fn with_eval_always_task<Ctxt: HasDepContext<DepKind = K>, A, R>(
&self,
key: DepNode<K>,
cx: Ctxt,
arg: A,
task: fn(_: Ctxt, _: A) -> R,
hash_result: impl FnOnce(&mut Ctxt::StableHashingContext, &R) -> Option<Fingerprint>
) -> (R, DepNodeIndex)[src]Executes something within an “eval-always” task which is a task that runs whenever anything changes.
pub fn read_index(&self, dep_node_index: DepNodeIndex)[src]
pub fn dep_node_index_of(&self, dep_node: &DepNode<K>) -> DepNodeIndex[src]
pub fn dep_node_index_of_opt(
&self,
dep_node: &DepNode<K>
) -> Option<DepNodeIndex>[src]
&self,
dep_node: &DepNode<K>
) -> Option<DepNodeIndex>
pub fn dep_node_exists(&self, dep_node: &DepNode<K>) -> bool[src]
pub fn prev_fingerprint_of(&self, dep_node: &DepNode<K>) -> Option<Fingerprint>[src]
pub fn previous_work_product(&self, v: &WorkProductId) -> Option<WorkProduct>[src]
pub fn previous_work_product(&self, v: &WorkProductId) -> Option<WorkProduct>[src]Checks whether a previous work product exists for v and, if
so, return the path that leads to it. Used to skip doing work.
pub fn previous_work_products(&self) -> &FxHashMap<WorkProductId, WorkProduct>[src]
pub fn previous_work_products(&self) -> &FxHashMap<WorkProductId, WorkProduct>[src]Access the map of work-products created during the cached run. Only used during saving of the dep-graph.
pub fn register_dep_node_debug_str<F>(
&self,
dep_node: DepNode<K>,
debug_str_gen: F
) where
F: FnOnce() -> String, [src]
&self,
dep_node: DepNode<K>,
debug_str_gen: F
) where
F: FnOnce() -> String,
pub fn dep_node_debug_str(&self, dep_node: DepNode<K>) -> Option<String>[src]
fn node_color(&self, dep_node: &DepNode<K>) -> Option<DepNodeColor>[src]
pub fn try_mark_green_and_read<Ctxt: QueryContext<DepKind = K>>(
&self,
tcx: Ctxt,
dep_node: &DepNode<K>
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)>[src]
pub fn try_mark_green_and_read<Ctxt: QueryContext<DepKind = K>>(
&self,
tcx: Ctxt,
dep_node: &DepNode<K>
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)>[src]Try to read a node index for the node dep_node. A node will have an index, when it’s already been marked green, or when we can mark it green. This function will mark the current task as a reader of the specified node, when a node index can be found for that node.
pub fn try_mark_green<Ctxt: QueryContext<DepKind = K>>(
&self,
tcx: Ctxt,
dep_node: &DepNode<K>
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)>[src]
&self,
tcx: Ctxt,
dep_node: &DepNode<K>
) -> Option<(SerializedDepNodeIndex, DepNodeIndex)>
fn try_mark_previous_green<Ctxt: QueryContext<DepKind = K>>(
&self,
tcx: Ctxt,
data: &DepGraphData<K>,
prev_dep_node_index: SerializedDepNodeIndex,
dep_node: &DepNode<K>
) -> Option<DepNodeIndex>[src]
fn try_mark_previous_green<Ctxt: QueryContext<DepKind = K>>(
&self,
tcx: Ctxt,
data: &DepGraphData<K>,
prev_dep_node_index: SerializedDepNodeIndex,
dep_node: &DepNode<K>
) -> Option<DepNodeIndex>[src]Try to mark a dep-node which existed in the previous compilation session as green.
fn emit_diagnostics<Ctxt: QueryContext<DepKind = K>>(
&self,
tcx: Ctxt,
data: &DepGraphData<K>,
dep_node_index: DepNodeIndex,
prev_dep_node_index: SerializedDepNodeIndex,
diagnostics: Vec<Diagnostic>
)[src]
fn emit_diagnostics<Ctxt: QueryContext<DepKind = K>>(
&self,
tcx: Ctxt,
data: &DepGraphData<K>,
dep_node_index: DepNodeIndex,
prev_dep_node_index: SerializedDepNodeIndex,
diagnostics: Vec<Diagnostic>
)[src]Atomically emits some loaded diagnostics. This may be called concurrently on multiple threads for the same dep node.
pub fn is_red(&self, dep_node: &DepNode<K>) -> bool[src]
pub fn is_green(&self, dep_node: &DepNode<K>) -> bool[src]
pub fn exec_cache_promotions<Ctxt: QueryContext<DepKind = K>>(&self, qcx: Ctxt)[src]
pub fn register_reused_dep_nodes<Ctxt: DepContext<DepKind = K>>(
&self,
tcx: Ctxt
)[src]
&self,
tcx: Ctxt
)
pub fn print_incremental_info(&self)[src]
pub fn encode(&self, profiler: &SelfProfilerRef) -> FileEncodeResult[src]
fn next_virtual_depnode_index(&self) -> DepNodeIndex[src]
Trait Implementations
Auto Trait Implementations
impl<K> !RefUnwindSafe for DepGraph<K>
impl<K> !Send for DepGraph<K>
impl<K> !Sync for DepGraph<K>
impl<K> Unpin for DepGraph<K>
impl<K> !UnwindSafe for DepGraph<K>
Blanket Implementations
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]
impl<T> BorrowMut<T> for T where
T: ?Sized, [src]pub fn borrow_mut(&mut self) -> &mut T[src]
pub fn borrow_mut(&mut self) -> &mut T[src]Mutably borrows from an owned value. Read more
impl<T> ToOwned for T where
T: Clone, [src]
impl<T> ToOwned for T where
T: Clone, [src]type Owned = T
type Owned = TThe resulting type after obtaining ownership.
pub fn to_owned(&self) -> T[src]
pub fn to_owned(&self) -> T[src]Creates owned data from borrowed data, usually by cloning. Read more
pub fn clone_into(&self, target: &mut T)[src]
pub fn clone_into(&self, target: &mut T)[src]🔬 This is a nightly-only experimental API. (toowned_clone_into)
recently added
Uses borrowed data to replace owned data, usually by cloning. Read more