LLVM  3.7.0
Public Member Functions | Protected Types | Protected Member Functions | List of all members
llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT > Class Template Reference

A CRTP base used to implement analysis managers. More...

#include <PassManager.h>

Inheritance diagram for llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >:
[legend]

Public Member Functions

template<typename PassT >
PassT::Result & getResult (IRUnitT &IR)
 Get the result of an analysis pass for this module. More...
 
template<typename PassT >
PassT::Result * getCachedResult (IRUnitT &IR) const
 Get the cached result of an analysis pass for this module. More...
 
template<typename PassT >
void registerPass (PassT Pass)
 Register an analysis pass with the manager. More...
 
template<typename PassT >
void invalidate (IRUnitT &IR)
 Invalidate a specific analysis pass for an IR module. More...
 
PreservedAnalyses invalidate (IRUnitT &IR, PreservedAnalyses PA)
 Invalidate analyses cached for an IR unit. More...
 

Protected Types

typedef
detail::AnalysisResultConcept
< IRUnitT > 
ResultConceptT
 
typedef
detail::AnalysisPassConcept
< IRUnitT > 
PassConceptT
 

Protected Member Functions

 AnalysisManagerBase ()
 
 AnalysisManagerBase (AnalysisManagerBase &&Arg)
 
AnalysisManagerBaseoperator= (AnalysisManagerBase &&RHS)
 
PassConceptTlookupPass (void *PassID)
 Lookup a registered analysis pass. More...
 
const PassConceptTlookupPass (void *PassID) const
 Lookup a registered analysis pass. More...
 

Detailed Description

template<typename DerivedT, typename IRUnitT>
class llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >

A CRTP base used to implement analysis managers.

This class template serves as the boiler plate of an analysis manager. Any analysis manager can be implemented on top of this base class. Any implementation will be required to provide specific hooks:

The details of the call pattern are within.

Note that there is also a generic analysis manager template which implements the above required functions along with common datastructures used for managing analyses. This base class is factored so that if you need to customize the handling of a specific IR unit, you can do so without replicating all of the boilerplate.

Definition at line 279 of file PassManager.h.

Member Typedef Documentation

template<typename DerivedT, typename IRUnitT>
typedef detail::AnalysisPassConcept<IRUnitT> llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::PassConceptT
protected

Definition at line 291 of file PassManager.h.

template<typename DerivedT, typename IRUnitT>
typedef detail::AnalysisResultConcept<IRUnitT> llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::ResultConceptT
protected

Definition at line 290 of file PassManager.h.

Constructor & Destructor Documentation

template<typename DerivedT, typename IRUnitT>
llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::AnalysisManagerBase ( )
inlineprotected

Definition at line 298 of file PassManager.h.

template<typename DerivedT, typename IRUnitT>
llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::AnalysisManagerBase ( AnalysisManagerBase< DerivedT, IRUnitT > &&  Arg)
inlineprotected

Definition at line 299 of file PassManager.h.

Member Function Documentation

template<typename DerivedT, typename IRUnitT>
template<typename PassT >
PassT::Result* llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::getCachedResult ( IRUnitT &  IR) const
inline

Get the cached result of an analysis pass for this module.

This method never runs the analysis.

Returns
null if there is no cached result.

Definition at line 328 of file PassManager.h.

Referenced by llvm::InstCombinePass::run().

template<typename DerivedT, typename IRUnitT>
template<typename PassT >
PassT::Result& llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::getResult ( IRUnitT &  IR)
inline
template<typename DerivedT, typename IRUnitT>
template<typename PassT >
void llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::invalidate ( IRUnitT &  IR)
inline

Invalidate a specific analysis pass for an IR module.

Note that the analysis result can disregard invalidation.

Definition at line 357 of file PassManager.h.

Referenced by llvm::ModuleToPostOrderCGSCCPassAdaptor< CGSCCPassT >::run(), llvm::CGSCCToFunctionPassAdaptor< FunctionPassT >::run(), and llvm::ModuleToFunctionPassAdaptor< FunctionPassT >::run().

template<typename DerivedT, typename IRUnitT>
PreservedAnalyses llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::invalidate ( IRUnitT &  IR,
PreservedAnalyses  PA 
)
inline

Invalidate analyses cached for an IR unit.

Walk through all of the analyses pertaining to this unit of IR and invalidate them unless they are preserved by the PreservedAnalyses set. We accept the PreservedAnalyses set by value and update it with each analyis pass which has been successfully invalidated and thus can be preserved going forward. The updated set is returned.

Definition at line 370 of file PassManager.h.

template<typename DerivedT, typename IRUnitT>
PassConceptT& llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::lookupPass ( void *  PassID)
inlineprotected

Lookup a registered analysis pass.

Definition at line 376 of file PassManager.h.

template<typename DerivedT, typename IRUnitT>
const PassConceptT& llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::lookupPass ( void *  PassID) const
inlineprotected

Lookup a registered analysis pass.

Definition at line 384 of file PassManager.h.

template<typename DerivedT, typename IRUnitT>
AnalysisManagerBase& llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::operator= ( AnalysisManagerBase< DerivedT, IRUnitT > &&  RHS)
inlineprotected

Definition at line 301 of file PassManager.h.

template<typename DerivedT, typename IRUnitT>
template<typename PassT >
void llvm::detail::AnalysisManagerBase< DerivedT, IRUnitT >::registerPass ( 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 347 of file PassManager.h.


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