LLVM API Documentation

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Classes | Public Member Functions | List of all members
llvm::AnalysisManager Class Reference

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...
 

Detailed Description

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.

Constructor & Destructor Documentation

llvm::AnalysisManager::AnalysisManager ( Module M)
inline

Definition at line 143 of file IR/PassManager.h.

Member Function Documentation

template<typename PassT >
const PassT::Result& llvm::AnalysisManager::getResult ( Module M)
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().

template<typename PassT >
const PassT::Result& llvm::AnalysisManager::getResult ( Function F)
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().

template<typename PassT >
void llvm::AnalysisManager::invalidate ( Module M)
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.

template<typename PassT >
void llvm::AnalysisManager::invalidate ( Function F)
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)
template<typename PassT >
void llvm::AnalysisManager::registerAnalysisPass ( PassT  Pass)
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.


The documentation for this class was generated from the following files: