Class ILGeneratorExtensions
Represents the il generator extensions.
Inherited Members
Namespace: Platform.Reflection
Assembly: Platform.Reflection.dll
Syntax
public static class ILGeneratorExtensions
Methods
| Improve this Doc View SourceAdd(ILGenerator)
Adds the generator.
Declaration
public static void Add(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
And(ILGenerator)
Ands the generator.
Declaration
public static void And(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Box(ILGenerator, Type)
Boxes the generator.
Declaration
public static void Box(this ILGenerator generator, Type boxedType)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | boxedType | The boxed type.
|
Box<TBox>(ILGenerator)
Boxes the generator.
Declaration
public static void Box<TBox>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TBox | The box.
|
BranchIfGreaterOrEqual(ILGenerator, Label)
Branches the if greater or equal using the specified generator.
Declaration
public static void BranchIfGreaterOrEqual(this ILGenerator generator, Label label)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Label | label | The label.
|
BranchIfGreaterOrEqual(ILGenerator, Boolean, Label)
Branches the if greater or equal using the specified generator.
Declaration
public static void BranchIfGreaterOrEqual(this ILGenerator generator, bool isSigned, Label label)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | isSigned | The is signed.
|
Label | label | The label.
|
BranchIfLessOrEqual(ILGenerator, Label)
Branches the if less or equal using the specified generator.
Declaration
public static void BranchIfLessOrEqual(this ILGenerator generator, Label label)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Label | label | The label.
|
BranchIfLessOrEqual(ILGenerator, Boolean, Label)
Branches the if less or equal using the specified generator.
Declaration
public static void BranchIfLessOrEqual(this ILGenerator generator, bool isSigned, Label label)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | isSigned | The is signed.
|
Label | label | The label.
|
Call(ILGenerator, MethodInfo)
Calls the generator.
Declaration
public static void Call(this ILGenerator generator, MethodInfo method)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
MethodInfo | method | The method.
|
CheckedConvert<TSource, TTarget>(ILGenerator)
Checkeds the convert using the specified generator.
Declaration
public static void CheckedConvert<TSource, TTarget>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TSource | The source.
|
TTarget | The target.
|
Exceptions
Type | Condition |
---|---|
NotSupportedException |
|
CheckedMultiply<T>(ILGenerator)
Checkeds the multiply using the specified generator.
Declaration
public static void CheckedMultiply<T>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
T | The .
|
CompareGreaterThan(ILGenerator)
Compares the greater than using the specified generator.
Declaration
public static void CompareGreaterThan(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
CompareGreaterThan(ILGenerator, Boolean)
Compares the greater than using the specified generator.
Declaration
public static void CompareGreaterThan(this ILGenerator generator, bool isSigned)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | isSigned | The is signed.
|
CompareLessThan(ILGenerator)
Compares the less than using the specified generator.
Declaration
public static void CompareLessThan(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
CompareLessThan(ILGenerator, Boolean)
Compares the less than using the specified generator.
Declaration
public static void CompareLessThan(this ILGenerator generator, bool isSigned)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | isSigned | The is signed.
|
DeclareLocal<T>(ILGenerator)
Declares the local using the specified generator.
Declaration
public static LocalBuilder DeclareLocal<T>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Returns
Type | Description |
---|---|
LocalBuilder | The local builder
|
Type Parameters
Name | Description |
---|---|
T | The .
|
Decrement(ILGenerator, Type)
Decrements the generator.
Declaration
public static void Decrement(this ILGenerator generator, Type valueType)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | valueType | The value type.
|
Decrement<TValue>(ILGenerator)
Decrements the generator.
Declaration
public static void Decrement<TValue>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TValue | The value.
|
Divide<T>(ILGenerator)
Divides the generator.
Declaration
public static void Divide<T>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
T | The .
|
Increment(ILGenerator, Type)
Increments the generator.
Declaration
public static void Increment(this ILGenerator generator, Type valueType)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | valueType | The value type.
|
Increment<TValue>(ILGenerator)
Increments the generator.
Declaration
public static void Increment<TValue>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TValue | The value.
|
LoadArgument(ILGenerator, Int32)
Loads the argument using the specified generator.
Declaration
public static void LoadArgument(this ILGenerator generator, int argumentIndex)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Int32 | argumentIndex | The argument index.
|
LoadArguments(ILGenerator, Int32[])
Loads the arguments using the specified generator.
Declaration
public static void LoadArguments(this ILGenerator generator, params int[] argumentIndices)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Int32[] | argumentIndices | The argument indices.
|
LoadConstant(ILGenerator, Boolean)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, bool value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | value | The value.
|
LoadConstant(ILGenerator, Byte)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, byte value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Byte | value | The value.
|
LoadConstant(ILGenerator, Double)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, double value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Double | value | The value.
|
LoadConstant(ILGenerator, Int16)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, short value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Int16 | value | The value.
|
LoadConstant(ILGenerator, Int32)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, int value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Int32 | value | The value.
|
LoadConstant(ILGenerator, Int64)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, long value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Int64 | value | The value.
|
LoadConstant(ILGenerator, SByte)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, sbyte value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
SByte | value | The value.
|
LoadConstant(ILGenerator, Single)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, float value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Single | value | The value.
|
LoadConstant(ILGenerator, Type, Object)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, Type constantType, object constantValue)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | constantType | The constant type.
|
Object | constantValue | The constant value.
|
Exceptions
Type | Condition |
---|---|
NotSupportedException |
|
LoadConstant(ILGenerator, UInt16)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, ushort value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
UInt16 | value | The value.
|
LoadConstant(ILGenerator, UInt32)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, uint value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
UInt32 | value | The value.
|
LoadConstant(ILGenerator, UInt64)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant(this ILGenerator generator, ulong value)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
UInt64 | value | The value.
|
LoadConstant<TConstant>(ILGenerator, TConstant)
Loads the constant using the specified generator.
Declaration
public static void LoadConstant<TConstant>(this ILGenerator generator, TConstant constantValue)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
TConstant | constantValue | The constant value.
|
Type Parameters
Name | Description |
---|---|
TConstant | The constant.
|
LoadConstantOne(ILGenerator, Type)
Loads the constant one using the specified generator.
Declaration
public static void LoadConstantOne(this ILGenerator generator, Type constantType)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | constantType | The constant type.
|
Exceptions
Type | Condition |
---|---|
NotSupportedException |
|
LoadConstantOne<TConstant>(ILGenerator)
Loads the constant one using the specified generator.
Declaration
public static void LoadConstantOne<TConstant>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TConstant | The constant.
|
LoadIndirect(ILGenerator, Type, Boolean, Nullable<Byte>)
Loads the indirect using the specified generator.
Declaration
public static void LoadIndirect(this ILGenerator generator, Type type, bool isVolatile = false, byte? unaligned = default(byte? ))
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | type | The type.
|
Boolean | isVolatile | The is volatile.
|
Nullable<Byte> | unaligned | The unaligned.
|
Exceptions
Type | Condition |
---|---|
InvalidOperationException |
|
ArgumentException | unaligned must be null, 1, 2, or 4
|
LoadIndirect<T>(ILGenerator, Boolean, Nullable<Byte>)
Loads the indirect using the specified generator.
Declaration
public static void LoadIndirect<T>(this ILGenerator generator, bool isVolatile = false, byte? unaligned = default(byte? ))
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | isVolatile | The is volatile.
|
Nullable<Byte> | unaligned | The unaligned.
|
Type Parameters
Name | Description |
---|---|
T | The .
|
LoadLocal(ILGenerator, LocalBuilder)
Loads the local using the specified generator.
Declaration
public static void LoadLocal(this ILGenerator generator, LocalBuilder local)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
LocalBuilder | local | The local.
|
Multiply(ILGenerator)
Multiplies the generator.
Declaration
public static void Multiply(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Negate(ILGenerator)
Negates the generator.
Declaration
public static void Negate(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
NewObject(ILGenerator, ConstructorInfo)
News the object using the specified generator.
Declaration
public static void NewObject(this ILGenerator generator, ConstructorInfo constructor)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
ConstructorInfo | constructor | The constructor.
|
NewObject(ILGenerator, Type, Type[])
News the object using the specified generator.
Declaration
public static void NewObject(this ILGenerator generator, Type type, params Type[] parameterTypes)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | type | The type.
|
Type[] | parameterTypes | The parameter types.
|
Exceptions
Type | Condition |
---|---|
InvalidOperationException |
|
Not(ILGenerator)
Nots the generator.
Declaration
public static void Not(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Or(ILGenerator)
Ors the generator.
Declaration
public static void Or(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Return(ILGenerator)
Returns the generator.
Declaration
public static void Return(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
ShiftLeft(ILGenerator)
Shifts the left using the specified generator.
Declaration
public static void ShiftLeft(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
ShiftRight<T>(ILGenerator)
Shifts the right using the specified generator.
Declaration
public static void ShiftRight<T>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
T | The .
|
StoreArgument(ILGenerator, Int32)
Stores the argument using the specified generator.
Declaration
public static void StoreArgument(this ILGenerator generator, int argumentIndex)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Int32 | argumentIndex | The argument index.
|
StoreIndirect(ILGenerator, Type, Boolean, Nullable<Byte>)
Stores the indirect using the specified generator.
Declaration
public static void StoreIndirect(this ILGenerator generator, Type type, bool isVolatile = false, byte? unaligned = default(byte? ))
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | type | The type.
|
Boolean | isVolatile | The is volatile.
|
Nullable<Byte> | unaligned | The unaligned.
|
Exceptions
Type | Condition |
---|---|
InvalidOperationException |
|
ArgumentException | unaligned must be null, 1, 2, or 4
|
StoreIndirect<T>(ILGenerator, Boolean, Nullable<Byte>)
Stores the indirect using the specified generator.
Declaration
public static void StoreIndirect<T>(this ILGenerator generator, bool isVolatile = false, byte? unaligned = default(byte? ))
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | isVolatile | The is volatile.
|
Nullable<Byte> | unaligned | The unaligned.
|
Type Parameters
Name | Description |
---|---|
T | The .
|
StoreLocal(ILGenerator, LocalBuilder)
Stores the local using the specified generator.
Declaration
public static void StoreLocal(this ILGenerator generator, LocalBuilder local)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
LocalBuilder | local | The local.
|
Subtract(ILGenerator)
Subtracts the generator.
Declaration
public static void Subtract(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Throw<T>(ILGenerator)
Throws the generator.
Declaration
public static void Throw<T>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
T | The .
|
Unbox(ILGenerator, Type)
Unboxes the generator.
Declaration
public static void Unbox(this ILGenerator generator, Type typeToUnbox)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | typeToUnbox | The type to unbox.
|
Unbox<TUnbox>(ILGenerator)
Unboxes the generator.
Declaration
public static void Unbox<TUnbox>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TUnbox | The unbox.
|
UnboxValue(ILGenerator, Type)
Unboxes the value using the specified generator.
Declaration
public static void UnboxValue(this ILGenerator generator, Type typeToUnbox)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type | typeToUnbox | The type to unbox.
|
UnboxValue<TUnbox>(ILGenerator)
Unboxes the value using the specified generator.
Declaration
public static void UnboxValue<TUnbox>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TUnbox | The unbox.
|
UncheckedConvert<TSource, TTarget>(ILGenerator)
Uncheckeds the convert using the specified generator.
Declaration
public static void UncheckedConvert<TSource, TTarget>(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Type Parameters
Name | Description |
---|---|
TSource | The source.
|
TTarget | The target.
|
UncheckedConvert<TSource, TTarget>(ILGenerator, Boolean)
Uncheckeds the convert using the specified generator.
Declaration
public static void UncheckedConvert<TSource, TTarget>(this ILGenerator generator, bool extendSign)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Boolean | extendSign | The extend sign.
|
Type Parameters
Name | Description |
---|---|
TSource | The source.
|
TTarget | The target.
|
UnsignedBranchIfGreaterOrEqual(ILGenerator, Label)
Unsigneds the branch if greater or equal using the specified generator.
Declaration
public static void UnsignedBranchIfGreaterOrEqual(this ILGenerator generator, Label label)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Label | label | The label.
|
UnsignedBranchIfLessOrEqual(ILGenerator, Label)
Unsigneds the branch if less or equal using the specified generator.
Declaration
public static void UnsignedBranchIfLessOrEqual(this ILGenerator generator, Label label)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
Label | label | The label.
|
UnsignedCompareGreaterThan(ILGenerator)
Unsigneds the compare greater than using the specified generator.
Declaration
public static void UnsignedCompareGreaterThan(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|
UnsignedCompareLessThan(ILGenerator)
Unsigneds the compare less than using the specified generator.
Declaration
public static void UnsignedCompareLessThan(this ILGenerator generator)
Parameters
Type | Name | Description |
---|---|---|
ILGenerator | generator | The generator.
|