LLVM  mainline
Public Types | Public Member Functions
llvm::AnalysisUsage Class Reference

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

#include <PassAnalysisSupport.h>

List of all members.

Public Types

typedef SmallVectorImpl
< AnalysisID
VectorType

Public Member Functions

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

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

Definition at line 53 of file PassAnalysisSupport.h.


Member Function Documentation

template<class PassClass >
AnalysisUsage& llvm::AnalysisUsage::addPreserved ( ) [inline]

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

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

Definition at line 73 of file PassAnalysisSupport.h.

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

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

template<class PassClass >
AnalysisUsage& llvm::AnalysisUsage::addRequired ( ) [inline]

Definition at line 60 of file PassAnalysisSupport.h.

References addRequiredID().

Referenced by llvm::DivergenceAnalysis::getAnalysisUsage(), llvm::Inliner::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::DemandedBits::getAnalysisUsage(), llvm::MachineFunctionPass::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::SelectionDAGISel::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::CallGraphSCCPass::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::ScopedNoAliasAAWrapperPass::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::TypeBasedAAWrapperPass::getAnalysisUsage(), llvm::LazyValueInfo::getAnalysisUsage(), llvm::objcarc::ObjCARCAAWrapperPass::getAnalysisUsage(), llvm::RGPassManager::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::LPPassManager::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::CFLAAWrapperPass::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::DominanceFrontier::getAnalysisUsage(), llvm::BasicAAWrapperPass::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), llvm::NVPTXAsmPrinter::getAnalysisUsage(), llvm::MemoryDependenceAnalysis::getAnalysisUsage(), llvm::LoopAccessAnalysis::getAnalysisUsage(), llvm::LoopInfoWrapperPass::getAnalysisUsage(), llvm::RegionInfoPass::getAnalysisUsage(), llvm::AAResultsWrapperPass::getAnalysisUsage(), and llvm::sroa::SROALegacyPass::getAnalysisUsage().

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

template<class PassClass >
AnalysisUsage& llvm::AnalysisUsage::addRequiredTransitive ( ) [inline]
template<class PassClass >
AnalysisUsage& llvm::AnalysisUsage::addUsedIfAvailable ( ) [inline]

Add the specified Pass class to the set of analyses used by this pass.

Definition at line 102 of file PassAnalysisSupport.h.

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

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

Add the specified ID to the set of analyses used by this pass if they are available..

Definition at line 92 of file PassAnalysisSupport.h.

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

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

Definition at line 118 of file PassAnalysisSupport.h.

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

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

Definition at line 115 of file PassAnalysisSupport.h.

Referenced by llvm::DivergenceAnalysis::getAnalysisUsage(), llvm::PostDominatorTree::getAnalysisUsage(), llvm::MachineBlockFrequencyInfo::getAnalysisUsage(), llvm::DemandedBits::getAnalysisUsage(), llvm::MachineBranchProbabilityInfo::getAnalysisUsage(), llvm::DOTGraphTraitsViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::SCEVAAWrapperPass::getAnalysisUsage(), llvm::VirtRegMap::getAnalysisUsage(), llvm::MachineTraceMetrics::getAnalysisUsage(), llvm::BlockFrequencyInfoWrapperPass::getAnalysisUsage(), llvm::ScopedNoAliasAAWrapperPass::getAnalysisUsage(), llvm::MachinePostDominatorTree::getAnalysisUsage(), llvm::LazyValueInfo::getAnalysisUsage(), llvm::TypeBasedAAWrapperPass::getAnalysisUsage(), llvm::IntervalPartition::getAnalysisUsage(), llvm::objcarc::ObjCARCAAWrapperPass::getAnalysisUsage(), llvm::RGPassManager::getAnalysisUsage(), llvm::MachineDominanceFrontier::getAnalysisUsage(), llvm::LPPassManager::getAnalysisUsage(), llvm::MachineRegionInfoPass::getAnalysisUsage(), llvm::DOTGraphTraitsPrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::MachineLoopInfo::getAnalysisUsage(), llvm::DOTGraphTraitsModuleViewer< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::CFLAAWrapperPass::getAnalysisUsage(), llvm::GlobalsAAWrapperPass::getAnalysisUsage(), llvm::BranchProbabilityInfoWrapperPass::getAnalysisUsage(), llvm::DOTGraphTraitsModulePrinter< AnalysisT, IsSimple, GraphT, AnalysisGraphTraitsT >::getAnalysisUsage(), llvm::AsmPrinter::getAnalysisUsage(), llvm::DominanceFrontier::getAnalysisUsage(), llvm::BasicAAWrapperPass::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::AAResultsWrapperPass::getAnalysisUsage(), llvm::ScalarEvolutionWrapperPass::getAnalysisUsage(), and INITIALIZE_PASS().

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::DemandedBits::getAnalysisUsage(), llvm::LiveIntervals::getAnalysisUsage(), and llvm::sroa::SROALegacyPass::getAnalysisUsage().


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