pub struct PassContext {
pass_ids: PrimaryMap<PassId, &'static str>,
pass_timings: Vec<PassTiming>,
provenance: ProvenanceTables,
}Expand description
Shared context passed through compiler passes.
Fields§
§pass_ids: PrimaryMap<PassId, &'static str>§pass_timings: Vec<PassTiming>§provenance: ProvenanceTablesImplementations§
Source§impl PassContext
impl PassContext
Sourcepub fn run_timed<T, E, F>(
&mut self,
pass_name: &'static str,
run: F,
) -> Result<T, E>
pub fn run_timed<T, E, F>( &mut self, pass_name: &'static str, run: F, ) -> Result<T, E>
Run one pass, measure its wall-clock duration, and store timing stats.
Sourcepub fn run_pass<P>(
&mut self,
pass: &mut P,
input: P::In,
) -> Result<P::Out, P::Error>where
P: Pass,
pub fn run_pass<P>(
&mut self,
pass: &mut P,
input: P::In,
) -> Result<P::Out, P::Error>where
P: Pass,
Run one typed pass, measure duration, and store timing stats.
Sourcepub fn run_pass_with_id<P>(
&mut self,
pass: &mut P,
input: P::In,
) -> Result<(PassId, P::Out), P::Error>where
P: Pass,
pub fn run_pass_with_id<P>(
&mut self,
pass: &mut P,
input: P::In,
) -> Result<(PassId, P::Out), P::Error>where
P: Pass,
Run one typed pass and return its pass id with output.
Sourcepub fn run_timed_value<T, F>(&mut self, pass_name: &'static str, run: F) -> T
pub fn run_timed_value<T, F>(&mut self, pass_name: &'static str, run: F) -> T
Run one infallible pass, measure duration, and store timing stats.
Sourcepub fn pass_timings(&self) -> &[PassTiming]
pub fn pass_timings(&self) -> &[PassTiming]
Return recorded pass timings in execution order.
Sourcepub fn extend_pass_timings<I>(&mut self, timings: I)where
I: IntoIterator<Item = PassTiming>,
pub fn extend_pass_timings<I>(&mut self, timings: I)where
I: IntoIterator<Item = PassTiming>,
Append externally collected pass timing samples.
Sourcepub fn provenance(&self) -> &ProvenanceTables
pub fn provenance(&self) -> &ProvenanceTables
Return shared provenance tables.
Sourcepub fn provenance_mut(&mut self) -> &mut ProvenanceTables
pub fn provenance_mut(&mut self) -> &mut ProvenanceTables
Return mutable shared provenance tables.
Trait Implementations§
Source§impl Debug for PassContext
impl Debug for PassContext
Source§impl Default for PassContext
impl Default for PassContext
Source§fn default() -> PassContext
fn default() -> PassContext
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for PassContext
impl RefUnwindSafe for PassContext
impl Send for PassContext
impl Sync for PassContext
impl Unpin for PassContext
impl UnwindSafe for PassContext
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
Mutably borrows from an owned value. Read more