コード例 #1
0
        public static Instruction LdcI4(int value)
        {
            var ldcI4 = OpCodeHelper.LdcI4(value);

            return(ldcI4.Code switch
            {
                Code.Ldc_I4_S => Instruction.Create(ldcI4, (sbyte)value),
                Code.Ldc_I4 => Instruction.Create(ldcI4, value),
                _ => Instruction.Create(ldcI4)
            });
コード例 #2
0
        public static Instruction LdcI4(int value)
        {
            var ldcI4 = OpCodeHelper.LdcI4(value);

            switch (ldcI4.Code)
            {
            case Code.Ldc_I4_S:
                return(Instruction.Create(ldcI4, (sbyte)value));

            case Code.Ldc_I4:
                return(Instruction.Create(ldcI4, value));

            default:
                return(Instruction.Create(ldcI4));
            }
        }