LLVM  6.0.0svn
Public Types | Public Member Functions | Protected Types | Protected Attributes | Static Protected Attributes | List of all members
llvm::DominanceFrontierBase< BlockT, IsPostDom > Class Template Reference

DominanceFrontierBase - Common base class for computing forward and inverse dominance frontiers for a function. More...

#include "llvm/Analysis/DominanceFrontier.h"

Inheritance diagram for llvm::DominanceFrontierBase< BlockT, IsPostDom >:
Inheritance graph
[legend]
Collaboration diagram for llvm::DominanceFrontierBase< BlockT, IsPostDom >:
Collaboration graph
[legend]

Public Types

using DomSetType = std::set< BlockT * >
 
using DomSetMapType = std::map< BlockT *, DomSetType >
 
using iterator = typename DomSetMapType::iterator
 
using const_iterator = typename DomSetMapType::const_iterator
 

Public Member Functions

 DominanceFrontierBase ()=default
 
const SmallVectorImpl< BlockT * > & getRoots () const
 getRoots - Return the root blocks of the current CFG. More...
 
BlockT * getRoot () const
 
bool isPostDominator () const
 isPostDominator - Returns true if analysis based of postdoms More...
 
void releaseMemory ()
 
iterator begin ()
 
const_iterator begin () const
 
iterator end ()
 
const_iterator end () const
 
iterator find (BlockT *B)
 
const_iterator find (BlockT *B) const
 
iterator addBasicBlock (BlockT *BB, const DomSetType &frontier)
 
void removeBlock (BlockT *BB)
 removeBlock - Remove basic block BB's frontier. More...
 
void addToFrontier (iterator I, BlockT *Node)
 
void removeFromFrontier (iterator I, BlockT *Node)
 
bool compareDomSet (DomSetType &DS1, const DomSetType &DS2) const
 compareDomSet - Return false if two domsets match. More...
 
bool compare (DominanceFrontierBase &Other) const
 compare - Return true if the other dominance frontier base matches this dominance frontier base. More...
 
void print (raw_ostream &OS) const
 print - Convert to human readable form More...
 
void dump () const
 dump - Dump the dominance frontier to dbgs(). More...
 

Protected Types

using BlockTraits = GraphTraits< BlockT * >
 

Protected Attributes

DomSetMapType Frontiers
 
SmallVector< BlockT *, IsPostDom ? 4 :1 > Roots
 

Static Protected Attributes

static constexpr bool IsPostDominators = IsPostDom
 

Detailed Description

template<class BlockT, bool IsPostDom>
class llvm::DominanceFrontierBase< BlockT, IsPostDom >

DominanceFrontierBase - Common base class for computing forward and inverse dominance frontiers for a function.

Definition at line 41 of file DominanceFrontier.h.

Member Typedef Documentation

◆ BlockTraits

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::BlockTraits = GraphTraits<BlockT *>
protected

Definition at line 47 of file DominanceFrontier.h.

◆ const_iterator

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::const_iterator = typename DomSetMapType::const_iterator

Definition at line 78 of file DominanceFrontier.h.

◆ DomSetMapType

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::DomSetMapType = std::map<BlockT *, DomSetType>

Definition at line 44 of file DominanceFrontier.h.

◆ DomSetType

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::DomSetType = std::set<BlockT *>

Definition at line 43 of file DominanceFrontier.h.

◆ iterator

template<class BlockT, bool IsPostDom>
using llvm::DominanceFrontierBase< BlockT, IsPostDom >::iterator = typename DomSetMapType::iterator

Definition at line 77 of file DominanceFrontier.h.

Constructor & Destructor Documentation

◆ DominanceFrontierBase()

template<class BlockT, bool IsPostDom>
llvm::DominanceFrontierBase< BlockT, IsPostDom >::DominanceFrontierBase ( )
default

Member Function Documentation

◆ addBasicBlock()

template<class BlockT, bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::addBasicBlock ( BlockT *  BB,
const DomSetType frontier 
)
inline

Definition at line 87 of file DominanceFrontier.h.

◆ addToFrontier()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::addToFrontier ( iterator  I,
BlockT *  Node 
)

◆ begin() [1/2]

template<class BlockT, bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::begin ( )
inline

◆ begin() [2/2]

template<class BlockT, bool IsPostDom>
const_iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::begin ( ) const
inline

Definition at line 81 of file DominanceFrontier.h.

◆ compare()

template<class BlockT , bool IsPostDom>
bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::compare ( DominanceFrontierBase< BlockT, IsPostDom > &  Other) const

compare - Return true if the other dominance frontier base matches this dominance frontier base.

Otherwise return false.

Definition at line 99 of file DominanceFrontierImpl.h.

Referenced by llvm::DominanceFrontierBase< BasicBlock, false >::addBasicBlock().

◆ compareDomSet()

template<class BlockT , bool IsPostDom>
bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::compareDomSet ( DomSetType DS1,
const DomSetType DS2 
) const

compareDomSet - Return false if two domsets match.

Otherwise return true;

Definition at line 74 of file DominanceFrontierImpl.h.

Referenced by llvm::DominanceFrontierBase< BasicBlock, false >::addBasicBlock().

◆ dump()

template<class BlockT , bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::dump ( ) const

◆ end() [1/2]

template<class BlockT, bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::end ( )
inline

◆ end() [2/2]

template<class BlockT, bool IsPostDom>
const_iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::end ( ) const
inline

Definition at line 83 of file DominanceFrontier.h.

◆ find() [1/2]

template<class BlockT, bool IsPostDom>
iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::find ( BlockT *  B)
inline

◆ find() [2/2]

template<class BlockT, bool IsPostDom>
const_iterator llvm::DominanceFrontierBase< BlockT, IsPostDom >::find ( BlockT *  B) const
inline

Definition at line 85 of file DominanceFrontier.h.

◆ getRoot()

template<class BlockT, bool IsPostDom>
BlockT* llvm::DominanceFrontierBase< BlockT, IsPostDom >::getRoot ( ) const
inline

Definition at line 62 of file DominanceFrontier.h.

◆ getRoots()

template<class BlockT, bool IsPostDom>
const SmallVectorImpl<BlockT *>& llvm::DominanceFrontierBase< BlockT, IsPostDom >::getRoots ( ) const
inline

getRoots - Return the root blocks of the current CFG.

This may include multiple blocks if we are computing post dominators. For forward dominators, this will always be a single block (the entry node).

Definition at line 60 of file DominanceFrontier.h.

◆ isPostDominator()

template<class BlockT, bool IsPostDom>
bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::isPostDominator ( ) const
inline

isPostDominator - Returns true if analysis based of postdoms

Definition at line 68 of file DominanceFrontier.h.

◆ print()

template<class BlockT , bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::print ( raw_ostream OS) const

◆ releaseMemory()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::releaseMemory ( )
inline

◆ removeBlock()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::removeBlock ( BlockT *  BB)

removeBlock - Remove basic block BB's frontier.

Definition at line 50 of file DominanceFrontierImpl.h.

Referenced by llvm::DominanceFrontierBase< BasicBlock, false >::addBasicBlock().

◆ removeFromFrontier()

template<class BlockT, bool IsPostDom>
void llvm::DominanceFrontierBase< BlockT, IsPostDom >::removeFromFrontier ( iterator  I,
BlockT *  Node 
)

Member Data Documentation

◆ Frontiers

template<class BlockT, bool IsPostDom>
DomSetMapType llvm::DominanceFrontierBase< BlockT, IsPostDom >::Frontiers
protected

Definition at line 49 of file DominanceFrontier.h.

◆ IsPostDominators

template<class BlockT, bool IsPostDom>
constexpr bool llvm::DominanceFrontierBase< BlockT, IsPostDom >::IsPostDominators = IsPostDom
staticprotected

◆ Roots

template<class BlockT, bool IsPostDom>
SmallVector<BlockT *, IsPostDom ? 4 : 1> llvm::DominanceFrontierBase< BlockT, IsPostDom >::Roots
protected

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