Table of Contents

Class HandlerRegion<TInstruction>

Namespace
Echo.ControlFlow.Regions
Assembly
Echo.ControlFlow.dll

Represents a single handler region in an exception handler block.

public class HandlerRegion<TInstruction> : ControlFlowRegion<TInstruction>, IControlFlowRegion<TInstruction>, ISubGraph where TInstruction : notnull

Type Parameters

TInstruction

The type of data that each node in the graph stores.

Inheritance
ControlFlowRegion<TInstruction>
HandlerRegion<TInstruction>
Implements
IControlFlowRegion<TInstruction>
Inherited Members
Extension Methods

Constructors

HandlerRegion()

Creates a new instance of the HandlerRegion<TInstruction> class without an explicit prologue and epilogue set.

public HandlerRegion()

Properties

Contents

Gets the region of nodes that form the code of the handler block.

public ScopeRegion<TInstruction> Contents { get; }

Property Value

ScopeRegion<TInstruction>

Epilogue

Gets the region of nodes that form the code that proceeds the handler.

public ScopeRegion<TInstruction>? Epilogue { get; set; }

Property Value

ScopeRegion<TInstruction>

Prologue

Gets the region of nodes that form the code that precedes the handler.

public ScopeRegion<TInstruction>? Prologue { get; set; }

Property Value

ScopeRegion<TInstruction>

Remarks

This region is often used for filter clauses of the exception handler.

Methods

GetEntryPoint()

Obtains the first node that is executed in the region (if available).

public override ControlFlowNode<TInstruction>? GetEntryPoint()

Returns

ControlFlowNode<TInstruction>

The node, or null if no entrypoint was specified.

GetNodes()

Gets a collection of all nodes in the control flow graph region. This includes all nodes in the nested regions.

public override IEnumerable<ControlFlowNode<TInstruction>> GetNodes()

Returns

IEnumerable<ControlFlowNode<TInstruction>>

The nodes.

GetSubRegions()

Gets a collection of all nested regions defined in this region.

public override IEnumerable<ControlFlowRegion<TInstruction>> GetSubRegions()

Returns

IEnumerable<ControlFlowRegion<TInstruction>>

The subregions.

RemoveNode(ControlFlowNode<TInstruction>)

Removes the node from the region.

public override bool RemoveNode(ControlFlowNode<TInstruction> node)

Parameters

node ControlFlowNode<TInstruction>

The node to remove.

Returns

bool

true if the node was found and removed, false otherwise.