LLVM API Documentation
An analysis manager to coordinate and cache analyses run over a module. More...
#include <PassManager.h>
Public Member Functions | |
AnalysisManager (Module *M) | |
template<typename PassT > | |
const PassT::Result & | getResult (Module *M) |
Get the result of an analysis pass for this module. More... | |
template<typename PassT > | |
const PassT::Result & | getResult (Function *F) |
Get the result of an analysis pass for a function. More... | |
template<typename PassT > | |
void | registerAnalysisPass (PassT Pass) |
Register an analysis pass with the manager. More... | |
template<typename PassT > | |
void | invalidate (Module *M) |
Invalidate a specific analysis pass for an IR module. More... | |
template<typename PassT > | |
void | invalidate (Function *F) |
Invalidate a specific analysis pass for an IR function. More... | |
void | invalidateAll (Module *M) |
Invalidate analyses cached for an IR Module. More... | |
void | invalidateAll (Function *F) |
Invalidate analyses cached for an IR Function. More... | |
An analysis manager to coordinate and cache analyses run over a module.
The analysis manager is typically used by passes in a pass pipeline (consisting potentially of several individual pass managers) over a module of IR. It provides registration of available analyses, declaring requirements on support for specific analyses, running of an specific analysis over a specific unit of IR to compute an analysis result, and caching of the analysis results to reuse them across multiple passes.
It is the responsibility of callers to use the invalidation API to invalidate analysis results when the IR they correspond to changes. The ModulePassManager
and FunctionPassManager
do this automatically.
Definition at line 141 of file IR/PassManager.h.
|
inline |
Definition at line 143 of file IR/PassManager.h.
|
inline |
Get the result of an analysis pass for this module.
If there is not a valid cached result in the manager already, this will re-run the analysis to produce a valid result.
The module passed in must be the same module as the analysis manager was constructed around.
Definition at line 153 of file IR/PassManager.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count().
|
inline |
Get the result of an analysis pass for a function.
If there is not a valid cached result in the manager already, this will re-run the analysis to produce a valid result.
Definition at line 168 of file IR/PassManager.h.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::count().
|
inline |
Invalidate a specific analysis pass for an IR module.
Note that the analysis result can disregard invalidation.
Definition at line 192 of file IR/PassManager.h.
|
inline |
Invalidate a specific analysis pass for an IR function.
Note that the analysis result can disregard invalidation.
Definition at line 199 of file IR/PassManager.h.
void AnalysisManager::invalidateAll | ( | Module * | M | ) |
Invalidate analyses cached for an IR Module.
Note that specific analysis results can disregard invalidation by overriding their invalidate method.
The module must be the module this analysis manager was constructed around.
Definition at line 62 of file PassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::SmallVectorBase::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), F(), I, llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
Referenced by llvm::ModulePassManager::run(), and llvm::FunctionPassManager::run().
void AnalysisManager::invalidateAll | ( | Function * | F | ) |
Invalidate analyses cached for an IR Function.
Note that specific analysis results can disregard invalidation by overriding the invalidate method.
Definition at line 32 of file PassManager.cpp.
References llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::begin(), llvm::SmallVectorBase::empty(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::end(), llvm::DenseMapBase< DerivedT, KeyT, ValueT, KeyInfoT >::erase(), F(), llvm::GlobalValue::getParent(), I, llvm::SmallVectorImpl< T >::pop_back_val(), and llvm::SmallVectorTemplateBase< T, isPodLike< T >::value >::push_back().
|
inline |
Register an analysis pass with the manager.
This provides an initialized and set-up analysis pass to the analysis manager. Whomever is setting up analysis passes must use this to populate the manager with all of the analysis passes available.
Definition at line 185 of file IR/PassManager.h.
References llvm_move.