pub struct FunctionPassManager<'a> { /* private fields */ }Expand description
A configured LLVM function pass manager using the new PassManager infrastructure.
Similar to ModulePassManager but runs function-level passes on individual
functions rather than entire modules.
The lifetime 'a is tied to the borrowed inkwell::targets::TargetMachine,
ensuring the target machine outlives the pass manager.
Implementations§
Source§impl<'a> FunctionPassManager<'a>
impl<'a> FunctionPassManager<'a>
Sourcepub fn with_pipeline(
target_machine: Option<&'a TargetMachine>,
pipeline: &str,
options: Option<&Options>,
) -> Result<Self, Error>
pub fn with_pipeline( target_machine: Option<&'a TargetMachine>, pipeline: &str, options: Option<&Options>, ) -> Result<Self, Error>
Create a function pass manager from a textual pipeline description.
The pipeline should contain function-level passes, e.g. "instcombine,dce".
Sourcepub fn new(
target_machine: Option<&'a TargetMachine>,
options: Option<&Options>,
) -> Result<Self, Error>
pub fn new( target_machine: Option<&'a TargetMachine>, options: Option<&Options>, ) -> Result<Self, Error>
Create an empty function pass manager with no built-in passes.
Use add_pass() to add custom passes.
Sourcepub fn add_pass<P>(&mut self, pass: P)where
P: LlvmFunctionPass + 'static,
pub fn add_pass<P>(&mut self, pass: P)where
P: LlvmFunctionPass + 'static,
Add a custom function pass to this pass manager.
The pass is moved into the pass manager and kept alive until the pass manager is dropped. The pass is appended after any existing passes in the pipeline.
Sourcepub fn add_loop_pass<P>(&mut self, pass: P)where
P: LlvmLoopPass + 'static,
pub fn add_loop_pass<P>(&mut self, pass: P)where
P: LlvmLoopPass + 'static,
Add a custom loop pass to this pass manager.
The pass is adapted into the function pipeline and invoked with each loop header basic block.
Trait Implementations§
Source§impl<'a> Debug for FunctionPassManager<'a>
impl<'a> Debug for FunctionPassManager<'a>
Source§impl<'a> Drop for FunctionPassManager<'a>
impl<'a> Drop for FunctionPassManager<'a>
impl<'a> Send for FunctionPassManager<'a>
Auto Trait Implementations§
impl<'a> Freeze for FunctionPassManager<'a>
impl<'a> !RefUnwindSafe for FunctionPassManager<'a>
impl<'a> !Sync for FunctionPassManager<'a>
impl<'a> Unpin for FunctionPassManager<'a>
impl<'a> UnsafeUnpin for FunctionPassManager<'a>
impl<'a> !UnwindSafe for FunctionPassManager<'a>
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> 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 more