Show / Hide Table of Contents

Class CodeInstruction

An abstract wrapper around OpCode and their operands. Used by transpilers

Inheritance
System.Object
CodeInstruction
Inherited Members
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
Namespace: HarmonyLib
Assembly: 0Harmony.dll
Syntax
public class CodeInstruction

Constructors

| Improve this Doc View Source

CodeInstruction(CodeInstruction)

Create a full copy (including labels and exception blocks) of a CodeInstruction

Declaration
public CodeInstruction(CodeInstruction instruction)
Parameters
Type Name Description
CodeInstruction instruction

The instruction to copy

| Improve this Doc View Source

CodeInstruction(OpCode, Object)

Creates a new CodeInstruction with a given opcode and optional operand

Declaration
public CodeInstruction(OpCode opcode, object operand = null)
Parameters
Type Name Description
System.Reflection.Emit.OpCode opcode

The code

System.Object operand

The operand

Fields

| Improve this Doc View Source

blocks

All exception block boundaries defined on this instruction

Declaration
public List<ExceptionBlock> blocks
Field Value
Type Description
System.Collections.Generic.List<ExceptionBlock>
| Improve this Doc View Source

labels

All labels defined on this instruction

Declaration
public List<Label> labels
Field Value
Type Description
System.Collections.Generic.List<System.Reflection.Emit.Label>
| Improve this Doc View Source

opcode

The opcode

Declaration
public OpCode opcode
Field Value
Type Description
System.Reflection.Emit.OpCode
| Improve this Doc View Source

operand

The operand

Declaration
public object operand
Field Value
Type Description
System.Object

Methods

| Improve this Doc View Source

Clone()

Clones a CodeInstruction and resets its labels and exception blocks

Declaration
public CodeInstruction Clone()
Returns
Type Description
CodeInstruction

A lightweight copy of this code instruction

| Improve this Doc View Source

Clone(Object)

Clones a CodeInstruction, resets labels and exception blocks and sets its operand

Declaration
public CodeInstruction Clone(object operand)
Parameters
Type Name Description
System.Object operand

The opcode

Returns
Type Description
CodeInstruction

A copy of this CodeInstruction with a new operand

| Improve this Doc View Source

Clone(OpCode)

Clones a CodeInstruction, resets labels and exception blocks and sets its opcode

Declaration
public CodeInstruction Clone(OpCode opcode)
Parameters
Type Name Description
System.Reflection.Emit.OpCode opcode

The opcode

Returns
Type Description
CodeInstruction

A copy of this CodeInstruction with a new opcode

| Improve this Doc View Source

ToString()

Returns a string representation of the code instruction

Declaration
public override string ToString()
Returns
Type Description
System.String

A string representation of the code instruction

Overrides
System.Object.ToString()
  • Improve this Doc
  • View Source
Back to top Generated by DocFX