Exemplo n.º 1
0
        public static Instruction CreateLifted(Type type)
        {
            Debug.Assert(!type.IsEnum());
            switch (type.GetTypeCode())
            {
            case TypeCode.Int16: return(_Int16Lifted ?? (_Int16Lifted = new XorInt16Lifted()));

            case TypeCode.Int32: return(_Int32Lifted ?? (_Int32Lifted = new XorInt32Lifted()));

            case TypeCode.Int64: return(_Int64Lifted ?? (_Int64Lifted = new XorInt64Lifted()));

            case TypeCode.UInt16: return(_UInt16Lifted ?? (_UInt16Lifted = new XorUInt16Lifted()));

            case TypeCode.UInt32: return(_UInt32Lifted ?? (_UInt32Lifted = new XorUInt32Lifted()));

            case TypeCode.UInt64: return(_UInt64Lifted ?? (_UInt64Lifted = new XorUInt64Lifted()));

            case TypeCode.Boolean: return(_BooleanLifted ?? (_BooleanLifted = new XorBooleanLifted()));

            default:
                throw Assert.Unreachable;
            }
        }
Exemplo n.º 2
0
        public static Instruction CreateLifted(Type type) {
            Debug.Assert(!type.IsEnum());
            switch (type.GetTypeCode()) {
                case TypeCode.Int16: return _Int16Lifted ?? (_Int16Lifted = new XorInt16Lifted());
                case TypeCode.Int32: return _Int32Lifted ?? (_Int32Lifted = new XorInt32Lifted());
                case TypeCode.Int64: return _Int64Lifted ?? (_Int64Lifted = new XorInt64Lifted());
                case TypeCode.UInt16: return _UInt16Lifted ?? (_UInt16Lifted = new XorUInt16Lifted());
                case TypeCode.UInt32: return _UInt32Lifted ?? (_UInt32Lifted = new XorUInt32Lifted());
                case TypeCode.UInt64: return _UInt64Lifted ?? (_UInt64Lifted = new XorUInt64Lifted());
                case TypeCode.Boolean: return _BooleanLifted ?? (_BooleanLifted = new XorBooleanLifted());

                default:
                    throw Assert.Unreachable;
            }
        }