LLVM  3.7.0
Public Types | Public Member Functions | List of all members
llvm::AnalysisUsage Class Reference

Represent the analysis usage information of a pass. More...

#include <PassAnalysisSupport.h>

Public Types

typedef SmallVector
< AnalysisID, 32 > 
VectorType
 

Public Member Functions

 AnalysisUsage ()
 
template<class PassClass >
AnalysisUsageaddPreserved ()
 Add the specified Pass class to the set of analyses preserved by this pass. More...
 
AnalysisUsageaddPreserved (StringRef Arg)
 Add the Pass with the specified argument string to the set of analyses preserved by this pass. More...
 
void setPreservesAll ()
 Set by analyses that do not transform their input at all. More...
 
bool getPreservesAll () const
 Determine whether a pass said it does not transform its input at all. More...
 
void setPreservesCFG ()
 This function should be called by the pass, iff they do not: More...
 
const VectorTypegetRequiredSet () const
 
const VectorTypegetRequiredTransitiveSet () const
 
const VectorTypegetPreservedSet () const
 
AnalysisUsageaddRequiredID (const void *ID)
 
AnalysisUsageaddRequiredID (char &ID)
 
template<class PassClass >
AnalysisUsageaddRequired ()
 
AnalysisUsageaddRequiredTransitiveID (char &ID)
 
template<class PassClass >
AnalysisUsageaddRequiredTransitive ()
 
AnalysisUsageaddPreservedID (const void *ID)
 
AnalysisUsageaddPreservedID (char &ID)
 

Detailed Description

Represent the analysis usage information of a pass.

This tracks analyses that the pass REQUIRES (must be available when the pass runs), REQUIRES TRANSITIVE (must be available throughout the lifetime of the pass), and analyses that the pass PRESERVES (the pass does not invalidate the results of these analyses). This information is provided by a pass to the Pass infrastructure through the getAnalysisUsage virtual function.

Definition at line 37 of file PassAnalysisSupport.h.

Member Typedef Documentation

Definition at line 39 of file PassAnalysisSupport.h.

Constructor & Destructor Documentation

llvm::AnalysisUsage::AnalysisUsage ( )
inline

Definition at line 47 of file PassAnalysisSupport.h.

Member Function Documentation

template<class PassClass >
AnalysisUsage& llvm::AnalysisUsage::addPreserved ( )
inline
AnalysisUsage & AnalysisUsage::addPreserved ( StringRef  Arg)

Add the Pass with the specified argument string to the set of analyses preserved by this pass.

If no such Pass exists, do nothing. This can be useful when a pass is trivially preserved, but may not be linked in. Be careful about spelling!

Definition at line 269 of file Pass.cpp.

References llvm::PassInfo::getTypeInfo(), llvm::Pass::lookupPassInfo(), and llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

AnalysisUsage& llvm::AnalysisUsage::addPreservedID ( const void *  ID)
inline

Add the specified ID to the set of analyses preserved by this pass.

Definition at line 67 of file PassAnalysisSupport.h.

References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by llvm::UnifyFunctionExitNodes::getAnalysisUsage(), and llvm::LiveIntervals::getAnalysisUsage().

AnalysisUsage& llvm::AnalysisUsage::addPreservedID ( char &  ID)
inline
template<class PassClass >
AnalysisUsage& llvm::AnalysisUsage::addRequired ( )
inline

Definition at line 54 of file PassAnalysisSupport.h.

References addRequiredID().

Referenced by llvm::BlockFrequencyInfo::getAnalysisUsage(), llvm::Inliner::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::BranchProbabilityInfo::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::SelectionDAGISel::getAnalysisUsage(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::LazyValueInfo::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::RGPassManager::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::AliasAnalysis::getAnalysisUsage(), llvm::LPPassManager::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::InlineCostAnalysis::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::DominanceFrontier::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::NVPTXAsmPrinter::getAnalysisUsage(), llvm::MemoryDependenceAnalysis::getAnalysisUsage(), llvm::LoopAccessAnalysis::getAnalysisUsage(), llvm::LoopInfoWrapperPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), and llvm::ScalarEvolution::getAnalysisUsage().

AnalysisUsage & AnalysisUsage::addRequiredID ( const void *  ID)

Add the specified ID to the required set of the usage info for a pass.

Definition at line 276 of file Pass.cpp.

References llvm::SmallVectorTemplateBase< T, isPodLike >::push_back().

Referenced by addRequired().

AnalysisUsage & AnalysisUsage::addRequiredID ( char &  ID)
template<class PassClass >
AnalysisUsage& llvm::AnalysisUsage::addRequiredTransitive ( )
inline
AnalysisUsage & AnalysisUsage::addRequiredTransitiveID ( char &  ID)
const VectorType& llvm::AnalysisUsage::getPreservedSet ( ) const
inline
bool llvm::AnalysisUsage::getPreservesAll ( ) const
inline

Determine whether a pass said it does not transform its input at all.

Definition at line 94 of file PassAnalysisSupport.h.

Referenced by llvm::PMDataManager::preserveHigherLevelAnalysis(), and llvm::PMDataManager::removeNotPreservedAnalysis().

const VectorType& llvm::AnalysisUsage::getRequiredSet ( ) const
inline
const VectorType& llvm::AnalysisUsage::getRequiredTransitiveSet ( ) const
inline
void llvm::AnalysisUsage::setPreservesAll ( )
inline

Set by analyses that do not transform their input at all.

Definition at line 91 of file PassAnalysisSupport.h.

Referenced by llvm::PostDominatorTree::getAnalysisUsage(), llvm::BlockFrequencyInfo::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::MachineBranchProbabilityInfo::getAnalysisUsage(), llvm::BranchProbabilityInfo::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::LibCallAliasAnalysis::getAnalysisUsage(), llvm::VirtRegMap::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::MachinePostDominatorTree::getAnalysisUsage(), llvm::LazyValueInfo::getAnalysisUsage(), llvm::IntervalPartition::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::RGPassManager::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::LPPassManager::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::InlineCostAnalysis::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::DominanceFrontier::getAnalysisUsage(), llvm::DominatorTreeWrapperPass::getAnalysisUsage(), llvm::legacy::FunctionPassManagerImpl::getAnalysisUsage(), llvm::MemoryDependenceAnalysis::getAnalysisUsage(), llvm::CallGraphWrapperPass::getAnalysisUsage(), llvm::legacy::PassManagerImpl::getAnalysisUsage(), llvm::FPPassManager::getAnalysisUsage(), llvm::LoopAccessAnalysis::getAnalysisUsage(), llvm::LoopInfoWrapperPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), llvm::DependenceAnalysis::getAnalysisUsage(), llvm::ScalarEvolution::getAnalysisUsage(), and INITIALIZE_PASS().

void AnalysisUsage::setPreservesCFG ( )

This function should be called by the pass, iff they do not:

  1. Add or remove basic blocks from the function
  2. Modify terminator instructions in any way.

This function annotates the AnalysisUsage info object to say that analyses that only depend on the CFG are preserved by this pass.

Definition at line 263 of file Pass.cpp.

Referenced by llvm::LiveIntervals::getAnalysisUsage().


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