pub struct FunctionAnalysisManagerProxy { /* private fields */ }
Expand description
Struct allowing to make queries to the pass manager about function-level analyses.
The main use-case of such interface is to give the ability for module-level passes to trigger/query function-level analyses.
§Example
struct Pass;
impl LlvmModulePass for Pass {
fn run_pass(
&self,
module: &mut Module,
manager: &ModuleAnalysisManager,
) -> PreservedAnalyses {
let manager = manager
.get_function_analysis_manager_proxy(&module)
.get_manager();
let function = module.get_first_function().unwrap();
let result = manager.get_result::<Analysis>(&function);
assert_eq!(result, "Some result");
PreservedAnalyses::All
}
}
struct Analysis;
impl LlvmFunctionAnalysis for Analysis {
type Result = String;
fn run_analysis(
&self,
_function: &FunctionValue,
_manager: &FunctionAnalysisManager,
) -> Self::Result {
"Some result".to_owned()
}
fn id() -> AnalysisKey {
1 as AnalysisKey
}
}
Implementations§
Source§impl FunctionAnalysisManagerProxy
impl FunctionAnalysisManagerProxy
Sourcepub fn get_manager(&self) -> FunctionAnalysisManager
pub fn get_manager(&self) -> FunctionAnalysisManager
Returns the inner FunctionAnalysisManager.
Auto Trait Implementations§
impl Freeze for FunctionAnalysisManagerProxy
impl RefUnwindSafe for FunctionAnalysisManagerProxy
impl !Send for FunctionAnalysisManagerProxy
impl !Sync for FunctionAnalysisManagerProxy
impl Unpin for FunctionAnalysisManagerProxy
impl UnwindSafe for FunctionAnalysisManagerProxy
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
Mutably borrows from an owned value. Read more
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>
Converts
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>
Converts
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