pub struct PassBuilder { /* private fields */ }Expand description
Handle to LLVM’s PassBuilder, received by plugin registrar functions.
Provides methods to register callbacks for pipeline parsing, analysis registration, and various extension points.
Implementations§
Source§impl PassBuilder
impl PassBuilder
Sourcepub unsafe fn from_raw(pass_builder: *mut c_void) -> Self
pub unsafe fn from_raw(pass_builder: *mut c_void) -> Self
Construct from a raw PassBuilder pointer.
§Safety
pass_builder must be a valid pointer to LLVM’s PassBuilder.
Sourcepub fn add_module_pipeline_parsing_callback<T>(&mut self, cb: T)
pub fn add_module_pipeline_parsing_callback<T>(&mut self, cb: T)
Register a callback for parsing module pipeline elements.
When LLVM encounters an unknown pass name in a module pipeline, it
calls registered callbacks. If the callback recognizes the name, it
should add the pass to the given PluginModulePassManager and return
PipelineParsing::Parsed.
Sourcepub fn add_function_pipeline_parsing_callback<T>(&mut self, cb: T)
pub fn add_function_pipeline_parsing_callback<T>(&mut self, cb: T)
Register a callback for parsing function pipeline elements.
Sourcepub fn add_module_analysis_registration_callback<T>(&mut self, cb: T)where
T: Fn(&mut ModuleAnalysisManager) + 'static,
pub fn add_module_analysis_registration_callback<T>(&mut self, cb: T)where
T: Fn(&mut ModuleAnalysisManager) + 'static,
Register a callback for module analysis registration.
Sourcepub fn add_function_analysis_registration_callback<T>(&mut self, cb: T)where
T: Fn(&mut FunctionAnalysisManager) + 'static,
pub fn add_function_analysis_registration_callback<T>(&mut self, cb: T)where
T: Fn(&mut FunctionAnalysisManager) + 'static,
Register a callback for function analysis registration.
Sourcepub fn add_peephole_ep_callback<T>(&mut self, cb: T)
pub fn add_peephole_ep_callback<T>(&mut self, cb: T)
Register a peephole extension point callback (function-level).
Sourcepub fn add_scalar_optimizer_late_ep_callback<T>(&mut self, cb: T)
pub fn add_scalar_optimizer_late_ep_callback<T>(&mut self, cb: T)
Register a scalar-optimizer-late extension point callback (function-level).
Sourcepub fn add_vectorizer_start_ep_callback<T>(&mut self, cb: T)
pub fn add_vectorizer_start_ep_callback<T>(&mut self, cb: T)
Register a vectorizer-start extension point callback (function-level).
Sourcepub fn add_optimizer_last_ep_callback<T>(&mut self, cb: T)
pub fn add_optimizer_last_ep_callback<T>(&mut self, cb: T)
Register an optimizer-last extension point callback (module-level).
Available on LLVM 11+. On older versions, this is a no-op.
Sourcepub fn add_pipeline_start_ep_callback<T>(&mut self, cb: T)
pub fn add_pipeline_start_ep_callback<T>(&mut self, cb: T)
Register a pipeline-start extension point callback (module-level).
Available on LLVM 12+. On older versions, this is a no-op.
Sourcepub fn add_pipeline_early_simplification_ep_callback<T>(&mut self, cb: T)
pub fn add_pipeline_early_simplification_ep_callback<T>(&mut self, cb: T)
Register a pipeline-early-simplification extension point callback (module-level).
Available on LLVM 12+. On older versions, this is a no-op.
Sourcepub fn add_optimizer_early_ep_callback<T>(&mut self, cb: T)
pub fn add_optimizer_early_ep_callback<T>(&mut self, cb: T)
Register an optimizer-early extension point callback (module-level).
Available on LLVM 15+. On older versions, this is a no-op.
Auto Trait Implementations§
impl Freeze for PassBuilder
impl RefUnwindSafe for PassBuilder
impl !Send for PassBuilder
impl !Sync for PassBuilder
impl Unpin for PassBuilder
impl UnsafeUnpin for PassBuilder
impl UnwindSafe for PassBuilder
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