Expand description
This pass is only used for UNIT TESTS related to incremental
compilation. It tests whether a particular .o file will be re-used
from a previous compilation or whether it must be regenerated.
The user adds annotations to the crate of the following form:
#![rustc_partition_reused(module="spike", cfg="rpass2")]
#![rustc_partition_codegened(module="spike-x", cfg="rpass2")]The first indicates (in the cfg rpass2) that spike.o will be
reused, the second that spike-x.o will be recreated. If these
annotations are inaccurate, errors are reported.
The reason that we use cfg=... and not #[cfg_attr] is so that
the HIR doesnβt change as a result of the annotations, which might
perturb the reuse results.
#![rustc_expected_cgu_reuse(module="spike", cfg="rpass2", kind="post-lto")]
allows for doing a more fine-grained check to see if pre- or post-lto data
was re-used.
Re-exportsΒ§
use std::borrow::Cow;πuse std::fmt;πuse rustc_attr_ir::CguFields;πuse rustc_attr_ir::CguKind;πuse rustc_attr_ir::find_attr;πuse rustc_data_structures::unord::UnordMap;πuse rustc_data_structures::unord::UnordSet;πuse rustc_errors::DiagArgValue;πuse rustc_errors::IntoDiagArg;πuse rustc_hir::def_id::LOCAL_CRATE;πuse rustc_middle::mono::CodegenUnitNameBuilder;πuse rustc_middle::ty::TyCtxt;πuse rustc_session::Session;πuse rustc_span::Span;πuse rustc_span::Symbol;πuse tracing::debug;πuse crate::diagnostics;π
StructsΒ§
- Assert
Module πSource - CguReuse
Tracker - Tracker
Data π