class CFGDominatorTreeImpl
Declaration
template <bool IsPostDom>
class CFGDominatorTreeImpl : public ManagedAnalysis { /* full declaration omitted */ };
Description
Dominator tree builder for Clang's CFG based on llvm::DominatorTreeBase.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:42
Inherits from: ManagedAnalysis
Templates
- bool IsPostDom
Member Variables
- private clang::CFG* cfg
- private clang::CFGDominatorTreeImpl::DominatorTreeBase DT
Method Overview
- public CFGDominatorTreeImpl<IsPostDom>()
- public CFGDominatorTreeImpl<IsPostDom>(clang::CFG * cfg)
- private virtual void anchor()
- public void buildDominatorTree(clang::CFG * cfg)
- public void changeImmediateDominator(clang::CFGBlock * N, clang::CFGBlock * NewIDom)
- public bool compare(CFGDominatorTreeImpl<IsPostDom> & Other) const
- public bool dominates(const clang::CFGBlock * A, const clang::CFGBlock * B) const
- public void dump()
- public clang::CFGBlock * findNearestCommonDominator(clang::CFGBlock * A, clang::CFGBlock * B)
- public const clang::CFGBlock * findNearestCommonDominator(const clang::CFGBlock * A, const clang::CFGBlock * B)
- public clang::CFGDominatorTreeImpl::DominatorTreeBase & getBase()
- public clang::CFG * getCFG()
- public clang::CFGBlock * getRoot() const
- public clang::DomTreeNode * getRootNode()
- public bool isReachableFromEntry(const clang::CFGBlock * A)
- public virtual void print(llvm::raw_ostream & OS, const llvm::Module * M = nullptr) const
- public bool properlyDominates(const clang::CFGBlock * A, const clang::CFGBlock * B) const
- public virtual void releaseMemory()
- public ~CFGDominatorTreeImpl<IsPostDom>()
Inherited from ManagedAnalysis:
Methods
¶CFGDominatorTreeImpl<IsPostDom>()
CFGDominatorTreeImpl<IsPostDom>()
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:48
¶CFGDominatorTreeImpl<IsPostDom>(clang::CFG* cfg)
CFGDominatorTreeImpl<IsPostDom>(clang::CFG* cfg)
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:50
Parameters
- clang::CFG* cfg
¶virtual void anchor()
virtual void anchor()
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:43
¶void buildDominatorTree(clang::CFG* cfg)
void buildDominatorTree(clang::CFG* cfg)
Description
Builds the dominator tree for a given CFG.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:87
Parameters
- clang::CFG* cfg
¶void changeImmediateDominator(
clang::CFGBlock* N,
clang::CFGBlock* NewIDom)
void changeImmediateDominator(
clang::CFGBlock* N,
clang::CFGBlock* NewIDom)
Description
Update the dominator tree information when a node's immediate dominator changes.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:160
Parameters
- clang::CFGBlock* N
- clang::CFGBlock* NewIDom
¶bool compare(
CFGDominatorTreeImpl<IsPostDom>& Other) const
bool compare(
CFGDominatorTreeImpl<IsPostDom>& Other) const
Description
Compares two dominator trees.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:73
Parameters
- CFGDominatorTreeImpl<IsPostDom>& Other
Returns
false if the other dominator tree matches this dominator tree, false otherwise.
¶bool dominates(const clang::CFGBlock* A,
const clang::CFGBlock* B) const
bool dominates(const clang::CFGBlock* A,
const clang::CFGBlock* B) const
Description
Tests whether \p A dominates \p B. Note a block always dominates itself.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:136
Parameters
- const clang::CFGBlock* A
- const clang::CFGBlock* B
¶void dump()
void dump()
Description
Dumps immediate dominators for each block.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:94
¶clang::CFGBlock* findNearestCommonDominator(
clang::CFGBlock* A,
clang::CFGBlock* B)
clang::CFGBlock* findNearestCommonDominator(
clang::CFGBlock* A,
clang::CFGBlock* B)
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:149
Parameters
Returns
the nearest common dominator CFG block for CFG block \p A and \p B. If there is no such block then return NULL.
¶const clang::CFGBlock* findNearestCommonDominator(
const clang::CFGBlock* A,
const clang::CFGBlock* B)
const clang::CFGBlock* findNearestCommonDominator(
const clang::CFGBlock* A,
const clang::CFGBlock* B)
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:153
Parameters
- const clang::CFGBlock* A
- const clang::CFGBlock* B
¶clang::CFGDominatorTreeImpl::DominatorTreeBase&
getBase()
clang::CFGDominatorTreeImpl::DominatorTreeBase&
getBase()
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:56
¶clang::CFG* getCFG()
clang::CFG* getCFG()
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:58
¶clang::CFGBlock* getRoot() const
clang::CFGBlock* getRoot() const
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:61
Returns
the root CFGBlock of the dominators tree.
¶clang::DomTreeNode* getRootNode()
clang::DomTreeNode* getRootNode()
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:66
Returns
the root DomTreeNode, which is the wrapper for CFGBlock.
¶bool isReachableFromEntry(
const clang::CFGBlock* A)
bool isReachableFromEntry(
const clang::CFGBlock* A)
Description
Tests whether \p A is reachable from the entry block.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:165
Parameters
- const clang::CFGBlock* A
¶virtual void print(
llvm::raw_ostream& OS,
const llvm::Module* M = nullptr) const
virtual void print(
llvm::raw_ostream& OS,
const llvm::Module* M = nullptr) const
Description
Converts the dominator tree to human readable form.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:173
Parameters
- llvm::raw_ostream& OS
- const llvm::Module* M = nullptr
¶bool properlyDominates(
const clang::CFGBlock* A,
const clang::CFGBlock* B) const
bool properlyDominates(
const clang::CFGBlock* A,
const clang::CFGBlock* B) const
Description
Tests whether \p A properly dominates \p B.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:143
Parameters
- const clang::CFGBlock* A
- const clang::CFGBlock* B
Returns
false if \p A is the same block as \p B, otherwise whether A dominates B.
¶virtual void releaseMemory()
virtual void releaseMemory()
Description
Releases the memory held by the dominator tree.
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:170
¶~CFGDominatorTreeImpl<IsPostDom>()
~CFGDominatorTreeImpl<IsPostDom>()
Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:54