Table of Contents

Class Dominance

Namespace
ICSharpCode.Decompiler.FlowAnalysis
Assembly
ICSharpCode.Decompiler.dll

Description of Dominance.

public static class Dominance
Inheritance
Dominance
Inherited Members

Methods

ComputeDominance(ControlFlowNode, CancellationToken)

Computes the dominator tree.

public static void ComputeDominance(ControlFlowNode entryPoint, CancellationToken cancellationToken = default)

Parameters

entryPoint ControlFlowNode
cancellationToken CancellationToken

Remarks

Precondition: the dominance tree is not already computed for some nodes reachable from entryPoint (i.e. ImmediateDominator and DominatorTreeChildren are both null), and the visited flag is false for any nodes reachable from entryPoint.

Postcondition: a dominator tree is constructed for all nodes reachable from entryPoint, and the visited flag remains false.

FindCommonDominator(ControlFlowNode, ControlFlowNode)

Returns the common ancestor of a and b in the dominator tree.

Precondition: a and b are part of the same dominator tree.

public static ControlFlowNode FindCommonDominator(ControlFlowNode a, ControlFlowNode b)

Parameters

a ControlFlowNode
b ControlFlowNode

Returns

ControlFlowNode

MarkNodesWithReachableExits(ControlFlowNode[])

Computes a BitSet where result[i] == true iff cfg[i] is reachable and there is some node that is reachable from cfg[i] but not dominated by cfg[i].

This is similar to "does cfg[i] have a non-empty dominance frontier?", except that it uses non-strict dominance where the definition of dominance frontiers uses "strictly dominates".

Precondition: Dominance was computed for cfg and cfg[i].UserIndex == i for all i.

public static BitSet MarkNodesWithReachableExits(ControlFlowNode[] cfg)

Parameters

cfg ControlFlowNode[]

Returns

BitSet