コード例 #1
0
        public static Instruction Create(Type type)
        {
            Debug.Assert(!type.GetTypeInfo().IsEnum);
            switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(type)))
            {
            case TypeCode.Int16: return(s_int16 ?? (s_int16 = new AddOvfInt16()));

            case TypeCode.Int32: return(s_int32 ?? (s_int32 = new AddOvfInt32()));

            case TypeCode.Int64: return(s_int64 ?? (s_int64 = new AddOvfInt64()));

            case TypeCode.UInt16: return(s_UInt16 ?? (s_UInt16 = new AddOvfUInt16()));

            case TypeCode.UInt32: return(s_UInt32 ?? (s_UInt32 = new AddOvfUInt32()));

            case TypeCode.UInt64: return(s_UInt64 ?? (s_UInt64 = new AddOvfUInt64()));

            case TypeCode.Single: return(s_single ?? (s_single = new AddOvfSingle()));

            case TypeCode.Double: return(s_double ?? (s_double = new AddOvfDouble()));

            default:
                throw Error.ExpressionNotSupportedForType("AddOvf", type);
            }
        }
コード例 #2
0
        public static Instruction Create(Type type)
        {
            Debug.Assert(!type.IsEnum());
            switch (type.GetTypeCode())
            {
            case TypeCode.Int16: return(_Int16 ?? (_Int16 = new AddOvfInt16()));

            case TypeCode.Int32: return(_Int32 ?? (_Int32 = new AddOvfInt32()));

            case TypeCode.Int64: return(_Int64 ?? (_Int64 = new AddOvfInt64()));

            case TypeCode.UInt16: return(_UInt16 ?? (_UInt16 = new AddOvfUInt16()));

            case TypeCode.UInt32: return(_UInt32 ?? (_UInt32 = new AddOvfUInt32()));

            case TypeCode.UInt64: return(_UInt64 ?? (_UInt64 = new AddOvfUInt64()));

            case TypeCode.Single: return(_Single ?? (_Single = new AddOvfSingle()));

            case TypeCode.Double: return(_Double ?? (_Double = new AddOvfDouble()));

            default:
                throw Assert.Unreachable;
            }
        }
コード例 #3
0
        public static Instruction Create(Type type)
        {
            Debug.Assert(!type.IsEnum);
            switch (type.GetNonNullableType().GetTypeCode())
            {
            case TypeCode.Int16:
                return(_int16 ?? (_int16 = new AddOvfInt16()));

            case TypeCode.Int32:
                return(_int32 ?? (_int32 = new AddOvfInt32()));

            case TypeCode.Int64:
                return(_int64 ?? (_int64 = new AddOvfInt64()));

            case TypeCode.UInt16:
                return(_uint16 ?? (_uint16 = new AddOvfUInt16()));

            case TypeCode.UInt32:
                return(_uint32 ?? (_uint32 = new AddOvfUInt32()));

            case TypeCode.UInt64:
                return(_uint64 ?? (_uint64 = new AddOvfUInt64()));

            case TypeCode.Single:
                return(_single ?? (_single = new AddOvfSingle()));

            case TypeCode.Double:
                return(_double ?? (_double = new AddOvfDouble()));

            default:
                throw Error.ExpressionNotSupportedForType("AddOvf", type);
            }
        }
コード例 #4
0
        public static Instruction Create(Type type)
        {
            Debug.Assert(TypeUtils.IsArithmetic(type));
            switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(type)))
            {
            case TypeCode.Int16: return(s_int16 ?? (s_int16 = new AddOvfInt16()));

            case TypeCode.Int32: return(s_int32 ?? (s_int32 = new AddOvfInt32()));

            case TypeCode.Int64: return(s_int64 ?? (s_int64 = new AddOvfInt64()));

            case TypeCode.UInt16: return(s_UInt16 ?? (s_UInt16 = new AddOvfUInt16()));

            case TypeCode.UInt32: return(s_UInt32 ?? (s_UInt32 = new AddOvfUInt32()));

            case TypeCode.UInt64: return(s_UInt64 ?? (s_UInt64 = new AddOvfUInt64()));

            default:
                return(AddInstruction.Create(type));
            }
        }
コード例 #5
0
ファイル: AddInstruction.cs プロジェクト: idanb55/corefx
        public static Instruction Create(Type type)
        {
            Debug.Assert(type.IsArithmetic());
            switch (type.GetNonNullableType().GetTypeCode())
            {
            case TypeCode.Int16: return(s_int16 ?? (s_int16 = new AddOvfInt16()));

            case TypeCode.Int32: return(s_int32 ?? (s_int32 = new AddOvfInt32()));

            case TypeCode.Int64: return(s_int64 ?? (s_int64 = new AddOvfInt64()));

            case TypeCode.UInt16: return(s_UInt16 ?? (s_UInt16 = new AddOvfUInt16()));

            case TypeCode.UInt32: return(s_UInt32 ?? (s_UInt32 = new AddOvfUInt32()));

            case TypeCode.UInt64: return(s_UInt64 ?? (s_UInt64 = new AddOvfUInt64()));

            default:
                return(AddInstruction.Create(type));
            }
        }
コード例 #6
0
ファイル: AddInstruction.cs プロジェクト: rajansingh10/corefx
        public static Instruction Create(Type type)
        {
            Debug.Assert(type.IsArithmetic());
            switch (type.GetNonNullableType().GetTypeCode())
            {
                case TypeCode.Int16: return s_int16 ?? (s_int16 = new AddOvfInt16());
                case TypeCode.Int32: return s_int32 ?? (s_int32 = new AddOvfInt32());
                case TypeCode.Int64: return s_int64 ?? (s_int64 = new AddOvfInt64());
                case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new AddOvfUInt16());
                case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new AddOvfUInt32());
                case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new AddOvfUInt64());

                default:
                    return AddInstruction.Create(type);
            }
        }
コード例 #7
0
ファイル: AddInstruction.cs プロジェクト: jschementi/iron
        public static Instruction Create(Type type) {
            Debug.Assert(!type.IsEnum);
            switch (Type.GetTypeCode(type)) {
                case TypeCode.Int16: return _Int16 ?? (_Int16 = new AddOvfInt16());
                case TypeCode.Int32: return _Int32 ?? (_Int32 = new AddOvfInt32());
                case TypeCode.Int64: return _Int64 ?? (_Int64 = new AddOvfInt64());
                case TypeCode.UInt16: return _UInt16 ?? (_UInt16 = new AddOvfUInt16());
                case TypeCode.UInt32: return _UInt32 ?? (_UInt32 = new AddOvfUInt32());
                case TypeCode.UInt64: return _UInt64 ?? (_UInt64 = new AddOvfUInt64());
                case TypeCode.Single: return _Single ?? (_Single = new AddOvfSingle());
                case TypeCode.Double: return _Double ?? (_Double = new AddOvfDouble());

                default:
                    throw Assert.Unreachable;
            }
        }
コード例 #8
0
ファイル: AddInstruction.cs プロジェクト: nnyamhon/corefx
        public static Instruction Create(Type type)
        {
            Debug.Assert(!type.GetTypeInfo().IsEnum);
            switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(type)))
            {
                case TypeCode.Int16: return s_int16 ?? (s_int16 = new AddOvfInt16());
                case TypeCode.Int32: return s_int32 ?? (s_int32 = new AddOvfInt32());
                case TypeCode.Int64: return s_int64 ?? (s_int64 = new AddOvfInt64());
                case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new AddOvfUInt16());
                case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new AddOvfUInt32());
                case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new AddOvfUInt64());
                case TypeCode.Single: return s_single ?? (s_single = new AddOvfSingle());
                case TypeCode.Double: return s_double ?? (s_double = new AddOvfDouble());

                default:
                    throw Error.ExpressionNotSupportedForType("AddOvf", type);
            }
        }
コード例 #9
0
ファイル: AddInstruction.cs プロジェクト: ChuangYang/corefx
        public static Instruction Create(Type type)
        {
            Debug.Assert(TypeUtils.IsArithmetic(type));
            switch (System.Dynamic.Utils.TypeExtensions.GetTypeCode(TypeUtils.GetNonNullableType(type)))
            {
                case TypeCode.Int16: return s_int16 ?? (s_int16 = new AddOvfInt16());
                case TypeCode.Int32: return s_int32 ?? (s_int32 = new AddOvfInt32());
                case TypeCode.Int64: return s_int64 ?? (s_int64 = new AddOvfInt64());
                case TypeCode.UInt16: return s_UInt16 ?? (s_UInt16 = new AddOvfUInt16());
                case TypeCode.UInt32: return s_UInt32 ?? (s_UInt32 = new AddOvfUInt32());
                case TypeCode.UInt64: return s_UInt64 ?? (s_UInt64 = new AddOvfUInt64());

                default:
                    return AddInstruction.Create(type);
            }
        }