public static Instruction CreateLifted(Type type) { Debug.Assert(!type.IsEnum()); switch (type.GetTypeCode()) { case TypeCode.Int16: return(_Int16Lifted ?? (_Int16Lifted = new NegateOvfInt16Lifted())); case TypeCode.Int32: return(_Int32Lifted ?? (_Int32Lifted = new NegateOvfInt32Lifted())); case TypeCode.Int64: return(_Int64Lifted ?? (_Int64Lifted = new NegateOvfInt64Lifted())); case TypeCode.UInt16: return(_UInt16Lifted ?? (_UInt16Lifted = new NegateOvfUInt16Lifted())); case TypeCode.UInt32: return(_UInt32Lifted ?? (_UInt32Lifted = new NegateOvfUInt32Lifted())); case TypeCode.Single: return(_SingleLifted ?? (_SingleLifted = new NegateOvfSingleLifted())); case TypeCode.Double: return(_DoubleLifted ?? (_DoubleLifted = new NegateOvfDoubleLifted())); default: throw Assert.Unreachable; } }
public static Instruction CreateLifted(Type type) { Debug.Assert(!type.IsEnum()); switch (type.GetTypeCode()) { case TypeCode.Int16: return _Int16Lifted ?? (_Int16Lifted = new NegateOvfInt16Lifted()); case TypeCode.Int32: return _Int32Lifted ?? (_Int32Lifted = new NegateOvfInt32Lifted()); case TypeCode.Int64: return _Int64Lifted ?? (_Int64Lifted = new NegateOvfInt64Lifted()); case TypeCode.UInt16: return _UInt16Lifted ?? (_UInt16Lifted = new NegateOvfUInt16Lifted()); case TypeCode.UInt32: return _UInt32Lifted ?? (_UInt32Lifted = new NegateOvfUInt32Lifted()); case TypeCode.Single: return _SingleLifted ?? (_SingleLifted = new NegateOvfSingleLifted()); case TypeCode.Double: return _DoubleLifted ?? (_DoubleLifted = new NegateOvfDoubleLifted()); default: throw Assert.Unreachable; } }