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

Inherited from ManagedAnalysis:

    Methods

    CFGDominatorTreeImpl<IsPostDom>()

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:48

    CFGDominatorTreeImpl<IsPostDom>(clang::CFG* cfg)

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:50

    Parameters

    clang::CFG* cfg

    virtual void anchor()

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:43

    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)

    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

    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

    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()

    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)

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:149

    Parameters

    clang::CFGBlock* A
    clang::CFGBlock* B

    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)

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:153

    Parameters

    const clang::CFGBlock* A
    const clang::CFGBlock* B

    clang::CFGDominatorTreeImpl::DominatorTreeBase&
    getBase()

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:56

    clang::CFG* getCFG()

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:58

    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()

    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)

    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

    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

    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()

    Description

    Releases the memory held by the dominator tree.

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:170

    ~CFGDominatorTreeImpl<IsPostDom>()

    Declared at: clang/include/clang/Analysis/Analyses/Dominators.h:54