예제 #1
0
        public static Instruction Create(Type type)
        {
            Debug.Assert(!type.IsEnum());
            switch (type.GetTypeCode())
            {
            case TypeCode.Int16: return(_Int16 ?? (_Int16 = new ShrInt16()));

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

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

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

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

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

            default:
                throw Assert.Unreachable;
            }
        }
예제 #2
0
        public static Instruction Create(Type type) {
            Debug.Assert(!type.IsEnum());
            switch (type.GetTypeCode()) {
                case TypeCode.Int16: return _Int16 ?? (_Int16 = new ShrInt16());
                case TypeCode.Int32: return _Int32 ?? (_Int32 = new ShrInt32());
                case TypeCode.Int64: return _Int64 ?? (_Int64 = new ShrInt64());
                case TypeCode.UInt16: return _UInt16 ?? (_UInt16 = new ShrUInt16());
                case TypeCode.UInt32: return _UInt32 ?? (_UInt32 = new ShrUInt32());
                case TypeCode.UInt64: return _UInt64 ?? (_UInt64 = new ShrUInt64());

                default:
                    throw Assert.Unreachable;
            }
        }