78 references to ExprContext
Microsoft.CodeAnalysis.CSharp (78)
CodeGen\Optimizer.cs (78)
398private readonly ArrayBuilder<(BoundExpression, ExprContext)> _evalStack;
401private ExprContext _context;
419ArrayBuilder<ValueTuple<BoundExpression, ExprContext>> evalStack,
436var evalStack = ArrayBuilder<ValueTuple<BoundExpression, ExprContext>>.GetInstance();
452result = VisitExpression(expr, ExprContext.Value);
462private BoundExpression VisitExpressionCore(BoundExpression node, ExprContext context)
464var prevContext = _context;
478case ExprContext.Sideeffects:
482case ExprContext.AssignmentTarget:
485case ExprContext.Value:
486case ExprContext.Address:
487case ExprContext.Box:
499private BoundExpression VisitExpression(BoundExpression node, ExprContext context)
519private BoundExpression VisitExpressionCoreWithStackGuard(BoundExpression node, ExprContext context)
540private void PushEvalStack(BoundExpression result, ExprContext context)
542Debug.Assert(result != null || context == ExprContext.None);
575var prevContext = _context;
595var context = _context == ExprContext.Sideeffects && !node.ConversionHasSideEffects() ?
596ExprContext.Sideeffects :
597ExprContext.Value;
604var context = _context == ExprContext.Sideeffects ?
605ExprContext.Sideeffects :
606ExprContext.Value;
695if (_context == ExprContext.Sideeffects)
718var origContext = _context;
727var rewrittenSideeffect = this.VisitExpression(sideeffect, ExprContext.Sideeffects);
848this.VisitExpression(node.Expression, ExprContext.Sideeffects));
857case ExprContext.Address:
868case ExprContext.AssignmentTarget:
877case ExprContext.Sideeffects:
886case ExprContext.Value:
887case ExprContext.Box:
922ExprContext.Address :
923ExprContext.AssignmentTarget);
929Debug.Assert(_context != ExprContext.AssignmentTarget, "assignment expression cannot be a target of another assignment");
931ExprContext rhsContext;
932if (node.IsRef || _context == ExprContext.Address)
935rhsContext = ExprContext.Address;
939Debug.Assert(_context == ExprContext.Value ||
940_context == ExprContext.Box ||
941_context == ExprContext.Sideeffects, "assignment expression cannot be a target of another assignment");
943rhsContext = ExprContext.Value;
957PushEvalStack(null, ExprContext.None);
987(_context == ExprContext.Address || _context == ExprContext.Value))
1202ExprContext context = GetReceiverContext(receiver);
1228private static ExprContext GetReceiverContext(BoundExpression receiver)
1231ExprContext context;
1238context = ExprContext.Box;
1243context = ExprContext.Value;
1249context = ExprContext.Address;
1274ExprContext context = (argRefKind == RefKind.None) ? ExprContext.Value : ExprContext.Address;
1312var rewrittenOperand = VisitExpression(node.Operand, ExprContext.Address);
1330var oldContext = _context;
1331_context = ExprContext.Value;
1351receiver = VisitExpression(receiver, ExprContext.Box);
1358_context == ExprContext.AssignmentTarget ||
1359_context == ExprContext.Address ||
1362receiver = VisitExpression(receiver, ExprContext.Address);
1366receiver = VisitExpression(receiver, ExprContext.Value);
1454BoundExpression condition = this.VisitExpression(node.Condition, ExprContext.Value);
1458var context = node.IsRef ? ExprContext.Address : ExprContext.Value;
1501var prevContext = _context;
1537PushEvalStack(binary, ExprContext.Value);
1622PushEvalStack(null, ExprContext.None);
1658PushEvalStack(new BoundDefaultExpression(node.Syntax, node.Operand.Type), ExprContext.Value);
1693PushEvalStack(null, ExprContext.None);
1704exceptionSourceOpt = VisitExpression(exceptionSourceOpt, ExprContext.AssignmentTarget);
1769var rewrittenInitializer = this.VisitExpression(initializer, ExprContext.Value);
1791BoundExpression visitedOperand = this.VisitExpression(node.Operand, ExprContext.Address);
1935return top.Item2 == (local.RefKind == RefKind.None ? ExprContext.Value : ExprContext.Address) &&