Table of Contents

Class SwitchDetection.LoopContext

Namespace
ICSharpCode.Decompiler.IL.ControlFlow
Assembly
ICSharpCode.Decompiler.dll

When detecting a switch, it is important to distinguish Branch instructions which will eventually decompile to continue; statements.

A LoopContext is constructed for a node and its dominator tree, as for a Branch to be a continue; statement, it must be contained within the target-loop

This class also supplies the depth of the loop targetted by a continue; statement relative to the context node, to avoid (or eventually support) labelled continues to outer loops

public class SwitchDetection.LoopContext
Inheritance
SwitchDetection.LoopContext
Inherited Members

Constructors

LoopContext(ControlFlowGraph, ControlFlowNode)

public LoopContext(ControlFlowGraph cfg, ControlFlowNode contextNode)

Parameters

cfg ControlFlowGraph
contextNode ControlFlowNode

Methods

GetContinueDepth(ControlFlowNode)

public int GetContinueDepth(ControlFlowNode node)

Parameters

node ControlFlowNode

Returns

int

MatchContinue(ControlFlowNode)

public bool MatchContinue(ControlFlowNode node)

Parameters

node ControlFlowNode

Returns

bool

MatchContinue(ControlFlowNode, int)

public bool MatchContinue(ControlFlowNode node, int depth)

Parameters

node ControlFlowNode
depth int

Returns

bool

MatchContinue(ControlFlowNode, out int)

public bool MatchContinue(ControlFlowNode node, out int depth)

Parameters

node ControlFlowNode
depth int

Returns

bool