Ejemplo n.º 1
0
        public bool IsLifted => false;         // TODO: implement lifted user-defined compound assignments

        public UserDefinedCompoundAssign(IMethod method, CompoundEvalMode evalMode,
                                         ILInstruction target, CompoundTargetKind targetKind, ILInstruction value)
            : base(OpCode.UserDefinedCompoundAssign, evalMode, target, targetKind, value)
        {
            this.Method = method;
            Debug.Assert(Method.IsOperator || IsStringConcat(method));
            Debug.Assert(evalMode == CompoundEvalMode.EvaluatesToNewValue || (Method.Name == "op_Increment" || Method.Name == "op_Decrement"));
        }
Ejemplo n.º 2
0
 public CompoundAssignmentInstruction(OpCode opCode, CompoundEvalMode evalMode, ILInstruction target, CompoundTargetKind targetKind, ILInstruction value)
     : base(opCode)
 {
     this.EvalMode   = evalMode;
     this.Target     = target;
     this.TargetKind = targetKind;
     this.Value      = value;
     CheckValidTarget();
 }
Ejemplo n.º 3
0
 public DynamicCompoundAssign(ExpressionType op, CSharpBinderFlags binderFlags,
                              ILInstruction target, CSharpArgumentInfo targetArgumentInfo,
                              ILInstruction value, CSharpArgumentInfo valueArgumentInfo,
                              CompoundTargetKind targetKind = CompoundTargetKind.Dynamic)
     : base(OpCode.DynamicCompoundAssign, CompoundEvalModeFromOperation(op), target, targetKind, value)
 {
     if (!IsExpressionTypeSupported(op))
     {
         throw new ArgumentOutOfRangeException("op");
     }
     this.BinderFlags        = binderFlags;
     this.Operation          = op;
     this.TargetArgumentInfo = targetArgumentInfo;
     this.ValueArgumentInfo  = valueArgumentInfo;
 }
Ejemplo n.º 4
0
 public NumericCompoundAssign(BinaryNumericInstruction binary, ILInstruction target,
                              CompoundTargetKind targetKind, ILInstruction value, IType type, CompoundEvalMode evalMode)
     : base(OpCode.NumericCompoundAssign, evalMode, target, targetKind, value)
 {
     Debug.Assert(IsBinaryCompatibleWithType(binary, type));
     this.CheckForOverflow     = binary.CheckForOverflow;
     this.Sign                 = binary.Sign;
     this.LeftInputType        = binary.LeftInputType;
     this.RightInputType       = binary.RightInputType;
     this.UnderlyingResultType = binary.UnderlyingResultType;
     this.Operator             = binary.Operator;
     this.IsLifted             = binary.IsLifted;
     this.type                 = type;
     this.AddILRange(binary);
     Debug.Assert(evalMode == CompoundEvalMode.EvaluatesToNewValue || (Operator == BinaryNumericOperator.Add || Operator == BinaryNumericOperator.Sub));
     Debug.Assert(this.ResultType == (IsLifted ? StackType.O : UnderlyingResultType));
 }