Table of Contents

Class CilArchitecture

Namespace
Echo.Platforms.AsmResolver
Assembly
Echo.Platforms.AsmResolver.dll

Provides a description of the CIL instruction set architecture (ISA) that is modelled by AsmResolver.

public class CilArchitecture : IArchitecture<CilInstruction>
Inheritance
CilArchitecture
Implements
Inherited Members

Constructors

CilArchitecture(CilMethodBody)

Creates a new CIL architecture description based on a CIL method body.

public CilArchitecture(CilMethodBody parentBody)

Parameters

parentBody CilMethodBody

The method body.

Properties

MethodBody

Gets the method body that was encapsulated.

public CilMethodBody MethodBody { get; }

Property Value

CilMethodBody

SuccessorResolver

Gets the default static successor resolution engine for this architecture.

public CilStaticSuccessorResolver SuccessorResolver { get; }

Property Value

CilStaticSuccessorResolver

Methods

GetFlowControl(in CilInstruction)

Gets attributes associated to the flow control behaviour of the provided instruction.

public InstructionFlowControl GetFlowControl(in CilInstruction instruction)

Parameters

instruction CilInstruction

The instruction to get the attributes from.

Returns

InstructionFlowControl

The flow control attributes.

GetLocal(CilLocalVariable)

Gets the Echo symbol for the provided CilLocalVariable instance.

public CilVariable GetLocal(CilLocalVariable variable)

Parameters

variable CilLocalVariable

The local variable.

Returns

CilVariable

The Echo symbol representing the local variable.

GetOffset(in CilInstruction)

Gets the offset of an instruction.

public long GetOffset(in CilInstruction instruction)

Parameters

instruction CilInstruction

The instruction to get the offset from.

Returns

long

The offset.

GetParameter(Parameter)

Gets the Echo symbol for the provided Parameter instance.

public CilParameter GetParameter(Parameter variable)

Parameters

variable Parameter

The parameter.

Returns

CilParameter

The Echo symbol representing the parameter.

GetReadVariables(in CilInstruction, ICollection<IVariable>)

Gets a collection of variables that an instruction reads from.

public void GetReadVariables(in CilInstruction instruction, ICollection<IVariable> variablesBuffer)

Parameters

instruction CilInstruction

The instruction to get the variables from.

variablesBuffer ICollection<IVariable>

The output buffer to add the read variables into.

GetSize(in CilInstruction)

Gets the size in bytes of an instruction.

public int GetSize(in CilInstruction instruction)

Parameters

instruction CilInstruction

The instruction to measure.

Returns

int

The size.

GetStackPopCount(in CilInstruction)

Gets a value indicating the number of values an instruction pops from the stack.

public int GetStackPopCount(in CilInstruction instruction)

Parameters

instruction CilInstruction

The instruction to get the stack pop count from.

Returns

int

The number of stack slots the instruction pops.

GetStackPushCount(in CilInstruction)

Gets a value indicating the number of values an instruction pushes on the stack.

public int GetStackPushCount(in CilInstruction instruction)

Parameters

instruction CilInstruction

The instruction to get the stack push count from.

Returns

int

The number of stack slots the instruction pushes.

GetWrittenVariables(in CilInstruction, ICollection<IVariable>)

Gets a collection of variables that an instruction writes to.

public void GetWrittenVariables(in CilInstruction instruction, ICollection<IVariable> variablesBuffer)

Parameters

instruction CilInstruction

The instruction to get the variables from.

variablesBuffer ICollection<IVariable>

The output buffer to add the written variables into.