Class ILInlining
- Namespace
- ICSharpCode.Decompiler.IL.Transforms
- Assembly
- ICSharpCode.Decompiler.dll
Performs inlining transformations.
public class ILInlining : IILTransform, IBlockTransform, IStatementTransform
- Inheritance
-
ILInlining
- Implements
- Inherited Members
Constructors
ILInlining()
public ILInlining()
Methods
CanInlineInto(ILInstruction, ILVariable, ILInstruction)
Gets whether 'expressionBeingMoved' can be inlined into 'expr'.
public static bool CanInlineInto(ILInstruction expr, ILVariable v, ILInstruction expressionBeingMoved)
Parameters
expr
ILInstructionv
ILVariableexpressionBeingMoved
ILInstruction
Returns
CanMoveInto(ILInstruction, ILInstruction, ILInstruction)
Gets whether 'expressionBeingMoved' can be moved from somewhere before 'stmt' to become the replacement of 'targetLoad'.
public static bool CanMoveInto(ILInstruction expressionBeingMoved, ILInstruction stmt, ILInstruction targetLoad)
Parameters
expressionBeingMoved
ILInstructionstmt
ILInstructiontargetLoad
ILInstruction
Returns
InlineAllInBlock(ILFunction, Block, InliningOptions, ILTransformContext)
public static bool InlineAllInBlock(ILFunction function, Block block, InliningOptions options, ILTransformContext context)
Parameters
function
ILFunctionblock
Blockoptions
InliningOptionscontext
ILTransformContext
Returns
InlineIfPossible(Block, int, ILTransformContext)
Aggressively inlines the stloc instruction at block.Body[pos] into the next instruction, if possible.
public static bool InlineIfPossible(Block block, int pos, ILTransformContext context)
Parameters
block
Blockpos
intcontext
ILTransformContext
Returns
InlineInto(Block, int, InliningOptions, ILTransformContext)
Inlines instructions before pos into block.Instructions[pos].
public static int InlineInto(Block block, int pos, InliningOptions options, ILTransformContext context)
Parameters
block
Blockpos
intoptions
InliningOptionscontext
ILTransformContext
Returns
- int
The number of instructions that were inlined.
InlineOne(StLoc, InliningOptions, ILTransformContext)
Inlines the stloc instruction at block.Instructions[pos] into the next instruction.
Note that this method does not check whether 'v' has only one use; the caller is expected to validate whether inlining 'v' has any effects on other uses of 'v'.
public static bool InlineOne(StLoc stloc, InliningOptions options, ILTransformContext context)
Parameters
stloc
StLocoptions
InliningOptionscontext
ILTransformContext
Returns
InlineOneIfPossible(Block, int, InliningOptions, ILTransformContext)
Inlines the stloc instruction at block.Instructions[pos] into the next instruction, if possible.
public static bool InlineOneIfPossible(Block block, int pos, InliningOptions options, ILTransformContext context)
Parameters
block
Blockpos
intoptions
InliningOptionscontext
ILTransformContext
Returns
Run(Block, BlockTransformContext)
Runs the transform on the specified block.
Note: the transform may only modify the specified block and its descendants, as well as any sibling blocks that are dominated by the specified block.
public void Run(Block block, BlockTransformContext context)
Parameters
block
Blockcontext
BlockTransformContext
Run(Block, int, StatementTransformContext)
public void Run(Block block, int pos, StatementTransformContext context)
Parameters
block
Blockpos
intcontext
StatementTransformContext
Run(ILFunction, ILTransformContext)
public void Run(ILFunction function, ILTransformContext context)
Parameters
function
ILFunctioncontext
ILTransformContext