From aac929b9acab790623eb920f0f2523591d0b2e4f Mon Sep 17 00:00:00 2001 From: Sergio Pedri Date: Mon, 7 Sep 2020 12:05:40 +0200 Subject: [PATCH] Removed unused code --- .../Extensions/ILGeneratorExtensions.cs | 56 ------------------- 1 file changed, 56 deletions(-) diff --git a/src/ComputeSharp.Shaders/Extensions/ILGeneratorExtensions.cs b/src/ComputeSharp.Shaders/Extensions/ILGeneratorExtensions.cs index 9b676f16..eb251143 100644 --- a/src/ComputeSharp.Shaders/Extensions/ILGeneratorExtensions.cs +++ b/src/ComputeSharp.Shaders/Extensions/ILGeneratorExtensions.cs @@ -8,62 +8,6 @@ namespace System.Reflection.Emit /// internal static class ILGeneratorExtensions { - /// - /// Puts the appropriate or instruction to unbox/cast a value onto the stream of instructions - /// - /// The input instance to use to emit instructions - /// The type of value to convert - public static void EmitCastOrUnbox(this ILGenerator il, Type type) - { - il.Emit(type.IsValueType ? OpCodes.Unbox : OpCodes.Castclass, type); - } - - /// - /// Puts the appropriate instruction to read a local variable onto the stream of instructions - /// - /// The input instance to use to emit instructions - /// The index of the local variable to load - public static void EmitLoadLocal(this ILGenerator il, int index) - { - if (index <= 3) - { - il.Emit(index switch - { - 0 => OpCodes.Ldloc_0, - 1 => OpCodes.Ldloc_1, - 2 => OpCodes.Ldloc_2, - 3 => OpCodes.Ldloc_3, - _ => throw new InvalidOperationException($"Invalid local variable index [{index}]") - }); - } - else if (index <= 255) il.Emit(OpCodes.Ldloc_S, (byte)index); - else if (index <= 65534) il.Emit(OpCodes.Ldloc, (short)index); - else throw new ArgumentOutOfRangeException($"Invalid local index {index}"); - } - - /// - /// Puts the appropriate instruction to write a local variable onto the stream of instructions - /// - /// The input instance to use to emit instructions - /// The index of the local variable to store - public static void EmitStoreLocal(this ILGenerator il, int index) - { - if (index <= 3) - { - il.Emit(index switch - { - 0 => OpCodes.Stloc_0, - 1 => OpCodes.Stloc_1, - 2 => OpCodes.Stloc_2, - 3 => OpCodes.Stloc_3, - _ => throw new InvalidOperationException($"Invalid local variable index [{index}]") - }); - } - else if (index <= 255) il.Emit(OpCodes.Stloc_S, (byte)index); - else if (index <= 65534) il.Emit(OpCodes.Stloc, (short)index); - else throw new ArgumentOutOfRangeException($"Invalid local index {index}"); - } - /// /// Puts the appropriate , , or instruction to read a member onte the stream of instructions ///