pub struct FunctionTargetPipeline { /* private fields */ }
Expand description

A processing pipeline for function targets.

Implementations§

source§

impl FunctionTargetPipeline

source

pub fn add_processor(&mut self, processor: Box<dyn FunctionTargetProcessor>)

Adds a processor to this pipeline. Processor will be called in the order they have been added.

source

pub fn last_processor(&self) -> &dyn FunctionTargetProcessor

Gets the last processor in the pipeline, for testing.

source

pub fn sort_targets_in_topological_order<'env>( env: &'env GlobalEnv, targets: &FunctionTargetsHolder ) -> Vec<FunctionEnv<'env>>

Sort functions in topological order. This is important for the function target processors. In programs without recursion or mutual recursion, processing functions in topological order means that when a processor sees a caller function, it is guaranteed that all the callees have already been analyzed.

source

pub fn run_with_hook<H1, H2>( &self, env: &GlobalEnv, targets: &mut FunctionTargetsHolder, hook_before_pipeline: H1, hook_after_each_processor: H2 )where H1: Fn(&FunctionTargetsHolder), H2: Fn(usize, &dyn FunctionTargetProcessor, &FunctionTargetsHolder),

Runs the pipeline on all functions in the targets holder. Processors are run on each individual function in breadth-first fashion; i.e. a processor can expect that processors preceding it in the pipeline have been executed for all functions before it is called.

source

pub fn run(&self, env: &GlobalEnv, targets: &mut FunctionTargetsHolder)

Run the pipeline on all functions in the targets holder, with no hooks in effect

source

pub fn run_with_dump( &self, env: &GlobalEnv, targets: &mut FunctionTargetsHolder, dump_base_name: &str, dump_cfg: bool )

Runs the pipeline on all functions in the targets holder, dump the bytecode before the pipeline as well as after each processor pass. If dump_cfg is set, dump the per-function control-flow graph (in dot format) too.

Trait Implementations§

source§

impl Default for FunctionTargetPipeline

source§

fn default() -> FunctionTargetPipeline

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V