clang API Documentation

Public Member Functions | Public Attributes
clang::DominatorTree Class Reference

Concrete subclass of DominatorTreeBase for Clang This class implements the dominators tree functionality given a Clang CFG. More...

#include <Dominators.h>

Inheritance diagram for clang::DominatorTree:
Inheritance graph
[legend]
Collaboration diagram for clang::DominatorTree:
Collaboration graph
[legend]

List of all members.

Public Member Functions

 DominatorTree ()
 ~DominatorTree ()
llvm::DominatorTreeBase
< CFGBlock > & 
getBase ()
CFGBlockgetRoot () const
 This method returns the root CFGBlock of the dominators tree.
DomTreeNodegetRootNode () const
 This method returns the root DomTreeNode, which is the wrapper for CFGBlock.
bool compare (DominatorTree &Other) const
 This method compares two dominator trees. The method returns false if the other dominator tree matches this dominator tree, otherwise returns true.
void buildDominatorTree (AnalysisDeclContext &AC)
 This method builds the dominator tree for a given CFG The CFG information is passed via AnalysisDeclContext.
void dump ()
 This method dumps immediate dominators for each block, mainly used for debug purposes.
bool dominates (const CFGBlock *A, const CFGBlock *B) const
 This method tests if one CFGBlock dominates the other. The method return true if A dominates B, false otherwise. Note a block always dominates itself.
bool properlyDominates (const CFGBlock *A, const CFGBlock *B) const
 This method tests if one CFGBlock properly dominates the other. The method return true if A properly dominates B, false otherwise.
CFGBlockfindNearestCommonDominator (CFGBlock *A, CFGBlock *B)
 This method finds the nearest common dominator CFG block for CFG block A and B. If there is no such block then return NULL.
const CFGBlockfindNearestCommonDominator (const CFGBlock *A, const CFGBlock *B)
void changeImmediateDominator (CFGBlock *N, CFGBlock *NewIDom)
 This method is used to update the dominator tree information when a node's immediate dominator changes.
bool isReachableFromEntry (const CFGBlock *A)
 This method tests if the given CFGBlock can be reachable from root. Returns true if reachable, false otherwise.
virtual void releaseMemory ()
 This method releases the memory held by the dominator tree.
virtual void print (raw_ostream &OS, const llvm::Module *M=0) const
 This method converts the dominator tree to human readable form.

Public Attributes

llvm::DominatorTreeBase
< CFGBlock > * 
DT

Detailed Description

Concrete subclass of DominatorTreeBase for Clang This class implements the dominators tree functionality given a Clang CFG.

Definition at line 33 of file Dominators.h.


Constructor & Destructor Documentation

clang::DominatorTree::DominatorTree ( ) [inline]

Definition at line 38 of file Dominators.h.

References DT.

clang::DominatorTree::~DominatorTree ( ) [inline]

Definition at line 42 of file Dominators.h.

References DT.


Member Function Documentation

void clang::DominatorTree::buildDominatorTree ( AnalysisDeclContext AC) [inline]

This method builds the dominator tree for a given CFG The CFG information is passed via AnalysisDeclContext.

Definition at line 80 of file Dominators.h.

References DT, and clang::AnalysisDeclContext::getCFG().

void clang::DominatorTree::changeImmediateDominator ( CFGBlock N,
CFGBlock NewIDom 
) [inline]

This method is used to update the dominator tree information when a node's immediate dominator changes.

Definition at line 132 of file Dominators.h.

References DT.

bool clang::DominatorTree::compare ( DominatorTree Other) const [inline]

This method compares two dominator trees. The method returns false if the other dominator tree matches this dominator tree, otherwise returns true.

Definition at line 64 of file Dominators.h.

References DT, getBase(), and getRootNode().

bool clang::DominatorTree::dominates ( const CFGBlock A,
const CFGBlock B 
) const [inline]

This method tests if one CFGBlock dominates the other. The method return true if A dominates B, false otherwise. Note a block always dominates itself.

Definition at line 106 of file Dominators.h.

References DT.

void clang::DominatorTree::dump ( ) [inline]

This method dumps immediate dominators for each block, mainly used for debug purposes.

Definition at line 88 of file Dominators.h.

References clang::CFG::begin(), DT, and clang::CFG::end().

CFGBlock* clang::DominatorTree::findNearestCommonDominator ( CFGBlock A,
CFGBlock B 
) [inline]

This method finds the nearest common dominator CFG block for CFG block A and B. If there is no such block then return NULL.

Definition at line 120 of file Dominators.h.

References DT.

const CFGBlock* clang::DominatorTree::findNearestCommonDominator ( const CFGBlock A,
const CFGBlock B 
) [inline]

Definition at line 124 of file Dominators.h.

References DT.

llvm::DominatorTreeBase<CFGBlock>& clang::DominatorTree::getBase ( ) [inline]

Definition at line 46 of file Dominators.h.

References DT.

Referenced by compare().

CFGBlock* clang::DominatorTree::getRoot ( ) const [inline]

This method returns the root CFGBlock of the dominators tree.

Definition at line 50 of file Dominators.h.

References DT.

DomTreeNode* clang::DominatorTree::getRootNode ( ) const [inline]

This method returns the root DomTreeNode, which is the wrapper for CFGBlock.

Definition at line 56 of file Dominators.h.

References DT.

Referenced by compare(), and llvm::GraphTraits< ::clang::DominatorTree * >::getEntryNode().

bool clang::DominatorTree::isReachableFromEntry ( const CFGBlock A) [inline]

This method tests if the given CFGBlock can be reachable from root. Returns true if reachable, false otherwise.

Definition at line 139 of file Dominators.h.

References DT.

virtual void clang::DominatorTree::print ( raw_ostream &  OS,
const llvm::Module *  M = 0 
) const [inline, virtual]

This method converts the dominator tree to human readable form.

Definition at line 151 of file Dominators.h.

References DT.

bool clang::DominatorTree::properlyDominates ( const CFGBlock A,
const CFGBlock B 
) const [inline]

This method tests if one CFGBlock properly dominates the other. The method return true if A properly dominates B, false otherwise.

Definition at line 113 of file Dominators.h.

References DT.

virtual void clang::DominatorTree::releaseMemory ( ) [inline, virtual]

This method releases the memory held by the dominator tree.

Definition at line 145 of file Dominators.h.

References DT.


Member Data Documentation

llvm::DominatorTreeBase<CFGBlock>* clang::DominatorTree::DT

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