public static Instruction Create(Type type) { Debug.Assert(!type.IsEnum); switch (Type.GetTypeCode(type.GetNonNullable())) { case TypeCode.Int16: return(_int16 ??= new NegateCheckedInt16()); case TypeCode.Int32: return(_int32 ??= new NegateCheckedInt32()); case TypeCode.Int64: return(_int64 ??= new NegateCheckedInt64()); default: return(NegateInstruction.Create(type)); } }
public void EmitNegate(Type type) { Emit(NegateInstruction.Create(type)); }