LLVM  8.0.1
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 42 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 48 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 79 of file DominanceFrontier.h.

◆ DomSetMapType

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

Definition at line 45 of file DominanceFrontier.h.

◆ DomSetType

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

Definition at line 44 of file DominanceFrontier.h.

◆ iterator

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

Definition at line 78 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 88 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 82 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 100 of file DominanceFrontierImpl.h.

◆ 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 75 of file DominanceFrontierImpl.h.

◆ dump()

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

dump - Dump the dominance frontier to dbgs().

Definition at line 154 of file DominanceFrontierImpl.h.

Referenced by llvm::DominanceFrontierWrapperPass::getDominanceFrontier().

◆ 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 84 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 86 of file DominanceFrontier.h.

◆ getRoot()

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

Definition at line 63 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 61 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 69 of file DominanceFrontier.h.

◆ print()

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

print - Convert to human readable form

Definition at line 130 of file DominanceFrontierImpl.h.

Referenced by llvm::DominanceFrontierWrapperPass::getDominanceFrontier(), and llvm::DominanceFrontierWrapperPass::print().

◆ 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 51 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 
)

Definition at line 67 of file DominanceFrontierImpl.h.

Member Data Documentation

◆ Frontiers

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

Definition at line 50 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: