Table of Contents

Class LoopDetection

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

Detect loops in IL AST.

public class LoopDetection : IBlockTransform
Inheritance
LoopDetection
Implements
Inherited Members

Remarks

Transform ordering:

  • LoopDetection should run before other control flow structures are detected.
  • Blocks should be basic blocks (not extended basic blocks) so that the natural loops don't include more instructions than strictly necessary.
  • Loop detection should run after the 'return block' is duplicated (ControlFlowSimplification).

Constructors

LoopDetection()

public LoopDetection()

Methods

Run(Block, BlockTransformContext)

Check whether 'block' is a loop head; and construct a loop instruction (nested BlockContainer) if it is.

public void Run(Block block, BlockTransformContext context)

Parameters

block Block
context BlockTransformContext