pub struct WorkProduct {
pub cgu_name: String,
pub saved_files: UnordMap<String, String>,
}
Expand description
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::CodegenUnit(P)
; the hash is the set of symbols
in P.
The next time we compile, if the DepNode::CodegenUnit(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§
§cgu_name: String
§saved_files: UnordMap<String, String>
Saved files associated with this CGU. In each key/value pair, the value is the path to the saved file and the key is some identifier for the type of file being saved.
By convention, file extensions are currently used as identifiers, i.e. the key “o” maps to the object file’s path, and “dwo” to the dwarf object file’s path.
Trait Implementations§
Source§impl Clone for WorkProduct
impl Clone for WorkProduct
Source§fn clone(&self) -> WorkProduct
fn clone(&self) -> WorkProduct
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for WorkProduct
impl Debug for WorkProduct
Source§impl<__D> Decodable<__D> for WorkProductwhere
__D: SpanDecoder,
impl<__D> Decodable<__D> for WorkProductwhere
__D: SpanDecoder,
fn decode(__decoder: &mut __D) -> WorkProduct
Source§impl<__E> Encodable<__E> for WorkProductwhere
__E: SpanEncoder,
impl<__E> Encodable<__E> for WorkProductwhere
__E: SpanEncoder,
Auto Trait Implementations§
impl DynSend for WorkProduct
impl DynSync for WorkProduct
impl Freeze for WorkProduct
impl RefUnwindSafe for WorkProduct
impl Send for WorkProduct
impl Sync for WorkProduct
impl Unpin for WorkProduct
impl UnwindSafe for WorkProduct
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)Source§impl<T, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Filterable for T
impl<T> Filterable for T
Source§fn filterable(
self,
filter_name: &'static str,
) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
fn filterable( self, filter_name: &'static str, ) -> RequestFilterDataProvider<T, fn(_: DataRequest<'_>) -> bool>
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<P> IntoQueryParam<P> for P
impl<P> IntoQueryParam<P> for P
fn into_query_param(self) -> P
Source§impl<T> MaybeResult<T> for T
impl<T> MaybeResult<T> for T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
impl<I, T, U> Upcast<I, U> for Twhere
U: UpcastFrom<I, T>,
Source§impl<I, T> UpcastFrom<I, T> for T
impl<I, T> UpcastFrom<I, T> for T
fn upcast_from(from: T, _tcx: I) -> T
Source§impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
impl<Tcx, T> Value<Tcx> for Twhere
Tcx: DepContext,
default fn from_cycle_error( tcx: Tcx, cycle_error: &CycleError, _guar: ErrorGuaranteed, ) -> T
Source§impl<T> WithSubscriber for T
impl<T> WithSubscriber for T
Source§fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
Source§fn with_current_subscriber(self) -> WithDispatch<Self>
fn with_current_subscriber(self) -> WithDispatch<Self>
impl<'a, T> Captures<'a> for Twhere
T: ?Sized,
impl<T> ErasedDestructor for Twhere
T: 'static,
impl<T> MaybeSendSync for T
Layout§
Note: Most layout information is completely unstable and may even differ between compilations. The only exception is types with certain repr(...)
attributes. Please see the Rust Reference's “Type Layout” chapter for details on type layout guarantees.
Size: 56 bytes