pub struct CGSCCPassManager<'a> { /* private fields */ }Expand description
A configured LLVM CGSCC pass manager using the new PassManager infrastructure.
Provides a type-level distinction for CGSCC-oriented pipelines. Internally
backed by a module-level pass manager where each pass is adapted through the
Module → CGSCC adaptor.
Supports adding CGSCC passes directly, as well as function and loop passes
which are adapted through the CGSCC level (CGSCC → Function and
CGSCC → Function → Loop respectively).
The lifetime 'a is tied to the borrowed inkwell::targets::TargetMachine,
ensuring the target machine outlives the pass manager.
Implementations§
Source§impl<'a> CGSCCPassManager<'a>
impl<'a> CGSCCPassManager<'a>
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 CGSCC pass manager.
Use add_pass(),
add_function_pass(), or
add_loop_pass() to add passes.
Sourcepub fn add_pass<P>(&mut self, pass: P)where
P: LlvmCgsccPass + 'static,
pub fn add_pass<P>(&mut self, pass: P)where
P: LlvmCgsccPass + 'static,
Add a custom CGSCC pass.
The pass is adapted into the module pipeline via
createModuleToPostOrderCGSCCPassAdaptor and invoked for each function
in each SCC.
Sourcepub fn add_function_pass<P>(&mut self, pass: P)where
P: LlvmFunctionPass + 'static,
pub fn add_function_pass<P>(&mut self, pass: P)where
P: LlvmFunctionPass + 'static,
Add a custom function pass adapted through the CGSCC level.
The pass is wrapped with Module → CGSCC → Function adaptors, so it
runs on each function within the CGSCC traversal order.
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 adapted through the CGSCC and function levels.
The pass is wrapped with Module → CGSCC → Function → Loop adaptors.
Trait Implementations§
Source§impl<'a> Debug for CGSCCPassManager<'a>
impl<'a> Debug for CGSCCPassManager<'a>
Source§impl<'a> Drop for CGSCCPassManager<'a>
impl<'a> Drop for CGSCCPassManager<'a>
impl<'a> Send for CGSCCPassManager<'a>
Auto Trait Implementations§
impl<'a> Freeze for CGSCCPassManager<'a>
impl<'a> !RefUnwindSafe for CGSCCPassManager<'a>
impl<'a> !Sync for CGSCCPassManager<'a>
impl<'a> Unpin for CGSCCPassManager<'a>
impl<'a> UnsafeUnpin for CGSCCPassManager<'a>
impl<'a> !UnwindSafe for CGSCCPassManager<'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