public override Expression Reduce()
{
if (CanReduce)
{
switch (Operand.NodeType)
{
case ExpressionType.Index:
return ReduceIndex();
case ExpressionType.MemberAccess:
return ReduceMember();
default:
Debug.Assert(Operand.NodeType == ExpressionType.Parameter);
return ReduceVariable();
}
}
return this;
}
protected override Expression VisitUnary(UnaryExpression node) { // NB: This reduces assignment operators so that the stack spiller doesn't have to worry about it. if (node.CanReduce) { return node.Reduce(); } return base.VisitUnary(node); }