Struct rustc::dep_graph::WorkProduct
[−]
[src]
pub struct WorkProduct { pub input_hash: u64, pub saved_files: Vec<(OutputType, String)>, }
rustc_private
)A "work product" is an intermediate result that we save into the incremental directory for later re-use. The primary example are the object files that we save for each partition at code generation time.
Each work product is associated with a dep-node, representing the
process that produced the work-product. If that dep-node is found
to be dirty when we load up, then we will delete the work-product
at load time. If the work-product is found to be clean, then we
will keep a record in the previous_work_products
list.
In addition, work products have an associated hash. This hash is an extra hash that can be used to decide if the work-product from a previous compilation can be re-used (in addition to the dirty edges check).
As the primary example, consider the object files we generate for
each partition. In the first run, we create partitions based on
the symbols that need to be compiled. For each partition P, we
hash the symbols in P and create a WorkProduct
record associated
with DepNode::TransPartition(P)
; the hash is the set of symbols
in P.
The next time we compile, if the DepNode::TransPartition(P)
is
judged to be clean (which means none of the things we read to
generate the partition were found to be dirty), it will be loaded
into previous work products. We will then regenerate the set of
symbols in the partition P and hash them (note that new symbols
may be added -- for example, new monomorphizations -- even if
nothing in P changed!). We will compare that hash against the
previous hash. If it matches up, we can reuse the object file.
Fields
input_hash: u64
rustc_private
)Extra hash used to decide if work-product is still suitable;
note that this is not a hash of the work-product itself.
See documentation on WorkProduct
type for an example.
saved_files: Vec<(OutputType, String)>
rustc_private
)Saved files associated with this CGU
Trait Implementations
impl Clone for WorkProduct
[src]
fn clone(&self) -> WorkProduct
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
impl Debug for WorkProduct
[src]
impl Encodable for WorkProduct
[src]
fn encode<__S: Encoder>(&self, __arg_0: &mut __S) -> Result<(), __S::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io
impl Decodable for WorkProduct
[src]
fn decode<__D: Decoder>(__arg_0: &mut __D) -> Result<WorkProduct, __D::Error>
🔬 This is a nightly-only experimental API. (rustc_private
)
deprecated in favor of rustc-serialize on crates.io