Example #1
0
 public ILLazyPrimitiveOperator(ILCoder coding, ILData left, DoubleOperators doubleOperator, ILData right, Type opResultType)
     : base(coding)
 {
     this._left      = left;
     this._right     = right;
     this._dOperator = doubleOperator;
     this._dOpType   = opResultType;
 }
Example #2
0
        internal static MethodInfo OpOverloads(Type declared, DoubleOperators doubleOperator, Type leftOperandType, Type rightOperandType)
        {
            string methodName = "";

            switch (doubleOperator)
            {
            case DoubleOperators.Add:
                methodName = "op_Addition";
                break;

            case DoubleOperators.Sub:
                methodName = "op_Subtraction";
                break;

            case DoubleOperators.Mul:
                methodName = "op_Multiply";
                break;

            case DoubleOperators.Div:
                methodName = "op_Division";
                break;

            case DoubleOperators.Rem:
                methodName = "op_Modulus";
                break;

            case DoubleOperators.And:
                methodName = "op_BitwiseAnd";
                break;

            case DoubleOperators.Or:
                methodName = "op_BitwiseOr";
                break;

            case DoubleOperators.Xor:
                methodName = "op_ExclusiveOr";
                break;

            case DoubleOperators.LShift:
                methodName = "op_LeftShift";
                break;

            case DoubleOperators.RShift:
                methodName = "op_RightShift";
                break;

            default:
                break;
            }
            return(declared.GetMethod(methodName, new Type[] { leftOperandType, rightOperandType }));
        }