Create() public static method

public static Create ( Type type ) : Instruction
type Type
return Instruction
Exemplo n.º 1
0
        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));
            }
        }
Exemplo n.º 2
0
 public void EmitNegate(Type type)
 {
     Emit(NegateInstruction.Create(type));
 }