pub struct ModulePassManager<'a> { /* private fields */ }Expand description
A configured LLVM module pass manager using the new PassManager infrastructure.
Bundles all analysis managers, PassBuilder, StandardInstrumentations, and the ModulePassManager into a single object with correct lifetime management.
The lifetime 'a is tied to the borrowed inkwell::targets::TargetMachine,
ensuring the target machine outlives the pass manager.
Implementations§
Source§impl<'a> ModulePassManager<'a>
impl<'a> ModulePassManager<'a>
Sourcepub fn with_opt_level(
target_machine: Option<&'a TargetMachine>,
level: OptLevel,
options: Option<&Options>,
) -> Result<Self, Error>
pub fn with_opt_level( target_machine: Option<&'a TargetMachine>, level: OptLevel, options: Option<&Options>, ) -> Result<Self, Error>
Create a pass manager with a standard optimization pipeline.
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 pass manager from a textual pipeline description.
The format matches opt -passes=... syntax, e.g.:
"instcombine,dce,sroa""default<O2>""module(function(instcombine,sroa))"
Sourcepub fn with_lto(
target_machine: Option<&'a TargetMachine>,
level: OptLevel,
options: Option<&Options>,
) -> Result<Self, Error>
pub fn with_lto( target_machine: Option<&'a TargetMachine>, level: OptLevel, options: Option<&Options>, ) -> Result<Self, Error>
Create a pass manager with the full-LTO default pipeline.
Sourcepub fn with_lto_pre_link(
target_machine: Option<&'a TargetMachine>,
level: OptLevel,
options: Option<&Options>,
) -> Result<Self, Error>
pub fn with_lto_pre_link( target_machine: Option<&'a TargetMachine>, level: OptLevel, options: Option<&Options>, ) -> Result<Self, Error>
Create a pass manager with the full-LTO pre-link pipeline.
Sourcepub fn with_thin_lto_pre_link(
target_machine: Option<&'a TargetMachine>,
level: OptLevel,
options: Option<&Options>,
) -> Result<Self, Error>
pub fn with_thin_lto_pre_link( target_machine: Option<&'a TargetMachine>, level: OptLevel, options: Option<&Options>, ) -> Result<Self, Error>
Create a pass manager with the ThinLTO pre-link pipeline.
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 module 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: LlvmModulePass + 'static,
pub fn add_pass<P>(&mut self, pass: P)where
P: LlvmModulePass + 'static,
Add a custom module 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_cgscc_pass<P>(&mut self, pass: P)where
P: LlvmCgsccPass + 'static,
pub fn add_cgscc_pass<P>(&mut self, pass: P)where
P: LlvmCgsccPass + 'static,
Add a custom CGSCC pass to this pass manager.
The pass is adapted into the module pipeline and invoked for each function in each SCC.
Trait Implementations§
Source§impl<'a> Debug for ModulePassManager<'a>
impl<'a> Debug for ModulePassManager<'a>
Source§impl<'a> Drop for ModulePassManager<'a>
impl<'a> Drop for ModulePassManager<'a>
impl<'a> Send for ModulePassManager<'a>
Auto Trait Implementations§
impl<'a> Freeze for ModulePassManager<'a>
impl<'a> !RefUnwindSafe for ModulePassManager<'a>
impl<'a> !Sync for ModulePassManager<'a>
impl<'a> Unpin for ModulePassManager<'a>
impl<'a> UnsafeUnpin for ModulePassManager<'a>
impl<'a> !UnwindSafe for ModulePassManager<'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