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=nullptr) 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 38 of file Dominators.h.


Constructor & Destructor Documentation

Definition at line 43 of file Dominators.h.

References DT.

Definition at line 47 of file Dominators.h.

References DT.


Member Function Documentation

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

Definition at line 85 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 137 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 69 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 111 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 93 of file Dominators.h.

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

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 125 of file Dominators.h.

References DT.

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

Definition at line 129 of file Dominators.h.

References DT.

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

Definition at line 51 of file Dominators.h.

References DT.

Referenced by compare().

This method returns the root CFGBlock of the dominators tree.

Definition at line 55 of file Dominators.h.

References DT.

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

Definition at line 61 of file Dominators.h.

References DT.

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

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

Definition at line 144 of file Dominators.h.

References DT.

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

This method converts the dominator tree to human readable form.

Definition at line 156 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 118 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 150 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: