pub struct AnalysisManager { /* private fields */ }Expand description
Manages cached analysis results for a function.
Analyses are keyed by their result type via AnalysisKey.
Implementations§
Source§impl AnalysisManager
impl AnalysisManager
Sourcepub fn get<T: 'static>(&self) -> Option<&T>
pub fn get<T: 'static>(&self) -> Option<&T>
Returns the cached result for the given analysis type, if available.
Sourcepub fn get_or_compute<A: AnalysisPass>(
&mut self,
analysis: &A,
func: &Function,
) -> &A::Result
pub fn get_or_compute<A: AnalysisPass>( &mut self, analysis: &A, func: &Function, ) -> &A::Result
Returns the result of the analysis, computing and caching it if not already present.
This is the recommended way to obtain analysis results, matching
LLVM’s AnalysisManager::getResult<AnalysisT>(F) pattern.
Sourcepub fn invalidate_all(&mut self)
pub fn invalidate_all(&mut self)
Invalidates all cached analysis results.
Sourcepub fn invalidate<T: 'static>(&mut self)
pub fn invalidate<T: 'static>(&mut self)
Invalidates a specific analysis result.
Trait Implementations§
Source§impl Default for AnalysisManager
impl Default for AnalysisManager
Source§fn default() -> AnalysisManager
fn default() -> AnalysisManager
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl !RefUnwindSafe for AnalysisManager
impl !Send for AnalysisManager
impl !Sync for AnalysisManager
impl !UnwindSafe for AnalysisManager
impl Freeze for AnalysisManager
impl Unpin for AnalysisManager
impl UnsafeUnpin for AnalysisManager
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, R> CollectAndApply<T, R> for T
impl<T, R> CollectAndApply<T, R> for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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