Binder\Binder.ValueChecks.cs (99)
98internal BoundExpression Argument { get; }
114internal MixableDestination(ParameterSymbol parameter, BoundExpression argument)
123internal MixableDestination(BoundExpression argument, EscapeLevel escapeLevel)
152internal BoundExpression Argument { get; }
156internal EscapeArgument(ParameterSymbol? parameter, BoundExpression argument, RefKind refKind, bool isArgList = false)
164public void Deconstruct(out ParameterSymbol? parameter, out BoundExpression argument, out RefKind refKind)
188internal BoundExpression Argument { get; }
199internal EscapeValue(ParameterSymbol? parameter, BoundExpression argument, EscapeLevel escapeLevel, bool isRefEscape)
207public void Deconstruct(out ParameterSymbol? parameter, out BoundExpression argument, out EscapeLevel escapeLevel, out bool isRefEscape)
392var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(accessorForDefaultArguments.ParameterCount);
481private BoundExpression CheckValue(BoundExpression expr, BindValueKind valueKind, BindingDiagnosticBag diagnostics)
613var receiver = methodGroup.ReceiverOpt;
631receiver == null ? ImmutableArray<BoundExpression>.Empty : ImmutableArray.Create(receiver),
649internal static bool IsTypeOrValueExpression(BoundExpression expression)
674internal bool CheckValueKind(SyntaxNode node, BoundExpression expr, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics)
800var receiver = ((BoundPointerElementAccess)expr).Expression;
954bool checkArrayAccessValueKind(SyntaxNode node, BindValueKind valueKind, ImmutableArray<BoundExpression> indices, BindingDiagnosticBag diagnostics)
989private static bool CheckNotNamespaceOrType(BoundExpression expr, BindingDiagnosticBag diagnostics)
1274private bool CheckParameterRefEscape(SyntaxNode node, BoundExpression parameter, ParameterSymbol parameterSymbol, SafeContext escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics)
1543BoundExpression receiver = boundEvent.ReceiverOpt;
1605private bool CheckIsValidReceiverForVariable(SyntaxNode node, BoundExpression receiver, BindValueKind kind, BindingDiagnosticBag diagnostics)
1624private static bool RequiresVariableReceiver(BoundExpression receiver, Symbol symbol)
1676private bool CheckPropertyValueKind(SyntaxNode node, BoundExpression expr, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics)
1683BoundExpression receiver;
1857static bool isAllowedDespiteReadonly(BoundExpression receiver)
1868bool isAllowedInitOnlySet(BoundExpression receiver)
1899private bool IsBadBaseAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol member, BindingDiagnosticBag diagnostics,
1918BoundExpression expression,
1934var arguments = ArrayBuilder<BoundExpression>.GetInstance();
1959BoundExpression? receiver,
1962ImmutableArray<BoundExpression> argsOpt,
2048BoundExpression? receiver,
2051ImmutableArray<BoundExpression> argsOpt,
2113BoundExpression? receiver,
2116ImmutableArray<BoundExpression> argsOpt,
2206BoundExpression? receiver,
2209ImmutableArray<BoundExpression> argsOpt,
2279BoundExpression? receiver,
2282ImmutableArray<BoundExpression> argsOpt,
2317var argument = argsOpt[argIndex];
2364static bool isMixableArgument(BoundExpression argument)
2377static EscapeArgument getReceiver(in MethodInfo methodInfo, BoundExpression receiver)
2403static EscapeArgument getReceiverCore(MethodSymbol? method, BoundExpression receiver)
2429ImmutableArray<BoundExpression> argsOpt,
2436var argument = argsOpt[argIndex];
2456BoundExpression? receiver,
2459ImmutableArray<BoundExpression> argsOpt,
2526BoundExpression? receiver,
2529ImmutableArray<BoundExpression> argsOpt,
2581BoundExpression? receiver,
2584ImmutableArray<BoundExpression> argsOpt,
2657BoundExpression? receiver,
2660ImmutableArray<BoundExpression> argsOpt,
2739private bool ShouldInferDeclarationExpressionValEscape(BoundExpression argument, [NotNullWhen(true)] out SourceLocalSymbol? localSymbol)
2771BoundExpression? receiverOpt,
2774ImmutableArray<BoundExpression> argsOpt,
2871BoundExpression? receiverOpt,
2874ImmutableArray<BoundExpression> argsOpt,
2944foreach (var argument in argsOpt)
2956ImmutableArray<BoundExpression> argsOpt,
3294internal void ValidateEscape(BoundExpression expr, SafeContext escapeTo, bool isByRef, BindingDiagnosticBag diagnostics)
3317internal SafeContext GetRefEscape(BoundExpression expr, SafeContext scopeOfTheContainingExpression)
3537ImmutableArray<BoundExpression> arguments;
3625internal bool CheckRefEscape(SyntaxNode node, BoundExpression expr, SafeContext escapeFrom, SafeContext escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics)
3858ImmutableArray<BoundExpression> arguments;
3997foreach (var element in expr.Arguments)
4020internal SafeContext GetValEscape(BoundExpression expr, SafeContext scopeOfTheContainingExpression)
4225ImmutableArray<BoundExpression> arguments;
4338ImmutableArray<BoundExpression> arguments;
4563private SafeContext GetTupleValEscape(ImmutableArray<BoundExpression> elements, SafeContext scopeOfTheContainingExpression)
4566foreach (var element in elements)
4583foreach (var expr in initExpr.Initializers)
4592private SafeContext GetValEscapeOfObjectMemberInitializer(BoundExpression expr, SafeContext scopeOfTheContainingExpression)
4687private SafeContext GetValEscape(ImmutableArray<BoundExpression> expressions, SafeContext scopeOfTheContainingExpression)
4690foreach (var expression in expressions)
4703internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, SafeContext escapeFrom, SafeContext escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics)
4788BoundExpression underlyingReceiver = ((BoundCapturedReceiverPlaceholder)expr).Receiver;
4958ImmutableArray<BoundExpression> arguments;
5112ImmutableArray<BoundExpression> arguments;
5249var clauseValue = ((BoundQueryClause)expr).Value;
5253var variableValue = ((BoundRangeVariable)expr).Value;
5273var accessedExpression = ((BoundPointerElementAccess)expr).Expression;
5277var operandExpression = ((BoundPointerIndirectionOperator)expr).Operand;
5292var result = arm.Value;
5433private SignatureOnlyMethodSymbol GetInlineArrayAccessEquivalentSignatureMethod(BoundInlineArrayAccess elementAccess, out ImmutableArray<BoundExpression> arguments, out ImmutableArray<RefKind> refKinds)
5495private SignatureOnlyMethodSymbol GetInlineArrayConversionEquivalentSignatureMethod(BoundConversion conversion, out ImmutableArray<BoundExpression> arguments, out ImmutableArray<RefKind> refKinds)
5501private SignatureOnlyMethodSymbol GetInlineArrayConversionEquivalentSignatureMethod(BoundExpression inlineArray, TypeSymbol resultType, out ImmutableArray<BoundExpression> arguments, out ImmutableArray<RefKind> refKinds)
5535private bool CheckTupleValEscape(ImmutableArray<BoundExpression> elements, SafeContext escapeFrom, SafeContext escapeTo, BindingDiagnosticBag diagnostics)
5537foreach (var element in elements)
5552foreach (var expr in initExpr.Initializers)
5566private bool CheckValEscape(ImmutableArray<BoundExpression> expressions, SafeContext escapeFrom, SafeContext escapeTo, BindingDiagnosticBag diagnostics)
5568foreach (var expression in expressions)
5579private bool CheckInterpolatedStringHandlerConversionEscape(BoundExpression expression, SafeContext escapeFrom, SafeContext escapeTo, BindingDiagnosticBag diagnostics)
5600var arguments = ArrayBuilder<BoundExpression>.GetInstance();
5617private void GetInterpolatedStringHandlerArgumentsForEscape(BoundExpression expression, ArrayBuilder<BoundExpression> arguments)
5639foreach (var part in interpolatedString.Parts)
Binder\Binder.WithQueryLambdaParametersBinder.cs (5)
37protected override BoundExpression BindRangeVariable(SimpleNameSyntax node, RangeVariableSymbol qv, BindingDiagnosticBag diagnostics)
41BoundExpression translation;
72private BoundExpression SelectField(SimpleNameSyntax node, BoundExpression receiver, string name, BindingDiagnosticBag diagnostics)
99var result = BindMemberOfType(node, node, name, 0, indexed: false, receiver, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), lookupResult, BoundMethodGroupFlags.None, diagnostics);
Binder\Binder_Attributes.cs (12)
188ImmutableArray<BoundExpression> boundConstructorArguments;
522var rhs = BindRValueWithoutTargetType(namedArgument.Expression, diagnostics);
561BoundExpression namedArgumentValue = this.BindValue(namedArgument.Expression, diagnostics, BindValueKind.RValue);
566BoundExpression lvalue;
761public ImmutableArray<TypedConstant> VisitArguments(ImmutableArray<BoundExpression> arguments, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool parentHasErrors = false)
769foreach (var argument in arguments)
835private TypedConstant VisitExpression(BoundExpression node, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors)
845private TypedConstant VisitExpression(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors)
895return VisitExpression((BoundExpression)node, diagnostics, ref attrHasErrors, curArgumentHasErrors);
911var operand = node.Operand;
973ImmutableArray<BoundExpression> bounds = node.Bounds;
1012private static TypedConstant CreateTypedConstant(BoundExpression node, TypedConstantKind typedConstantKind, BindingDiagnosticBag diagnostics, ref bool attrHasErrors, bool curArgumentHasErrors,
Binder\Binder_Await.cs (20)
19private BoundExpression BindAwait(AwaitExpressionSyntax node, BindingDiagnosticBag diagnostics)
23BoundExpression expression = BindRValueWithoutTargetType(node.Expression, diagnostics);
28private BoundAwaitExpression BindAwait(BoundExpression expression, SyntaxNode node, BindingDiagnosticBag diagnostics)
51internal BoundAwaitableInfo BindAwaitInfo(BoundAwaitableValuePlaceholder placeholder, SyntaxNode node, BindingDiagnosticBag diagnostics, ref bool hasErrors, BoundExpression? expressionOpt = null)
57out BoundExpression? getAwaiter,
71private bool CouldBeAwaited(BoundExpression expression)
243BoundExpression expression,
244out BoundExpression? getAwaiterGetResultCall,
252BoundExpression expression,
253BoundExpression getAwaiterArgument,
255out BoundExpression? getAwaiter,
258out BoundExpression? getAwaiterGetResultCall,
295private static bool ValidateAwaitedExpression(BoundExpression expression, SyntaxNode node, BindingDiagnosticBag diagnostics)
323private bool GetGetAwaiterMethod(BoundExpression expression, SyntaxNode node, BindingDiagnosticBag diagnostics, [NotNullWhen(true)] out BoundExpression? getAwaiterCall)
333getAwaiterCall = MakeInvocationExpression(node, expression, WellKnownMemberNames.GetAwaiter, ImmutableArray<BoundExpression>.Empty, diagnostics);
372var qualified = BindInstanceMemberAccess(node, node, receiver, name, 0, default(SeparatedSyntaxList<TypeSyntax>), default(ImmutableArray<TypeWithAnnotations>), invoked: false, indexed: false, diagnostics);
435private bool GetGetResultMethod(BoundExpression awaiterExpression, SyntaxNode node, TypeSymbol awaitedExpressionType, BindingDiagnosticBag diagnostics, out MethodSymbol? getResultMethod, [NotNullWhen(true)] out BoundExpression? getAwaiterGetResultCall)
438getAwaiterGetResultCall = MakeInvocationExpression(node, awaiterExpression, WellKnownMemberNames.GetResult, ImmutableArray<BoundExpression>.Empty, diagnostics);
Binder\Binder_Conversions.cs (15)
20internal BoundExpression CreateConversion(
21BoundExpression source,
32internal BoundExpression CreateConversion(
33BoundExpression source,
41internal BoundExpression CreateConversion(
43BoundExpression source,
53protected BoundExpression CreateConversion(
55BoundExpression source,
65var result = createConversion(syntax, source, conversion, isCast, conversionGroupOpt, wasCompilerGenerated, destination, diagnostics, hasErrors);
78var result2 = createConversion(syntax, placeholder2, conversion, isCast, conversionGroupOpt, wasCompilerGenerated, destination, BindingDiagnosticBag.Discarded, hasErrors);
95BoundExpression createConversion(
97BoundExpression source,
300void reportUseSiteDiagnostics(SyntaxNode syntax, Conversion conversion, BoundExpression source, TypeSymbol destination, BindingDiagnosticBag diagnostics)
314void ensureAllUnderlyingConversionsChecked(SyntaxNode syntax, BoundExpression source, Conversion conversion, bool wasCompilerGenerated, TypeSymbol destination, BindingDiagnosticBag diagnostics)
407void checkConstraintLanguageVersionAndRuntimeSupportForConversion(SyntaxNode syntax, Conversion conversion, BoundExpression source, TypeSymbol destination, BindingDiagnosticBag diagnostics)
Binder\Binder_Deconstruct.cs (26)
29internal BoundExpression BindDeconstruction(AssignmentExpressionSyntax node, BindingDiagnosticBag diagnostics, bool resultIsUsedOverride = false)
99BoundExpression boundRight = rightPlaceholder ?? BindValue(right, deconstructionDiagnostics, BindValueKind.RValue);
115BoundExpression boundRHS,
208private BoundExpression FixTupleLiteral(ArrayBuilder<DeconstructionVariable> checkedVariables, BoundExpression boundRHS, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics)
277BoundExpression deconstructInvocation = MakeDeconstructInvocationExpression(variables.Count,
295var nestedConversions = ArrayBuilder<(BoundValuePlaceholder?, BoundExpression?)>.GetInstance(count);
367private BoundExpression SetInferredType(BoundExpression expression, TypeSymbol type, BindingDiagnosticBag diagnostics)
407BoundExpression errorLocal = ((DeconstructionVariablePendingInference)variable.Single).FailInference(this, diagnostics);
432internal readonly BoundExpression? Single;
436internal DeconstructionVariable(BoundExpression variable, SyntaxNode syntax)
480BoundExpression element = rhsLiteral.Arguments[i];
549var valuesBuilder = ArrayBuilder<BoundExpression>.GetInstance(count);
556BoundExpression value;
572ImmutableArray<BoundExpression> arguments = valuesBuilder.ToImmutableAndFree();
595private static string? ExtractDeconstructResultElementName(BoundExpression expression)
611private BoundExpression MakeDeconstructInvocationExpression(
613BoundExpression receiver,
652var memberAccess = BindInstanceMemberAccess(
670BoundExpression result = BindMethodGroupInvocation(
714private BoundBadExpression MissingDeconstruct(BoundExpression receiver, SyntaxNode rightSyntax, int numParameters, BindingDiagnosticBag diagnostics,
715out ImmutableArray<BoundDeconstructValuePlaceholder> outPlaceholders, BoundExpression childNode)
790var boundVariable = BindExpression(node, diagnostics, invoked: false, indexed: false);
791var checkedVariable = CheckValue(boundVariable, BindValueKind.Assignable, diagnostics);
864private BoundExpression BindDeconstructionVariable(
Binder\Binder_Expressions.cs (385)
25/// This portion of the binder converts an <see cref="ExpressionSyntax"/> into a <see cref="BoundExpression"/>.
114private BoundBadExpression BadExpression(SyntaxNode syntax, BoundExpression childNode)
122private BoundBadExpression BadExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> childNodes)
138protected BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind lookupResultKind, BoundExpression childNode)
151ImmutableArray<BoundExpression>.Empty,
159private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, BoundExpression childNode)
172private BoundBadExpression BadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol> symbols, ImmutableArray<BoundExpression> childNodes, bool wasCompilerGenerated = false)
194private BoundExpression ToBadExpression(BoundExpression expr, LookupResultKind resultKind = LookupResultKind.Empty)
236internal BoundExpression BindValue(ExpressionSyntax node, BindingDiagnosticBag diagnostics, BindValueKind valueKind)
238var result = this.BindExpression(node, diagnostics: diagnostics, invoked: false, indexed: false);
242internal BoundExpression BindRValueWithoutTargetType(ExpressionSyntax node, BindingDiagnosticBag diagnostics, bool reportNoTargetType = true)
251internal BoundExpression BindTypeOrRValue(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
253var valueOrType = BindExpression(node, diagnostics: diagnostics, invoked: false, indexed: false);
264internal BoundExpression BindToTypeForErrorRecovery(BoundExpression expression, TypeSymbol type = null)
268var result =
282internal BoundExpression BindToNaturalType(BoundExpression expression, BindingDiagnosticBag diagnostics, bool reportNoTargetType = true)
287BoundExpression result;
332var boundArgs = ArrayBuilder<BoundExpression>.GetInstance(sourceTuple.Arguments.Length);
333foreach (var arg in sourceTuple.Arguments)
409private BoundExpression BindToInferredDelegateType(BoundExpression expr, BindingDiagnosticBag diagnostics)
430internal BoundExpression BindValueAllowArgList(ExpressionSyntax node, BindingDiagnosticBag diagnostics, BindValueKind valueKind)
432var result = this.BindExpressionAllowArgList(node, diagnostics: diagnostics);
451BoundExpression result = initializerBinder.BindVariableOrAutoPropInitializerValue(initializerOpt, field.RefKind,
464internal BoundExpression BindVariableOrAutoPropInitializerValue(
478BoundExpression initializer = BindPossibleArrayInitializer(value, varType, valueKind, diagnostics);
497out BoundExpression valueBeforeConversion)
524var initializer = initializerBinder.BindValue(equalsValueSyntax.Value, diagnostics, BindValueKind.RValue);
529public BoundExpression BindExpression(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
534protected BoundExpression BindExpression(ExpressionSyntax node, BindingDiagnosticBag diagnostics, bool invoked, bool indexed)
536BoundExpression expr = BindExpressionInternal(node, diagnostics, invoked, indexed);
552protected BoundExpression BindExpressionAllowArgList(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
554BoundExpression expr = BindExpressionInternal(node, diagnostics, invoked: false, indexed: false);
559private void CheckContextForPointerTypes(ExpressionSyntax node, BindingDiagnosticBag diagnostics, BoundExpression expr)
572private BoundExpression BindExpressionInternal(ExpressionSyntax node, BindingDiagnosticBag diagnostics, bool invoked, bool indexed)
579BoundExpression result = bindExpressionInternal(node, diagnostics, invoked, indexed);
588BoundExpression bindExpressionInternal(ExpressionSyntax node, BindingDiagnosticBag diagnostics, bool invoked, bool indexed)
849private BoundExpression BindRefExpression(RefExpressionSyntax node, BindingDiagnosticBag diagnostics)
854node, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(BindToTypeForErrorRecovery(BindValue(node.Expression, BindingDiagnosticBag.Discarded, BindValueKind.RefersToLocation))),
858private BoundExpression BindRefType(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
865private BoundExpression BindScopedType(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
872private BoundExpression BindThrowExpression(ThrowExpressionSyntax node, BindingDiagnosticBag diagnostics)
883var thrownExpression = BindThrownExpression(node.Expression, diagnostics, ref hasErrors);
922private BoundExpression BindDeclarationExpressionAsError(DeclarationExpressionSyntax node, BindingDiagnosticBag diagnostics)
939private BoundExpression BindDeclarationVariablesForErrorRecovery(TypeWithAnnotations declTypeWithAnnotations, VariableDesignationSyntax node, CSharpSyntaxNode syntax, BindingDiagnosticBag diagnostics)
947var result = BindDeconstructionVariable(declTypeWithAnnotations, single, syntax, diagnostics);
958var builder = ArrayBuilder<BoundExpression>.GetInstance(count);
966ImmutableArray<BoundExpression> subExpressions = builder.ToImmutableAndFree();
995private BoundExpression BindTupleExpression(TupleExpressionSyntax node, BindingDiagnosticBag diagnostics)
1007ImmutableArray<BoundExpression>.Empty;
1014var boundArguments = ArrayBuilder<BoundExpression>.GetInstance(arguments.Count);
1036BoundExpression boundArgument = BindValue(argumentSyntax.Expression, diagnostics, BindValueKind.RValue);
1042ImmutableArray.Create<BoundExpression>(boundArgument), CreateErrorType("void"));
1212private BoundExpression BindRefValue(RefValueExpressionSyntax node, BindingDiagnosticBag diagnostics)
1217BoundExpression argument = BindValue(node.Expression, diagnostics, BindValueKind.RValue);
1237private BoundExpression BindMakeRef(MakeRefExpressionSyntax node, BindingDiagnosticBag diagnostics)
1240BoundExpression argument = this.BindValue(node.Expression, diagnostics, BindValueKind.RefOrOut);
1261private BoundExpression BindRefType(RefTypeExpressionSyntax node, BindingDiagnosticBag diagnostics)
1265BoundExpression argument = BindValue(node.Expression, diagnostics, BindValueKind.RValue);
1283private BoundExpression BindArgList(CSharpSyntaxNode node, BindingDiagnosticBag diagnostics)
1350private BoundExpression BindQualifiedName(QualifiedNameSyntax node, BindingDiagnosticBag diagnostics)
1355private BoundExpression BindParenthesizedExpression(ExpressionSyntax innerExpression, BindingDiagnosticBag diagnostics)
1357var result = BindExpression(innerExpression, diagnostics);
1367private BoundExpression BindTypeOf(TypeOfExpressionSyntax node, BindingDiagnosticBag diagnostics)
1422private BoundExpression BindSizeOf(SizeOfExpressionSyntax node, BindingDiagnosticBag diagnostics)
1438private BoundExpression BindFieldExpression(FieldExpressionSyntax node, BindingDiagnosticBag diagnostics)
1531private BoundExpression BindDefaultExpression(DefaultExpressionSyntax node, BindingDiagnosticBag diagnostics)
1544private BoundExpression BindIdentifier(
1577BoundExpression expression;
1611var receiver = SynthesizeMethodGroupReceiver(node, members);
1840private BoundExpression SynthesizeMethodGroupReceiver(CSharpSyntaxNode syntax, ArrayBuilder<Symbol> members)
1950private BoundExpression BindNonMethod(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics, LookupResultKind resultKind, bool indexed, bool isError)
2167BoundExpression receiver = SynthesizeReceiver(node, symbol, diagnostics);
2173BoundExpression receiver = SynthesizeReceiver(node, symbol, diagnostics);
2179BoundExpression receiver = SynthesizeReceiver(node, symbol, diagnostics);
2240protected virtual BoundExpression BindRangeVariable(SimpleNameSyntax node, RangeVariableSymbol qv, BindingDiagnosticBag diagnostics)
2245private BoundExpression SynthesizeReceiver(SyntaxNode node, Symbol member, BindingDiagnosticBag diagnostics)
2321private BoundExpression TryBindInteractiveReceiver(SyntaxNode syntax, NamedTypeSymbol memberDeclaringType)
2363public BoundExpression BindNamespaceOrTypeOrExpression(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
2389public BoundExpression BindLabel(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
2417public BoundExpression BindNamespaceOrType(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
2423public BoundExpression BindNamespaceAlias(IdentifierNameSyntax node, BindingDiagnosticBag diagnostics)
2429private static BoundExpression CreateBoundNamespaceOrTypeExpression(ExpressionSyntax node, Symbol symbol)
2537private BoundExpression BindCast(CastExpressionSyntax node, BindingDiagnosticBag diagnostics)
2539BoundExpression operand = this.BindValue(node.Expression, diagnostics, BindValueKind.RValue);
2555private BoundExpression BindFromEndIndexExpression(PrefixUnaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
2564BoundExpression boundOperand = BindValue(node.Operand, diagnostics, BindValueKind.RValue);
2592BoundExpression boundConversion = CreateConversion(boundOperand, conversion, intType, diagnostics);
2598private BoundExpression BindRangeExpression(RangeExpressionSyntax node, BindingDiagnosticBag diagnostics)
2644BoundExpression left = BindRangeExpressionOperand(node.LeftOperand, diagnostics);
2645BoundExpression right = BindRangeExpressionOperand(node.RightOperand, diagnostics);
2665private BoundExpression BindRangeExpressionOperand(ExpressionSyntax operand, BindingDiagnosticBag diagnostics)
2672BoundExpression boundOperand = BindValue(operand, diagnostics, BindValueKind.RValue);
2701private BoundExpression BindCastCore(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, bool wasCompilerGenerated, BindingDiagnosticBag diagnostics)
2723BoundExpression operand,
2848ImmutableArray<BoundExpression> tupleArguments,
2860var argument = tupleArguments[i];
2880private BoundExpression BindExplicitNullableCastFromNonNullable(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, BindingDiagnosticBag diagnostics)
2898var underlyingExpr = BindCastCore(node, operand, underlyingTargetTypeWithAnnotations, wasCompilerGenerated: false, diagnostics: bag);
2914var result = BindCastCore(node, operand, targetTypeWithAnnotations, wasCompilerGenerated: operand.WasCompilerGenerated, diagnostics: bag2);
3056BoundExpression boundArgument = BindArgumentValue(diagnostics, argumentSyntax, allowArglist, refKind);
3070var arg = result.Argument(0);
3087private BoundExpression BindArgumentValue(BindingDiagnosticBag diagnostics, ArgumentSyntax argumentSyntax, bool allowArglist, RefKind refKind)
3107private BoundExpression BindOutDeclarationArgument(DeclarationExpressionSyntax declarationExpression, BindingDiagnosticBag diagnostics)
3144private BoundExpression BindOutVariableDeclarationArgument(
3207BoundExpression receiver = SynthesizeReceiver(designation, expressionVariableField, diagnostics);
3284BoundExpression boundArgumentExpression,
3352private BoundExpression BindArgumentExpression(BindingDiagnosticBag diagnostics, ExpressionSyntax argumentExpression, RefKind refKind, bool allowArglist)
3361BoundExpression argument;
3380BoundExpression? receiver,
3388ArrayBuilder<BoundExpression>? paramsArgsBuilder = null;
3396BoundExpression argument = arguments[arg];
3502BoundExpression coerceArgument(
3504BoundExpression? receiver,
3506ArrayBuilder<BoundExpression>? argumentsForInterpolationConversion,
3507BoundExpression argument,
3514BoundExpression coercedArgument = argument;
3559static ArrayBuilder<BoundExpression> collectParamsArgs(
3562ArrayBuilder<BoundExpression> arguments,
3567var paramsArgsBuilder = ArrayBuilder<BoundExpression>.GetInstance();
3593BoundExpression? receiver,
3597ArrayBuilder<BoundExpression> paramsArgsBuilder,
3623ImmutableArray<BoundExpression> collectionArgs = paramsArgsBuilder.ToImmutableAndFree();
3626BoundExpression collection = CreateParamsCollection(node, parameters[paramsIndex], collectionArgs, diagnostics);
3666void reportUnsafeIfNeeded(MemberResolutionResult<TMember> methodResult, BindingDiagnosticBag diagnostics, BoundExpression argument, TypeWithAnnotations parameterTypeWithAnnotations)
3683BoundExpression bindInterpolatedStringHandlerInMemberCall(
3684BoundExpression unconvertedString,
3686ArrayBuilder<BoundExpression>? arguments,
3690BoundExpression? receiver,
3888var interpolatedString = BindUnconvertedInterpolatedExpressionToHandlerType(
3909private BoundExpression BindArrayCreationExpression(ArrayCreationExpressionSyntax node, BindingDiagnosticBag diagnostics)
3993ArrayBuilder<BoundExpression> sizes = ArrayBuilder<BoundExpression>.GetInstance();
3998var size = BindArrayDimension(arg, diagnostics, ref hasErrors);
4019var size = BindRValueWithoutTargetType(arg, diagnostics);
4028ImmutableArray<BoundExpression> arraySizes = sizes.ToImmutableAndFree();
4035private BoundExpression BindArrayDimension(ExpressionSyntax dimension, BindingDiagnosticBag diagnostics, ref bool hasErrors)
4040var size = BindValue(dimension, diagnostics, BindValueKind.RValue);
4060private BoundExpression BindImplicitArrayCreationExpression(ImplicitArrayCreationExpressionSyntax node, BindingDiagnosticBag diagnostics)
4068ImmutableArray<BoundExpression> boundInitializerExpressions = BindArrayInitializerExpressions(initializer, diagnostics, dimension: 1, rank: rank);
4089sizes: ImmutableArray<BoundExpression>.Empty, boundInitExprOpt: boundInitializerExpressions);
4092private BoundExpression BindImplicitStackAllocArrayCreationExpression(ImplicitStackAllocArrayCreationExpressionSyntax node, BindingDiagnosticBag diagnostics)
4095ImmutableArray<BoundExpression> boundInitializerExpressions = BindArrayInitializerExpressions(initializer, diagnostics, dimension: 1, rank: 1);
4127private ImmutableArray<BoundExpression> BindArrayInitializerExpressions(InitializerExpressionSyntax initializer, BindingDiagnosticBag diagnostics, int dimension, int rank)
4129var exprBuilder = ArrayBuilder<BoundExpression>.GetInstance();
4144private void BindArrayInitializerExpressions(InitializerExpressionSyntax initializer, ArrayBuilder<BoundExpression> exprBuilder, BindingDiagnosticBag diagnostics, int dimension, int rank)
4156var boundExpression = BindValue(expression, diagnostics, BindValueKind.RValue);
4173var boundExpression = BindValue(expression, diagnostics, BindValueKind.RValue);
4215ImmutableArray<BoundExpression> boundInitExpr,
4221ArrayBuilder<BoundExpression> initializers = ArrayBuilder<BoundExpression>.GetInstance();
4231BoundExpression boundExpression = boundInitExpr[boundInitExprIndex];
4234BoundExpression convertedExpression = GenerateConversionForAssignment(elemType, boundExpression, diagnostics);
4243BoundExpression init = null;
4296ImmutableArray<BoundExpression> boundInitExprOpt = default(ImmutableArray<BoundExpression>))
4363ImmutableArray<BoundExpression> sizes,
4364ImmutableArray<BoundExpression> boundInitExprOpt = default(ImmutableArray<BoundExpression>),
4391var size = sizes[i];
4416BoundExpression[] sizeArray = new BoundExpression[rank];
4442private BoundExpression BindStackAllocArrayCreationExpression(
4455ImmutableArray<BoundExpression>.Empty,
4478var builder = ArrayBuilder<BoundExpression>.GetInstance();
4499BoundExpression count = null;
4603private BoundExpression BindStackAllocWithInitializer(
4609BoundExpression sizeOpt,
4612ImmutableArray<BoundExpression> boundInitExprOpt = default)
4655private static int? GetIntegerConstantForArraySize(BoundExpression expression)
4676private static bool IsNegativeConstantForArraySize(BoundExpression expression)
4722internal BoundExpression BindConstructorInitializer(
4734var result = (argumentListBinder ?? this).BindConstructorInitializerCore(initializerArgumentListOpt, constructor, diagnostics);
4746private BoundExpression BindConstructorInitializerCore(
4907private BoundExpression BindConstructorInitializerCoreContinued(
4940BoundExpression receiver = ThisReference(nonNullSyntax, initializerType, wasCompilerGenerated: true);
5079private static (ParameterSymbol, SyntaxNode) TryGetPrimaryConstructorParameterUsedAsValue(SynthesizedPrimaryConstructor primaryConstructor, BoundExpression boundExpression)
5114private BoundExpression BindImplicitObjectCreationExpression(ImplicitObjectCreationExpressionSyntax node, BindingDiagnosticBag diagnostics)
5131protected BoundExpression BindObjectCreationExpression(ObjectCreationExpressionSyntax node, BindingDiagnosticBag diagnostics)
5133BoundExpression result = bindObjectCreationExpression(node, diagnostics);
5140BoundExpression bindObjectCreationExpression(ObjectCreationExpressionSyntax node, BindingDiagnosticBag diagnostics)
5193private BoundExpression BindCollectionExpression(CollectionExpressionSyntax syntax, BindingDiagnosticBag diagnostics, int nestingLevel = 0)
5200return new BoundBadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType());
5225var expression = @this.BindRValueWithoutTargetType(syntax.Expression, diagnostics);
5252var convertedExpression = @this.ConvertForEachCollection(expressionPlaceholder, conversion, collectionType, diagnostics);
5254BoundExpression? lengthOrCount;
5281private BoundExpression BindDelegateCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics)
5285var result = BindDelegateCreationExpression(node, type, analyzedArguments, node.Initializer, wasTargetTyped: false, diagnostics);
5290private BoundExpression BindDelegateCreationExpression(SyntaxNode node, NamedTypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped, BindingDiagnosticBag diagnostics)
5324BoundExpression argument = analyzedArguments.Arguments.Count >= 1 ? BindToNaturalType(analyzedArguments.Arguments[0], diagnostics) : null;
5459private BoundExpression BindClassCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, string typeName, BindingDiagnosticBag diagnostics, TypeSymbol initializerType = null)
5493private BoundExpression MakeConstructorInvocation(
5495ArrayBuilder<BoundExpression> arguments,
5514var creation = BindClassCreationExpression(node, type.Name, node, type, analyzedArguments, diagnostics);
5524internal BoundExpression BindObjectCreationForErrorRecovery(BoundUnconvertedObjectCreationExpression node, BindingDiagnosticBag diagnostics)
5527var result = MakeBadExpressionForObjectCreation(node.Syntax, CreateErrorType(), arguments, node.InitializerOpt, typeSyntax: node.Syntax, diagnostics);
5532private BoundExpression MakeBadExpressionForObjectCreation(ObjectCreationExpressionSyntax node, TypeSymbol type, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false)
5538private BoundExpression MakeBadExpressionForObjectCreation(SyntaxNode node, TypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax? initializerOpt, SyntaxNode? typeSyntax, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false)
5540var children = ArrayBuilder<BoundExpression>.GetInstance();
5588private BoundExpression BindInitializerExpressionOrValue(
5640var initializers = ArrayBuilder<BoundExpression>.GetInstance(initializerSyntax.Expressions.Count);
5646BoundExpression boundMemberInitializer = BindInitializerMemberAssignment(
5661private BoundExpression BindInitializerMemberAssignment(
5683BoundExpression boundLeft = objectInitializerMemberBinder.BindObjectInitializerMember(initializer, implicitReceiver, diagnostics);
5694BoundExpression boundRight = BindInitializerExpressionOrValue(
5717var boundNode = objectInitializerMemberBinder.BindObjectInitializerMemberMissingAssignment(identifierName, implicitReceiver, diagnostics);
5739var boundExpression = BindValue(memberInitializer, diagnostics, BindValueKind.RValue);
5745private BoundExpression BindObjectInitializerMember(
5761private BoundExpression BindObjectInitializerMemberMissingAssignment(
5771private BoundExpression BindObjectInitializerMemberCommon(
5778BoundExpression boundMember;
5860ImmutableArray<BoundExpression> arguments = ImmutableArray<BoundExpression>.Empty;
5912foreach (var argument in arguments)
6011private BoundExpression BadObjectInitializerMemberAccess(
6012BoundExpression boundMember,
6053private static void ReportDuplicateObjectMemberInitializers(BoundExpression boundMemberInitializer, HashSet<string> memberNameMap, BindingDiagnosticBag diagnostics)
6095ImmutableArray<BoundExpression> initializers,
6114foreach (var initializer in initializers)
6205var initializerBuilder = ArrayBuilder<BoundExpression>.GetInstance();
6230BoundExpression boundElementInitializer = BindCollectionInitializerElement(elementInitializer, initializerType,
6275private BoundExpression BindCollectionInitializerElement(
6305var boundElementInitializer = BindInitializerExpressionOrValue(elementInitializer, initializerType, BindValueKind.RValue, implicitReceiver.Syntax, diagnostics);
6307BoundExpression result = BindCollectionInitializerElementAddMethod(
6320private BoundExpression BindComplexElementInitializerExpression(
6331var exprBuilder = ArrayBuilder<BoundExpression>.GetInstance();
6352private BoundExpression BindUnexpectedComplexElementInitializer(InitializerExpressionSyntax node, BindingDiagnosticBag diagnostics)
6359private BoundExpression BindCollectionInitializerElementAddMethod(
6361ImmutableArray<BoundExpression> boundElementInitializerExpressions,
6392var result = bindCollectionInitializerElementAddMethod(elementInitializer, boundElementInitializerExpressions, collectionInitializerAddMethodBinder, diagnostics, implicitReceiver);
6411BoundExpression bindCollectionInitializerElementAddMethod(
6413ImmutableArray<BoundExpression> boundElementInitializerExpressions,
6439var addMethodInvocation = collectionInitializerAddMethodBinder.MakeInvocationExpression(
6535var addMethodInvocation = BindCollectionInitializerElementAddMethod(
6537ImmutableArray.Create((BoundExpression)addElementPlaceholder),
6613protected BoundExpression BindClassCreationExpression(
6631BoundExpression result = null;
6795private BoundExpression CreateBadClassCreationExpression(
6845var childNodes = ArrayBuilder<BoundExpression>.GetInstance();
6868private BoundExpression BindInterfaceCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics)
6872var result = BindInterfaceCreationExpression(node, type, diagnostics, node.Type, analyzedArguments, node.Initializer, wasTargetTyped: false);
6877private BoundExpression BindInterfaceCreationExpression(SyntaxNode node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped)
6903private BoundExpression BindComImportCoClassCreationExpression(SyntaxNode node, NamedTypeSymbol interfaceType, NamedTypeSymbol coClassType, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped)
6941var classCreation = BindClassCreationExpression(
6984private BoundExpression BindNoPiaObjectCreationExpression(
7026private BoundExpression BindTypeParameterCreationExpression(ObjectCreationExpressionSyntax node, TypeParameterSymbol typeParameter, BindingDiagnosticBag diagnostics)
7030var result = BindTypeParameterCreationExpression(node, typeParameter, analyzedArguments, node.Initializer, node.Type, wasTargetTyped: false, diagnostics);
7047private BoundExpression BindTypeParameterCreationExpression(
7358private BoundExpression BindCheckedExpression(CheckedExpressionSyntax node, BindingDiagnosticBag diagnostics)
7367private BoundExpression BindMemberAccess(
7376BoundExpression boundLeft;
7420private BoundExpression BindLeftOfPotentialColorColorMemberAccess(ExpressionSyntax left, BindingDiagnosticBag diagnostics)
7433private BoundExpression BindLeftIdentifierOfPotentialColorColorMemberAccess(IdentifierNameSyntax left, BindingDiagnosticBag diagnostics)
7448var boundValue = BindIdentifier(left, invoked: false, indexed: false, diagnostics: valueDiagnostics);
7478var boundType = BindNamespaceOrType(left, typeDiagnostics);
7530private BoundExpression BindDynamicMemberAccess(
7532BoundExpression boundLeft,
7589/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, string, TypeSyntax, TypeWithAnnotations, BindingDiagnosticBag, string)"/>.
7601private BoundExpression BindMemberAccessWithBoundLeft(
7603BoundExpression boundLeft,
7686BoundExpression result;
7751BoundExpression tryBindMemberAccessWithBoundNamespaceLeft(
7754BoundExpression boundLeft,
7823BoundExpression tryBindMemberAccessWithBoundTypeLeft(
7825BoundExpression boundLeft,
7875private void WarnOnAccessOfOffDefault(SyntaxNode node, BoundExpression boundLeft, BindingDiagnosticBag diagnostics)
7889private BoundExpression MakeMemberAccessValue(BoundExpression expr, BindingDiagnosticBag diagnostics)
7923private BoundExpression BindInstanceMemberAccess(
7926BoundExpression boundLeft,
7970BoundExpression colorColorValueReceiver = GetValueExpressionIfTypeOrValueReceiver(boundLeft);
8035BoundExpression boundLeft,
8111private BoundExpression BindMemberAccessBadResult(BoundMethodGroup node)
8121private BoundExpression BindMemberAccessBadResult(
8124BoundExpression boundLeft,
8163boundLeft == null ? ImmutableArray<BoundExpression>.Empty : ImmutableArray.Create(BindToTypeForErrorRecovery(boundLeft)),
8193private static void CombineExtensionMethodArguments(BoundExpression receiver, AnalyzedArguments originalArguments, AnalyzedArguments extensionMethodArguments)
8220private BoundExpression BindMemberOfType(
8226BoundExpression left,
8239BoundExpression result;
8304boundDimensionsOpt: ImmutableArray<BoundExpression>.Empty,
8343BoundExpression left,
8463BoundExpression left,
8513protected BoundExpression BindFieldAccess(
8515BoundExpression receiver,
8618BoundExpression expr = new BoundFieldAccess(node, receiver, fieldSymbol, constantValueOpt, resultKind, fieldType, hasErrors: (hasErrors || hasError));
8673private BoundExpression BindPropertyAccess(
8675BoundExpression? receiver,
8694private void CheckReceiverAndRuntimeSupportForSymbolAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol symbol, BindingDiagnosticBag diagnostics)
8753private BoundExpression BindEventAccess(
8755BoundExpression receiver,
8776private static bool? IsInstanceReceiver(BoundExpression receiver)
8801BoundExpression receiver,
8969private BoundExpression BindElementAccess(ElementAccessExpressionSyntax node, BindingDiagnosticBag diagnostics)
8971BoundExpression receiver = BindExpression(node.Expression, diagnostics: diagnostics, invoked: false, indexed: true);
8975private BoundExpression BindElementAccess(ExpressionSyntax node, BoundExpression receiver, BracketedArgumentListSyntax argumentList, bool allowInlineArrayElementAccess, BindingDiagnosticBag diagnostics)
9000private BoundExpression BindElementOrIndexerAccess(ExpressionSyntax node, BoundExpression expr, AnalyzedArguments analyzedArguments, bool allowInlineArrayElementAccess, BindingDiagnosticBag diagnostics)
9047BoundExpression result = BindElementAccessCore(node, expr, analyzedArguments, diagnosticsForBindElementAccessCore);
9066BoundExpression tryImplicitConversionToInlineArrayIndex(ExpressionSyntax node, BoundExpression index, BindingDiagnosticBag diagnostics, out WellKnownType indexOrRangeWellknownType)
9069BoundExpression convertedIndex = TryImplicitConversionToArrayIndex(index, SpecialType.System_Int32, node, diagnostics);
9092BoundExpression bindInlineArrayElementAccess(ExpressionSyntax node, BoundExpression expr, int length, AnalyzedArguments analyzedArguments, BoundExpression convertedIndex, WellKnownType indexOrRangeWellknownType, FieldSymbol elementField, BindingDiagnosticBag diagnostics)
9167if (rangeExpr.LeftOperandOpt is BoundExpression left)
9172if (rangeExpr.RightOperandOpt is BoundExpression right)
9217void checkInlineArrayBoundsForSystemIndex(BoundExpression convertedIndex, int length, bool excludeEnd, BindingDiagnosticBag diagnostics)
9229internal static int? InferConstantIndexFromSystemIndex(CSharpCompilation compilation, BoundExpression convertedIndex, int length, out SyntaxNode location)
9262private BoundExpression BadIndexerExpression(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, DiagnosticInfo errorOpt, BindingDiagnosticBag diagnostics)
9273private BoundExpression BindElementAccessCore(
9275BoundExpression expr,
9308private BoundExpression BindArrayAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics)
9343BoundExpression[] convertedArguments = new BoundExpression[arguments.Arguments.Count];
9347BoundExpression argument = arguments.Arguments[i];
9349BoundExpression index = ConvertToArrayIndex(argument, diagnostics, allowIndexAndRange: rank == 1, out indexOrRangeWellknownType);
9383indexerOrSliceAccess: new BoundArrayAccess(node, receiverPlaceholder, ImmutableArray<BoundExpression>.CastUp(argumentPlaceholders), resultType) { WasCompilerGenerated = true },
9391private BoundExpression ConvertToArrayIndex(BoundExpression index, BindingDiagnosticBag diagnostics, bool allowIndexAndRange, out WellKnownType indexOrRangeWellknownType)
9407var result =
9458private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, WellKnownType wellKnownType, SyntaxNode node, BindingDiagnosticBag diagnostics)
9469var result = TryImplicitConversionToArrayIndex(expr, type, node, attemptDiagnostics);
9479private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, SpecialType specialType, SyntaxNode node, BindingDiagnosticBag diagnostics)
9485var result = TryImplicitConversionToArrayIndex(expr, type, node, attemptDiagnostics);
9496private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, TypeSymbol targetType, SyntaxNode node, BindingDiagnosticBag diagnostics)
9514BoundExpression result = CreateConversion(expr.Syntax, expr, conversion, isCast: false, conversionGroupOpt: null, destination: targetType, diagnostics); // UNDONE: was cast?
9520private BoundExpression BindPointerElementAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics)
9542ArrayBuilder<BoundExpression> arguments = analyzedArguments.Arguments;
9559BoundExpression index = arguments[0];
9581private BoundExpression BindIndexerAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics)
9595BoundExpression indexerAccessExpression;
9651private BoundExpression BindIndexedPropertyAccess(BoundPropertyGroup propertyGroup, bool mustHaveAllOptionalParameters, BindingDiagnosticBag diagnostics)
9654var receiver = propertyGroup.ReceiverOpt;
9668ImmutableArray<BoundExpression>.Empty,
9675var result = BindIndexedPropertyAccess(syntax, receiver, properties, arguments, diagnostics);
9681private BoundExpression BindIndexedPropertyAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<PropertySymbol> propertyGroup, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics)
9688var result = BindIndexerOrIndexedPropertyAccess(syntax, receiver, properties, arguments, diagnostics);
9694private BoundExpression BindDynamicIndexer(
9696BoundExpression receiver,
9738private BoundExpression BindIndexerOrIndexedPropertyAccess(
9740BoundExpression receiver,
9778private BoundExpression BindIndexerOrIndexedPropertyAccessContinued(
9780BoundExpression receiver,
9786BoundExpression propertyAccess;
9825ImmutableArray<BoundExpression> arguments = BuildArgumentsForErrorRecovery(analyzedArguments, candidates);
9887BoundExpression receiver,
9921out var lengthOrCountAccess, out var indexerOrSliceAccess, out var argumentPlaceholders, diagnostics))
9974[NotNullWhen(true)] out BoundExpression? lengthOrCountAccess,
9975[NotNullWhen(true)] out BoundExpression? indexerOrSliceAccess,
10007[NotNullWhen(true)] out BoundExpression? indexerOrSliceAccess,
10109void makeCall(SyntaxNode syntax, BoundExpression receiver, MethodSymbol method,
10110out BoundExpression indexerOrSliceAccess, out ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders)
10144out BoundExpression lengthOrCountAccess,
10523var receiver = node.ReceiverOpt!;
10689var receiver = node.ReceiverOpt!;
10946BoundExpression receiver = BindConditionalAccessReceiver(node, diagnostics);
10949var access = conditionalAccessBinder.BindValue(node.WhenNotNull, diagnostics, BindValueKind.RValue);
11041private BoundConditionalAccess GenerateBadConditionalAccessNodeError(ConditionalAccessExpressionSyntax node, BoundExpression receiver, BoundExpression access, BindingDiagnosticBag diagnostics)
11050private BoundExpression BindMemberBindingExpression(MemberBindingExpressionSyntax node, bool invoked, bool indexed, BindingDiagnosticBag diagnostics)
11052BoundExpression receiver = GetReceiverForConditionalBinding(node, diagnostics);
11054var memberAccess = BindMemberAccessWithBoundLeft(node, receiver, node.Name, node.OperatorToken, invoked, indexed, diagnostics);
11058private BoundExpression BindElementBindingExpression(ElementBindingExpressionSyntax node, BindingDiagnosticBag diagnostics)
11060BoundExpression receiver = GetReceiverForConditionalBinding(node, diagnostics);
11062var memberAccess = BindElementAccess(node, receiver, node.ArgumentList, allowInlineArrayElementAccess: true, diagnostics);
11081private BoundExpression GetReceiverForConditionalBinding(ExpressionSyntax binding, BindingDiagnosticBag diagnostics)
11086BoundExpression receiver = this.ConditionalReceiverExpression;
11106private BoundExpression BindConditionalAccessReceiver(ConditionalAccessExpressionSyntax node, BindingDiagnosticBag diagnostics)
11109var receiver = BindRValueWithoutTargetType(receiverSyntax, diagnostics);
Binder\Binder_InterpolatedString.cs (58)
19private BoundExpression BindInterpolatedString(InterpolatedStringExpressionSyntax node, BindingDiagnosticBag diagnostics)
40var builder = ArrayBuilder<BoundExpression>.GetInstance();
90var value = BindValue(interpolation.Expression, diagnostics, BindValueKind.RValue);
97BoundExpression? alignment = null;
257ImmutableArray<BoundExpression> parts = BindInterpolatedStringPartsForFactory(unconvertedInterpolatedString, diagnostics, out bool haveErrors);
266BoundInterpolatedString constructWithoutData(ImmutableArray<BoundExpression> parts)
295bool canLowerToStringConcatenation(ImmutableArray<BoundExpression> parts)
297foreach (var part in parts)
317private ImmutableArray<BoundExpression> BindInterpolatedStringPartsForFactory(BoundUnconvertedInterpolatedString unconvertedInterpolatedString, BindingDiagnosticBag diagnostics, out bool haveErrors)
321ImmutableArray<BoundExpression> parts = BindInterpolatedStringParts(unconvertedInterpolatedString, partsDiagnostics);
333ImmutableArray<BoundExpression> parts,
340ImmutableArray<BoundExpression> expressions = makeInterpolatedStringFactoryArguments(syntax, parts, diagnostics);
342BoundExpression construction = MakeInvocationExpression(
370ImmutableArray<BoundExpression> makeInterpolatedStringFactoryArguments(SyntaxNode syntax, ImmutableArray<BoundExpression> parts, BindingDiagnosticBag diagnostics)
375var expressions = ArrayBuilder<BoundExpression>.GetInstance(n + 1);
380var part = parts[i];
396var value = fillin.Value;
435private static bool AllInterpolatedStringPartsAreStrings(ImmutableArray<BoundExpression> parts)
465var partsArrayBuilder = ArrayBuilder<ImmutableArray<BoundExpression>>.GetInstance();
469static (BoundUnconvertedInterpolatedString unconvertedInterpolatedString, ArrayBuilder<ImmutableArray<BoundExpression>> partsArrayBuilder) =>
515private BoundBinaryOperator UpdateBinaryOperatorWithInterpolatedContents(BoundBinaryOperator originalOperator, ImmutableArray<ImmutableArray<BoundExpression>> appendCalls, InterpolatedStringHandlerData data, SyntaxNode rootSyntax, BindingDiagnosticBag diagnostics)
519Func<BoundUnconvertedInterpolatedString, int, (ImmutableArray<ImmutableArray<BoundExpression>>, TypeSymbol), BoundExpression> interpolationFactory =
521Func<BoundBinaryOperator, BoundExpression, BoundExpression, (ImmutableArray<ImmutableArray<BoundExpression>>, TypeSymbol), BoundExpression> binaryOperatorFactory =
528static BoundInterpolatedString createInterpolation(BoundUnconvertedInterpolatedString expression, int i, (ImmutableArray<ImmutableArray<BoundExpression>> AppendCalls, TypeSymbol _) arg)
540static BoundBinaryOperator createBinaryOperator(BoundBinaryOperator original, BoundExpression left, BoundExpression right, (ImmutableArray<ImmutableArray<BoundExpression>> _, TypeSymbol @string) arg)
555private BoundExpression BindUnconvertedInterpolatedExpressionToHandlerType(
556BoundExpression unconvertedExpression,
610var partsArrayBuilder = ArrayBuilder<ImmutableArray<BoundExpression>>.GetInstance();
613static (BoundUnconvertedInterpolatedString unconvertedInterpolatedString, ArrayBuilder<ImmutableArray<BoundExpression>> partsArrayBuilder) =>
632private (ImmutableArray<ImmutableArray<BoundExpression>> AppendCalls, InterpolatedStringHandlerData Data) BindUnconvertedInterpolatedPartsToHandlerType(
634ImmutableArray<ImmutableArray<BoundExpression>> partsArray,
678foreach (var currentPart in parts)
682var value = insert.Value;
713var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(constructorArgumentLength);
730BoundExpression constructorCall;
732var outConstructorCall = MakeConstructorInvocation(interpolatedStringHandlerType, argumentsBuilder, refKindsBuilder, syntax, outConstructorDiagnostics);
744BoundExpression nonOutConstructorCall = MakeConstructorInvocation(interpolatedStringHandlerType, argumentsBuilder, refKindsBuilder, syntax, nonOutConstructorDiagnostics);
817static void populateArguments(SyntaxNode syntax, ImmutableArray<BoundInterpolatedStringArgumentPlaceholder> additionalConstructorArguments, int baseStringLength, int numFormatHoles, NamedTypeSymbol intType, ArrayBuilder<BoundExpression> argumentsBuilder)
850private ImmutableArray<BoundExpression> BindInterpolatedStringParts(BoundUnconvertedInterpolatedString unconvertedInterpolatedString, BindingDiagnosticBag diagnostics)
852ArrayBuilder<BoundExpression>? partsBuilder = null;
856var part = unconvertedInterpolatedString.Parts[i];
859BoundExpression newValue;
874partsBuilder = ArrayBuilder<BoundExpression>.GetInstance(unconvertedInterpolatedString.Parts.Length);
895private (ImmutableArray<ImmutableArray<BoundExpression>> AppendFormatCalls, bool UsesBoolReturn, ImmutableArray<ImmutableArray<(bool IsLiteral, bool HasAlignment, bool HasFormat)>>, int BaseStringLength, int NumFormatHoles) BindInterpolatedStringAppendCalls(
896ImmutableArray<ImmutableArray<BoundExpression>> partsArray,
902return (ImmutableArray<ImmutableArray<BoundExpression>>.Empty, false, ImmutableArray<ImmutableArray<(bool IsLiteral, bool HasAlignment, bool HasFormat)>>.Empty, 0, 0);
907var builderAppendCallsArray = ArrayBuilder<ImmutableArray<BoundExpression>>.GetInstance(partsArray.Length);
908var builderAppendCalls = ArrayBuilder<BoundExpression>.GetInstance(firstPartsLength);
911var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(3);
918foreach (var part in parts)
975var call = MakeInvocationExpression(part.Syntax, implicitBuilderReceiver, methodName, arguments, diagnostics, names: parameterNamesAndLocations, searchExtensionMethodsIfNecessary: false);
Binder\Binder_Invocation.cs (77)
20/// This portion of the binder converts an <see cref="ExpressionSyntax"/> into a <see cref="BoundExpression"/>.
24private BoundExpression BindMethodGroup(ExpressionSyntax node, bool invoked, bool indexed, BindingDiagnosticBag diagnostics)
77internal BoundExpression MakeInvocationExpression(
79BoundExpression receiver,
81ImmutableArray<BoundExpression> args,
104var boundExpression = BindInstanceMemberAccess(node, node, receiver, methodName, typeArgs.NullToEmpty().Length, typeArgsSyntax, typeArgs, invoked: true, indexed: false, diagnostics, searchExtensionMethodsIfNecessary);
139BoundExpression result = BindInvocationExpression(
158private static void ReportMakeInvocationExpressionBadMemberKind(SyntaxNode node, string methodName, BoundExpression boundExpression, BindingDiagnosticBag diagnostics)
182private BoundExpression BindInvocationExpression(
186BoundExpression result;
213BoundExpression boundExpression = BindMethodGroup(node.Expression, invoked: true, indexed: false, diagnostics: diagnostics);
236BoundExpression boundExpression = BindMethodGroup(node.Expression, invoked: true, indexed: false, diagnostics: diagnostics);
243BoundExpression bindArgumentsAndInvocation(InvocationExpressionSyntax node, BoundExpression boundExpression, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics)
264private BoundExpression BindArgListOperator(InvocationExpressionSyntax node, BindingDiagnosticBag diagnostics, AnalyzedArguments analyzedArguments)
272BoundExpression argument = analyzedArguments.Arguments[i];
312ImmutableArray<BoundExpression> arguments = analyzedArguments.Arguments.ToImmutable();
320private BoundExpression BindInvocationExpression(
324BoundExpression boundExpression,
339BoundExpression result;
390private BoundExpression BindDynamicInvocation(
392BoundExpression expression,
401BoundExpression? receiver;
449BoundExpression finalReceiver = ReplaceTypeOrValueReceiver(typeOrValue, useType, diagnostics);
479ImmutableArray<BoundExpression> argArray = BuildArgumentsForDynamicInvocation(arguments, diagnostics);
523private ImmutableArray<BoundExpression> BuildArgumentsForDynamicInvocation(AnalyzedArguments arguments, BindingDiagnosticBag diagnostics)
525var builder = ArrayBuilder<BoundExpression>.GetInstance(arguments.Arguments.Count);
544BoundExpression? receiver,
545ImmutableArray<BoundExpression> arguments,
573foreach (var arg in arguments)
620private BoundExpression BindDelegateInvocation(
624BoundExpression boundExpression,
630BoundExpression result;
689private BoundExpression BindMethodGroupInvocation(
709BoundExpression result = null;
856private bool IsAmbiguousDynamicParamsArgument<TMethodOrPropertySymbol>(ArrayBuilder<BoundExpression> arguments, MemberResolutionResult<TMethodOrPropertySymbol> candidate, out SyntaxNode argumentSyntax)
934private BoundExpression TryEarlyBindSingleCandidateInvocationWithDynamicArgument(
954BoundExpression result = BindInvocationExpressionContinued(
973BoundExpression receiverOpt,
1033private void CheckRestrictedTypeReceiver(BoundExpression expression, CSharpCompilation compilation, BindingDiagnosticBag diagnostics)
1195var receiver = ReplaceTypeOrValueReceiver(methodGroup.Receiver, !method.RequiresInstanceReceiver && !invokedAsExtensionMethod, diagnostics);
1214BoundExpression receiverArgument = analyzedArguments.Argument(0);
1321internal ThreeState ReceiverIsSubjectToCloning(BoundExpression? receiver, PropertySymbol property)
1334internal ThreeState ReceiverIsSubjectToCloning(BoundExpression? receiver, MethodSymbol method)
1363private BoundExpression GetDefaultParameterSpecialNoConversion(SyntaxNode syntax, ParameterSymbol parameter, BindingDiagnosticBag diagnostics)
1380BoundExpression? defaultValue = null;
1466ArrayBuilder<BoundExpression> argumentsBuilder,
1571BoundExpression collection = CreateParamsCollection(node, parameters[paramsIndex], collectionArgs: ImmutableArray<BoundExpression>.Empty, diagnostics);
1597BoundExpression bindDefaultArgument(SyntaxNode syntax, ParameterSymbol parameter, Symbol? containingMember, bool enableCallerInfo, BindingDiagnosticBag diagnostics, ArrayBuilder<BoundExpression> argumentsBuilder, int argumentsCount, ImmutableArray<int> argsToParamsOpt)
1624BoundExpression defaultValue;
1717private BoundExpression CreateParamsCollection(SyntaxNode node, ParameterSymbol paramsParameter, ImmutableArray<BoundExpression> collectionArgs, BindingDiagnosticBag diagnostics)
1720BoundExpression collection;
1725BoundExpression arraySize = new BoundLiteral(node, ConstantValue.Create(collectionArgs.Length), int32Type) { WasCompilerGenerated = true };
1780internal bool CheckImplicitThisCopyInReadOnlyMember(BoundExpression receiver, MethodSymbol method, BindingDiagnosticBag diagnostics)
1828private BoundExpression ReplaceTypeOrValueReceiver(BoundExpression receiver, bool useType, BindingDiagnosticBag diagnostics)
1866var value = q.Value;
1867var replaced = ReplaceTypeOrValueReceiver(value, useType, diagnostics);
1875private static BoundExpression GetValueExpressionIfTypeOrValueReceiver(BoundExpression receiver)
1899private static NamedTypeSymbol GetDelegateType(BoundExpression expr)
1915BoundExpression receiver,
1924ImmutableArray<BoundExpression> args;
1966private ImmutableArray<BoundExpression> BuildArgumentsForErrorRecovery(AnalyzedArguments analyzedArguments, ImmutableArray<MethodSymbol> methods)
1986private ImmutableArray<BoundExpression> BuildArgumentsForErrorRecovery(AnalyzedArguments analyzedArguments, ImmutableArray<PropertySymbol> properties)
2006private ImmutableArray<BoundExpression> BuildArgumentsForErrorRecovery(AnalyzedArguments analyzedArguments, IEnumerable<ImmutableArray<ParameterSymbol>> parameterListList)
2009ArrayBuilder<BoundExpression> newArguments = ArrayBuilder<BoundExpression>.GetInstance(argumentCount);
2161private ImmutableArray<BoundExpression> BuildArgumentsForErrorRecovery(AnalyzedArguments analyzedArguments)
2168BoundExpression expr,
2204private bool TryBindNameofOperator(InvocationExpressionSyntax node, BindingDiagnosticBag diagnostics, out BoundExpression result)
2220private BoundExpression BindNameofOperatorInternal(InvocationExpressionSyntax node, BindingDiagnosticBag diagnostics)
2224var boundArgument = BindExpression(argument, diagnostics);
2342private BoundFunctionPointerInvocation BindFunctionPointerInvocation(SyntaxNode node, BoundExpression boundExpression, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics)
Binder\Binder_Operators.cs (123)
21private BoundExpression BindCompoundAssignment(AssignmentExpressionSyntax node, BindingDiagnosticBag diagnostics)
25BoundExpression left = BindValue(node.Left, diagnostics, GetBinaryAssignmentKind(node.Kind()));
27BoundExpression right = BindValue(node.Right, diagnostics, BindValueKind.RValue);
193BoundExpression rightConverted = CreateConversion(right, best.RightConversion, bestSignature.RightType, diagnostics);
201BoundExpression finalConversion = GenerateConversionForAssignment(leftType, finalPlaceholder, diagnostics,
244var leftConversion = CreateConversion(node.Left, leftPlaceholder, best.LeftConversion, isCast: false, conversionGroupOpt: null, best.Signature.LeftType, diagnostics);
258private BoundExpression BindEventAssignment(AssignmentExpressionSyntax node, BoundEventAccess left, BoundExpression right, BinaryOperatorKind opKind, BindingDiagnosticBag diagnostics)
265BoundExpression receiverOpt = left.ReceiverOpt;
281BoundExpression argument = CreateConversion(right, argumentConversion, delegateType, diagnostics);
343private static bool IsLegalDynamicOperand(BoundExpression operand)
366private BoundExpression BindDynamicBinaryOperator(
369BoundExpression left,
370BoundExpression right,
450private BoundExpression BindSimpleBinaryOperator(BinaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
469BoundExpression result = BindExpression(current, diagnostics);
495BoundExpression left = CheckValue(result, bindValueKind, diagnostics);
496BoundExpression right = BindValue(syntaxNode.Right, diagnostics, BindValueKind.RValue);
497BoundExpression boundOp = BindSimpleBinaryOperator(syntaxNode, diagnostics, left, right, leaveUnconvertedIfInterpolatedString: true);
505private BoundExpression BindSimpleBinaryOperator(BinaryExpressionSyntax node, BindingDiagnosticBag diagnostics,
506BoundExpression left, BoundExpression right, bool leaveUnconvertedIfInterpolatedString)
631BoundExpression resultLeft = left;
632BoundExpression resultRight = right;
698private bool BindSimpleBinaryOperatorParts(BinaryExpressionSyntax node, BindingDiagnosticBag diagnostics, BoundExpression left, BoundExpression right, BinaryOperatorKind kind,
755private BoundExpression RebindSimpleBinaryOperatorAsConverted(BoundBinaryOperator unconvertedBinaryOperator, BindingDiagnosticBag diagnostics)
762var result = doRebind(diagnostics, unconvertedBinaryOperator);
765BoundExpression doRebind(BindingDiagnosticBag diagnostics, BoundBinaryOperator? current)
777BoundExpression? left = null;
797private static void ReportUnaryOperatorError(CSharpSyntaxNode node, BindingDiagnosticBag diagnostics, string operatorName, BoundExpression operand, LookupResultKind resultKind)
812private void ReportAssignmentOperatorError(AssignmentExpressionSyntax node, BinaryOperatorKind kind, BindingDiagnosticBag diagnostics, BoundExpression left, BoundExpression right, LookupResultKind resultKind)
831private void ReportBinaryOperatorError(ExpressionSyntax node, BindingDiagnosticBag diagnostics, SyntaxToken operatorToken, BoundExpression left, BoundExpression right, LookupResultKind resultKind)
889private BoundExpression BindConditionalLogicalOperator(BinaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
912BoundExpression left = BindRValueWithoutTargetType(child, diagnostics);
917BoundExpression right = BindRValueWithoutTargetType(binary.Right, diagnostics);
926private BoundExpression BindConditionalLogicalOperator(BinaryExpressionSyntax node, BoundExpression left, BoundExpression right, BindingDiagnosticBag diagnostics)
998var resultLeft = CreateConversion(left, best.LeftConversion, signature.LeftType, diagnostics);
999var resultRight = CreateConversion(right, best.RightConversion, signature.RightType, diagnostics);
1051private bool IsValidDynamicCondition(BoundExpression left, bool isNegative, BindingDiagnosticBag diagnostics, out MethodSymbol userDefinedOperator)
1309BoundExpression left,
1310BoundExpression right,
1386private bool IsTypelessExpressionAllowedInBinaryOperator(BinaryOperatorKind kind, BoundExpression left, BoundExpression right)
1410BoundExpression operand,
1660internal static TypeSymbol GetEnumType(BinaryOperatorKind kind, BoundExpression left, BoundExpression right)
1710BoundExpression left,
1711BoundExpression right,
1728BoundExpression newLeftOperand = CreateConversion(left, underlyingType, diagnostics);
1729BoundExpression newRightOperand = CreateConversion(right, underlyingType, diagnostics);
1785BoundExpression left,
1786BoundExpression right,
1939private static ConstantValue? TryFoldingNullableEquality(BinaryOperatorKind kind, BoundExpression left, BoundExpression right)
2260private BoundExpression BindIncrementOperator(CSharpSyntaxNode node, ExpressionSyntax operandSyntax, SyntaxToken operatorToken, BindingDiagnosticBag diagnostics)
2264BoundExpression operand = BindToNaturalType(BindValue(operandSyntax, diagnostics, BindValueKind.IncrementDecrement), diagnostics);
2337BoundExpression resultConversion = GenerateConversionForAssignment(operandType, resultPlaceholder, diagnostics, ConversionForAssignmentFlags.IncrementAssignment);
2358var operandConversion = CreateConversion(node, operandPlaceholder, best.Conversion, isCast: false, conversionGroupOpt: null, best.Signature.OperandType, diagnostics);
2439private BoundExpression BindSuppressNullableWarningExpression(PostfixUnaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
2443var expr = BindExpression(node.Operand, diagnostics);
2463private BoundExpression BindPointerIndirectionExpression(PrefixUnaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
2465BoundExpression operand = BindToNaturalType(BindValue(node.Operand, diagnostics, GetUnaryAssignmentKind(node.Kind())), diagnostics);
2474private static void BindPointerIndirectionExpressionInternal(CSharpSyntaxNode node, BoundExpression operand, BindingDiagnosticBag diagnostics, out TypeSymbol pointedAtType, out bool hasErrors)
2510private BoundExpression BindAddressOfExpression(PrefixUnaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
2512BoundExpression operand = BindToNaturalType(BindValue(node.Operand, diagnostics, BindValueKind.AddressOf), diagnostics);
2562internal bool IsMoveableVariable(BoundExpression expr, out Symbol accessedLocalOrParameterOpt)
2575BoundExpression receiver;
2688BoundExpression underlyingExpr = ((BoundPointerElementAccess)expr).Expression;
2707private BoundExpression BindUnaryOperator(PrefixUnaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
2709BoundExpression operand = BindToNaturalType(BindValue(node.Operand, diagnostics, GetUnaryAssignmentKind(node.Kind())), diagnostics);
2714private void ReportSuppressionIfNeeded(BoundExpression expr, BindingDiagnosticBag diagnostics)
2723private BoundExpression BindUnaryOperatorCore(CSharpSyntaxNode node, string operatorText, BoundExpression operand, BindingDiagnosticBag diagnostics)
2788var resultOperand = CreateConversion(operand.Syntax, operand, best.Conversion, isCast: false, conversionGroupOpt: null, signature.OperandType, diagnostics);
2810BoundExpression operand,
2815BoundExpression newOperand = CreateConversion(operand, underlyingType, diagnostics);
2845BoundExpression operand,
3066private BoundLiteral BindIntegralMinValConstants(PrefixUnaryExpressionSyntax node, BoundExpression operand, BindingDiagnosticBag diagnostics)
3155private bool IsOperandErrors(CSharpSyntaxNode node, ref BoundExpression operand, BindingDiagnosticBag diagnostics)
3217private BoundExpression BindIsOperator(BinaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
3220var operand = BindRValueWithoutTargetType(node.Left, diagnostics);
3242var convertedExpression = BindExpressionForPattern(operand.Type, node.Right, ref hasErrors, isPatternDiagnostics, out var constantValueOpt, out var wasExpression, out _);
3688private BoundExpression BindAsOperator(BinaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
3690var operand = BindRValueWithoutTargetType(node.Left, diagnostics);
3775BoundExpression operandConversion;
3970private BoundExpression GenerateNullCoalescingBadBinaryOpsError(BinaryExpressionSyntax node, BoundExpression leftOperand, BoundExpression rightOperand, BindingDiagnosticBag diagnostics)
3980private BoundExpression BindNullCoalescingOperator(BinaryExpressionSyntax node, BindingDiagnosticBag diagnostics)
3982var leftOperand = BindValue(node.Left, diagnostics, BindValueKind.RValue);
3984var rightOperand = BindValue(node.Right, diagnostics, BindValueKind.RValue);
4050var leftConversion = CreateConversion(node, leftPlaceholder,
4072var convertedRightOperand = CreateConversion(rightOperand, rightConversion, optLeftType0, diagnostics);
4088var convertedRightOperand = CreateConversion(rightOperand, rightConversion, optLeftType, diagnostics);
4140var leftConversion = CreateConversion(node, leftPlaceholder, leftConversionClassification, isCast: false, conversionGroupOpt: null, optRightType, diagnostics);
4154var leftConversion = CreateConversion(node, leftPlaceholder, leftConversionClassification, isCast: false, conversionGroupOpt: null, optRightType, diagnostics);
4167private BoundExpression BindNullCoalescingAssignmentOperator(AssignmentExpressionSyntax node, BindingDiagnosticBag diagnostics)
4171BoundExpression leftOperand = BindValue(node.Left, diagnostics, BindValueKind.CompoundAssignment);
4173BoundExpression rightOperand = BindValue(node.Right, diagnostics, BindValueKind.RValue);
4206var convertedRightOperand = CreateConversion(rightOperand, underlyingRightConversion, underlyingLeftType, diagnostics);
4220var convertedRightOperand = CreateConversion(rightOperand, rightConversion, leftType, diagnostics);
4228private BoundExpression GenerateNullCoalescingAssignmentBadBinaryOpsError(AssignmentExpressionSyntax node, BoundExpression leftOperand, BoundExpression rightOperand, BindingDiagnosticBag diagnostics)
4270private BoundExpression BindConditionalOperator(ConditionalExpressionSyntax node, BindingDiagnosticBag diagnostics)
4297private BoundExpression BindValueConditionalOperator(ConditionalExpressionSyntax node, ExpressionSyntax whenTrue, ExpressionSyntax whenFalse, BindingDiagnosticBag diagnostics)
4299BoundExpression condition = BindBooleanExpression(node.Condition, diagnostics);
4300BoundExpression trueExpr = BindValue(whenTrue, diagnostics, BindValueKind.RValue);
4301BoundExpression falseExpr = BindValue(whenFalse, diagnostics, BindValueKind.RValue);
4338private BoundExpression BindRefConditionalOperator(ConditionalExpressionSyntax node, ExpressionSyntax whenTrue, ExpressionSyntax whenFalse, BindingDiagnosticBag diagnostics)
4340BoundExpression condition = BindBooleanExpression(node.Condition, diagnostics);
4341BoundExpression trueExpr = BindValue(whenTrue, diagnostics, BindValueKind.RValue | BindValueKind.RefersToLocation);
4342BoundExpression falseExpr = BindValue(whenFalse, diagnostics, BindValueKind.RValue | BindValueKind.RefersToLocation);
4375private void ValidateRefConditionalOperator(SyntaxNode node, BoundExpression trueExpr, BoundExpression falseExpr, BindingDiagnosticBag diagnostics)
4401private static ConstantValue FoldConditionalOperator(BoundExpression condition, BoundExpression trueExpr, BoundExpression falseExpr)
Binder\Binder_Patterns.cs (36)
18private BoundExpression BindIsPatternExpression(IsPatternExpressionSyntax node, BindingDiagnosticBag diagnostics)
22BoundExpression expression = BindRValueWithoutTargetType(node.Expression, diagnostics);
45private BoundExpression MakeIsPatternExpression(
47BoundExpression expression,
143private BoundExpression BindSwitchExpression(SwitchExpressionSyntax node, BindingDiagnosticBag diagnostics)
154internal virtual BoundExpression BindSwitchExpressionCore(
215BoundExpression? indexerAccess = null;
298BoundExpression? indexerAccess;
299BoundExpression? lengthAccess;
334out Symbol? variableSymbol, out BoundExpression? variableAccess);
349indexerAccess: out _, out var lengthAccess, receiverPlaceholder: out _, argumentPlaceholder: out _);
355out BoundExpression indexerAccess, out BoundExpression lengthAccess, out BoundListPatternReceiverPlaceholder? receiverPlaceholder, out BoundListPatternIndexPlaceholder argumentPlaceholder)
370lengthAccess = new BoundBadExpression(node, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType(), hasErrors: true) { WasCompilerGenerated = true };
424var convertedExpression = BindExpressionOrTypeForPattern(inputType, innerExpression, ref hasErrors, diagnostics, out var constantValueOpt, out bool wasExpression, out Conversion patternConversion);
497private BoundExpression BindExpressionOrTypeForPattern(
507BoundExpression expression = BindTypeOrRValue(patternExpression, diagnostics);
525private BoundExpression BindExpressionForPattern(
535var expression = BindExpression(patternExpression, diagnostics: diagnostics, invoked: false, indexed: false);
542private BoundExpression BindExpressionForPatternContinued(
543BoundExpression expression,
551BoundExpression convertedExpression = ConvertPatternExpression(
587internal BoundExpression ConvertPatternExpression(
590BoundExpression expression,
596BoundExpression convertedExpression;
689BoundExpression operand = conversion.Operand;
847hasErrors: ref hasErrors, variableSymbol: out Symbol? variableSymbol, variableAccess: out BoundExpression? variableAccess);
873out BoundExpression? variableAccess)
909BoundExpression receiver = SynthesizeReceiver(designation, expressionVariableField, diagnostics);
1000BoundExpression deconstruct = MakeDeconstructInvocationExpression(
1034ref hasErrors, out Symbol? variableSymbol, out BoundExpression? variableAccess);
1051BoundExpression deconstruct,
1361variableSymbol: out Symbol? variableSymbol, variableAccess: out BoundExpression? variableAccess);
1396BoundExpression deconstruct = MakeDeconstructInvocationExpression(
1549BoundExpression boundMember = BindInstanceMemberAccess(
1631BoundExpression value = BindExpressionForPattern(inputType, node.Expression, ref hasErrors, diagnostics, out var constantValueOpt, out _, out Conversion patternConversion);
Binder\Binder_Query.cs (52)
24internal BoundExpression BindQuery(QueryExpressionSyntax node, BindingDiagnosticBag diagnostics)
29var boundFromExpression = BindLeftOfPotentialColorColorMemberAccess(fromClause.Expression, diagnostics);
53BoundExpression? cast = null;
69BoundExpression result = BindQueryInternal1(state, diagnostics);
165private BoundExpression BindQueryInternal1(QueryTranslationState state, BindingDiagnosticBag diagnostics)
184private BoundExpression BindQueryInternal2(QueryTranslationState state, BindingDiagnosticBag diagnostics)
201var result = state.fromExpression;
204BoundExpression? unoptimized = FinalTranslation(state, BindingDiagnosticBag.Discarded);
217private BoundExpression FinalTranslation(QueryTranslationState state, BindingDiagnosticBag diagnostics)
230var e = state.fromExpression;
253var e = state.fromExpression;
262BoundExpression lambdaRight = MakeQueryUnboundLambda(state.RangeVariableMap(), x, v, diagnostics.AccumulatesDependencies);
274BoundExpression? unoptimizedForm = null;
315var arguments = ArrayBuilder<BoundExpression>.GetInstance();
380var inExpression = BindRValueWithoutTargetType(join.InExpression, diagnostics);
390BoundExpression? castInvocation = null;
587BoundExpression collectionSelectorLambda;
626BoundExpression? castInvocation = (from.Type != null) ? ExtractCastInvocation(invocation) : null;
672BoundExpression? castInvocation = (from.Type != null) ? ExtractCastInvocation(invocation) : null;
677private static BoundExpression? ExtractCastInvocation(BoundCall invocation)
695var construction = MakePair(node, x1.Name, x1Expression, x2.Name, x2Expression, state, d);
731var yExpression = lambdaBodyBinder.BindRValueWithoutTargetType(let.Expression, d);
745var construction = MakePair(let, x.Name, xExpression, let.Identifier.ValueText, yExpression, state, d);
768private BoundBlock CreateLambdaBlockForQueryClause(ExpressionSyntax expression, BoundExpression result, BindingDiagnosticBag diagnostics)
781BoundExpression expression,
783BoundExpression? queryInvocation = null,
784BoundExpression? castInvocation = null,
785BoundExpression? unoptimizedForm = null)
797private BoundExpression MakePair(CSharpSyntaxNode node, string field1Name, BoundExpression field1Value, string field2Name, BoundExpression field2Value, QueryTranslationState state, BindingDiagnosticBag diagnostics)
817AnonymousTypeField createField(string fieldName, BoundExpression fieldValue) =>
821private TypeSymbol TypeOrError(BoundExpression e)
837BoundExpression boundExpression = lambdaBodyBinder.BindValue(expression, diagnostics, BindValueKind.RValue);
847BoundExpression boundExpression = lambdaBodyBinder.BindValue(expression, diagnostics, BindValueKind.RValue);
874protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, BoundExpression arg, BindingDiagnosticBag diagnostics
887protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
900protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, TypeSyntax typeArgSyntax, TypeWithAnnotations typeArg, BindingDiagnosticBag diagnostics
906return MakeQueryInvocation(node, receiver, methodName, new SeparatedSyntaxList<TypeSyntax>(new SyntaxNodeOrTokenList(typeArgSyntax, 0)), ImmutableArray.Create(typeArg), ImmutableArray<BoundExpression>.Empty, diagnostics
913protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
923var ultimateReceiver = receiver;
1001var checkedUltimateReceiver = CheckValue(ultimateReceiver, BindValueKind.RValue, diagnostics);
1021static BoundExpression updateUltimateReceiver(BoundExpression receiver, BoundExpression originalUltimateReceiver, BoundExpression replacementUltimateReceiver)
1040protected BoundExpression MakeConstruction(CSharpSyntaxNode node, NamedTypeSymbol toCreate, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics)
1044var result = BindClassCreationExpression(node, toCreate.Name, node, toCreate, analyzedArguments, diagnostics);
Binder\Binder_QueryErrors.cs (4)
27BoundExpression instanceArgument,
164internal static void ReportQueryInferenceFailed(CSharpSyntaxNode queryClause, string methodName, BoundExpression receiver, AnalyzedArguments arguments, ImmutableArray<Symbol> symbols, BindingDiagnosticBag diagnostics)
213private static bool ReportQueryInferenceFailedSelectMany(FromClauseSyntax fromClause, string methodName, BoundExpression receiver, AnalyzedArguments arguments, ImmutableArray<Symbol> symbols, BindingDiagnosticBag diagnostics)
218BoundExpression arg = arguments.Argument(arguments.IsExtensionMethodInvocation ? 1 : 0);
Binder\Binder_Statements.cs (81)
238BoundExpression argument = (node.Expression == null)
393private BoundExpression BindThrownExpression(ExpressionSyntax exprSyntax, BindingDiagnosticBag diagnostics, ref bool hasErrors)
395var boundExpr = BindValue(exprSyntax, diagnostics, BindValueKind.RValue);
436BoundExpression boundExpr = null;
515var expression = BindLabel(node.Expression, diagnostics);
538var value = BindRValueWithoutTargetType(node.Expression, BindingDiagnosticBag.Discarded);
651var expression = BindRValueWithoutTargetType(syntax, diagnostics);
678private void CheckForUnobservedAwaitable(BoundExpression expression, BindingDiagnosticBag diagnostics)
754internal MethodSymbol TryFindDisposePatternMethod(BoundExpression expr, SyntaxNode syntaxNode, bool hasAwait, BindingDiagnosticBag diagnostics, out bool isExpanded)
861internal BoundExpression BindInferredVariableInitializer(BindingDiagnosticBag diagnostics, RefKind refKind, EqualsValueClauseSyntax initializer,
871protected BoundExpression BindInferredVariableInitializer(BindingDiagnosticBag diagnostics, ExpressionSyntax initializer, BindValueKind valueKind, CSharpSyntaxNode errorSyntax)
891BoundExpression value = BindValue(initializer, diagnostics, valueKind);
892BoundExpression expression = value.Kind is BoundKind.UnboundLambda or BoundKind.MethodGroup ?
1012BoundExpression initializerOpt;
1106ImmutableArray<BoundExpression> arguments = BindDeclaratorArguments(declarator, localDiagnostics);
1134var invalidDimensions = ArrayBuilder<BoundExpression>.GetInstance();
1172internal ImmutableArray<BoundExpression> BindDeclaratorArguments(VariableDeclaratorSyntax declarator, BindingDiagnosticBag diagnostics)
1181var arguments = default(ImmutableArray<BoundExpression>);
1222private bool IsValidFixedVariableInitializer(TypeSymbol declType, ref BoundExpression initializerOpt, BindingDiagnosticBag diagnostics)
1320private MethodSymbol GetFixedPatternMethodOpt(BoundExpression initializer, BindingDiagnosticBag additionalDiagnostics)
1353private BoundExpression GetFixedLocalCollectionInitializer(
1354BoundExpression initializer,
1371BoundExpression elementConversion;
1402private BoundExpression BindAssignment(AssignmentExpressionSyntax node, BindingDiagnosticBag diagnostics)
1422var op1 = BindValue(node.Left, diagnostics, lhsKind);
1426var op2 = BindValue(rhsExpr, diagnostics, rhsKind);
1438private static BindValueKind GetRequiredRHSValueKindForRefAssignment(BoundExpression boundLeft)
1457private BoundExpression InferTypeForDiscardAssignment(BoundDiscardExpression op1, BoundExpression op2, BindingDiagnosticBag diagnostics)
1475BoundExpression op1,
1476BoundExpression op2,
1489var conversion = GenerateConversionForAssignment(lhsType, op2,
1532BoundExpression op1,
1533BoundExpression op2,
1602static object getName(BoundExpression expr)
1625internal static PropertySymbol GetPropertySymbol(BoundExpression expr, out BoundExpression receiver, out SyntaxNode propertySyntax)
1702internal static Symbol? GetIndexerOrImplicitIndexerSymbol(BoundExpression? e)
1762private static bool AccessingAutoPropertyFromConstructor(BoundExpression? receiver, PropertySymbol propertySymbol, Symbol fromMember, AccessorKind accessorKind)
1804private TypeSymbol GetAccessThroughType(BoundExpression receiver)
1823private BoundExpression BindPossibleArrayInitializer(
1836BoundExpression result;
1841ImmutableArray<BoundExpression>.Empty);
1920internal BoundExpression GenerateConversionForAssignment(TypeSymbol targetType, BoundExpression expression, BindingDiagnosticBag diagnostics, ConversionForAssignmentFlags flags = ConversionForAssignmentFlags.None)
1923internal BoundExpression GenerateConversionForAssignment(TypeSymbol targetType, BoundExpression expression, BindingDiagnosticBag diagnostics, out Conversion conversion, ConversionForAssignmentFlags flags = ConversionForAssignmentFlags.None)
2303BoundExpression operand,
2422void tryConversion(BoundExpression expr, ref bool reportedError, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2507ImmutableArray<BoundExpression> tupleArguments,
2521var argument = tupleArguments[i];
2539var stack = ArrayBuilder<(Binder, IfStatementSyntax IfStatementSyntax, BoundExpression Condition, BoundStatement Consequence)>.GetInstance();
2544var condition = binder.BindBooleanExpression(node.Condition, diagnostics);
2578BoundExpression condition;
2603internal BoundExpression BindBooleanExpression(ExpressionSyntax node, BindingDiagnosticBag diagnostics)
2639var expr = BindValue(node, diagnostics, BindValueKind.RValue);
2718BoundExpression resultOperand = CreateConversion(
2991BoundExpression arg = null;
3126internal BoundExpression CreateReturnConversion(
3129BoundExpression argument,
3241BoundExpression boundFilter = null;
3331BoundExpression exceptionSource = null;
3349private BoundExpression BindCatchFilter(CatchFilterClauseSyntax filter, BindingDiagnosticBag diagnostics)
3353BoundExpression boundFilter = this.BindBooleanExpression(filter.FilterExpression, diagnostics);
3416private static bool IsValidStatementExpression(SyntaxNode syntax, BoundExpression expression)
3446internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics)
3535private static bool IsValidExpressionBody(SyntaxNode expressionSyntax, BoundExpression expression)
3576BoundExpression expression = bodyBinder.BindValue(expressionSyntax, diagnostics, requiredValueKind);
3592BoundExpression expression = bodyBinder.BindValue(expressionSyntax, diagnostics, requiredValueKind);
3596public BoundBlock CreateBlockFromExpression(ExpressionSyntax body, BoundExpression expression, BindingDiagnosticBag diagnostics)
3706BoundExpression initializerInvocation = GetBinder(initializer).BindConstructorInitializer(initializer.ArgumentList, (MethodSymbol)this.ContainingMember(), diagnostics);
3772BoundExpression initializerInvocation = GetBinder(initializer).BindConstructorInitializer(initializer.ArgumentList, (MethodSymbol)this.ContainingMember(), diagnostics);
3783BoundExpression? initializerInvocation;
3804internal static BoundExpression? BindImplicitConstructorInitializer(
3954BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true };
3960arguments: ImmutableArray<BoundExpression>.Empty,
3999BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true };
4000BoundExpression argument = new BoundParameter(syntax, constructor.Parameters[0]);
4097internal PatternLookupResult PerformPatternMethodLookup(BoundExpression receiver, string methodName,
4107var boundAccess = BindInstanceMemberAccess(
4132var patternMethodCall = BindMethodGroupInvocation(
Binder\Binder_TupleOperators.cs (32)
26BoundExpression left, BoundExpression right, BindingDiagnosticBag diagnostics)
30BoundExpression convertedLeft = ApplyConvertedTypes(left, operators, isRight: false, diagnostics);
31BoundExpression convertedRight = ApplyConvertedTypes(right, operators, isRight: true, diagnostics);
38private BoundExpression ApplyConvertedTypes(BoundExpression expr, TupleBinaryOperatorInfo @operator, bool isRight, BindingDiagnosticBag diagnostics)
54ImmutableArray<BoundExpression> arguments = tuple.Arguments;
58var builder = ArrayBuilder<BoundExpression>.GetInstance(length);
83BoundExpression left, BoundExpression right, BindingDiagnosticBag diagnostics)
98BoundExpression comparison = BindSimpleBinaryOperator(node, diagnostics, left, right, leaveUnconvertedIfInterpolatedString: false);
107out BoundExpression conversionIntoBoolOperator, out BoundValuePlaceholder conversionIntoBoolOperatorPlaceholder,
126out BoundExpression conversionForBool, out BoundValuePlaceholder conversionForBoolPlaceholder, out UnaryOperatorSignature boolOperator)
160BoundExpression comparisonResult = new BoundTupleOperandPlaceholder(node, type);
180BoundExpression left, BoundExpression right, BindingDiagnosticBag diagnostics)
203BoundExpression left, BoundExpression right, BindingDiagnosticBag diagnostics)
229(ImmutableArray<BoundExpression> leftParts, ImmutableArray<string> leftNames) = GetTupleArgumentsOrPlaceholders(left);
230(ImmutableArray<BoundExpression> rightParts, ImmutableArray<string> rightNames) = GetTupleArgumentsOrPlaceholders(right);
265private static void ReportNamesMismatchesIfAny(BoundExpression left, BoundExpression right,
325internal static BoundExpression GiveTupleTypeToDefaultLiteralIfNeeded(BoundExpression expr, TypeSymbol targetType)
336private static bool IsTupleBinaryOperation(BoundExpression left, BoundExpression right)
349private static int GetTupleCardinality(BoundExpression expr)
375private static (ImmutableArray<BoundExpression> Elements, ImmutableArray<string> Names) GetTupleArgumentsOrPlaceholders(BoundExpression expr)
384ImmutableArray<BoundExpression> placeholders = tupleType.TupleElementTypesWithAnnotations
385.SelectAsArray((t, s) => (BoundExpression)new BoundTupleOperandPlaceholder(s, t.Type), expr.Syntax);
396ImmutableArray<BoundExpression> elements, ImmutableArray<string> names,
Binder\ForEachLoopBinder.cs (29)
192BoundExpression collectionExpr = originalBinder.GetBinder(_syntax.Expression).BindRValueWithoutTargetType(_syntax.Expression, diagnostics);
224BoundExpression collectionExpr = originalBinder.GetBinder(_syntax.Expression).BindRValueWithoutTargetType(_syntax.Expression, diagnostics);
269BoundExpression iterationErrorExpression = null;
501BoundExpression elementConversion = CreateConversion(_syntax, elementPlaceholder, elementConversionClassification, isCast: false, conversionGroupOpt: null, iterationVariableType.Type, createConversionDiagnostics);
552BoundExpression convertedCollectionExpression = ConvertForEachCollection(collectionExpr, collectionConversionClassification, builder.CollectionType, diagnostics);
611BoundExpression collectionExpr = this.GetBinder(collectionSyntax).BindValue(collectionSyntax, diagnostics, BindValueKind.RValue);
620protected BoundExpression ConvertForEachCollection(
621BoundExpression collectionExpr,
630BoundExpression convertedCollectionExpression = CreateConversion(
662ref BoundExpression collectionExpr,
698private BoundExpression UnwrapCollectionExpressionIfNullable(BoundExpression collectionExpr, BindingDiagnosticBag diagnostics)
758ref BoundExpression collectionExpr,
766BoundExpression originalCollectionExpr = collectionExpr;
812private EnumeratorResult GetEnumeratorInfoCore(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
853BoundExpression span = new BoundValuePlaceholder(collectionExpr.Syntax, spanType).MakeCompilerGenerated();
855var originalSpan = span;
901var originalCollectionExpr = collectionExpr;
914EnumeratorResult getEnumeratorInfo(SyntaxNode syntax, SyntaxNode collectionSyntax, ref BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, out ForEachEnumeratorInfo.Builder builder)
958var unwrappedCollectionExpr = UnwrapCollectionExpressionIfNullable(collectionExpr, diagnostics);
1016EnumeratorResult createPatternBasedEnumeratorResult(ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, bool viaExtensionMethod, BindingDiagnosticBag diagnostics)
1042private EnumeratorResult SatisfiesIEnumerableInterfaces(SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, BindingDiagnosticBag diagnostics, TypeSymbol unwrappedCollectionExprType)
1174private bool ReportConstantNullCollectionExpr(BoundExpression collectionExpr, BindingDiagnosticBag diagnostics)
1185private void GetDisposalInfoForEnumerator(SyntaxNode syntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression expr, bool isAsync, BindingDiagnosticBag diagnostics)
1206var argsBuilder = ArrayBuilder<BoundExpression>.GetInstance(patternDisposeMethod.ParameterCount);
1323private bool SatisfiesGetEnumeratorPattern(SyntaxNode syntax, SyntaxNode collectionSyntax, ref ForEachEnumeratorInfo.Builder builder, BoundExpression collectionExpr, bool isAsync, bool viaExtensionMethod, BindingDiagnosticBag diagnostics)
1497private MethodArgumentInfo FindForEachPatternMethodViaExtension(SyntaxNode syntax, SyntaxNode collectionSyntax, BoundExpression collectionExpr, string methodName, BindingDiagnosticBag diagnostics)
1906private MethodArgumentInfo BindDefaultArguments(MethodSymbol method, BoundExpression extensionReceiverOpt, bool expanded, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
1915var argsBuilder = ArrayBuilder<BoundExpression>.GetInstance(method.ParameterCount);
Binder\RefSafetyAnalysis.cs (18)
68private HashSet<BoundExpression>? _visited = new HashSet<BoundExpression>();
281else if (node is BoundExpression expr)
291private void AssertVisited(BoundExpression expr)
635private void VisitArgumentsAndGetArgumentPlaceholders(BoundExpression? receiverOpt, ImmutableArray<BoundExpression> arguments)
639var arg = arguments[i];
676BoundExpression? receiver,
678ImmutableArray<BoundExpression> arguments)
921private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, SyntaxNode syntax, Conversion conversion, BoundExpression right)
993internal readonly BoundExpression Expression;
997internal DeconstructionVariable(BoundExpression expression, SafeContext valEscape, ArrayBuilder<DeconstructionVariable>? nestedVariables)
1009foreach (var arg in arguments)
1015DeconstructionVariable getDeconstructionAssignmentVariable(BoundExpression expr)
1023private static ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr)
1049ImmutableArray<BoundExpression> arguments;
1054inlineArray: node.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ? node.Expression : operand,
Binder\Semantics\Conversions\ConversionsBase.cs (25)
75protected abstract Conversion GetInterpolatedStringConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo);
98public Conversion ClassifyImplicitConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
283public Conversion ClassifyConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast = false)
375private Conversion ClassifyConversionFromExpressionForCast(BoundExpression source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
541public Conversion ClassifyStandardConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
605private Conversion ClassifyStandardImplicitConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
782private Conversion GetImplicitUserDefinedConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
872private Conversion GetExplicitUserDefinedConversion(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1029private Conversion ClassifyImplicitBuiltInConversionFromExpression(BoundExpression sourceExpression, TypeSymbol source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1074var innerExpression = ((BoundExpressionWithNullability)sourceExpression).Expression;
1184private Conversion GetSwitchExpressionConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1213private Conversion GetConditionalExpressionConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1231private static Conversion ClassifyNullLiteralConversion(BoundExpression source, TypeSymbol destination)
1270private static Conversion ClassifyImplicitConstantExpressionConversion(BoundExpression source, TypeSymbol destination)
1349internal static bool HasImplicitConstantExpressionConversion(BoundExpression source, TypeSymbol destination)
1401private Conversion ClassifyExplicitOnlyConversionFromExpression(BoundExpression sourceExpression, TypeSymbol destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast)
1441private static bool HasImplicitEnumerationConversion(BoundExpression source, TypeSymbol destination)
1643private static bool HasAnonymousFunctionConversion(BoundExpression source, TypeSymbol destination, CSharpCompilation compilation)
1922public Conversion ClassifyImplicitExtensionMethodThisArgConversion(BoundExpression sourceExpressionOpt, TypeSymbol sourceType, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool isMethodGroupConversion)
1961(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) =>
2281private delegate Conversion ClassifyConversionFromExpressionDelegate(ConversionsBase conversions, BoundExpression sourceExpression, TypeWithAnnotations destination, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, bool forCast);
2296(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast)
2314(ConversionsBase conversions, BoundExpression s, TypeWithAnnotations d, bool isChecked, ref CompoundUseSiteInfo<AssemblySymbol> u, bool forCast) =>
2346var argument = arguments[i];
3035internal bool HasImplicitConversionToOrImplementsVarianceCompatibleInterface(BoundExpression expressionToCheck, NamedTypeSymbol targetInterfaceType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool needSupportForRefStructInterfaces)
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (32)
20public void BinaryOperatorOverloadResolution(BinaryOperatorKind kind, bool isChecked, BoundExpression left, BoundExpression right, BinaryOperatorOverloadResolutionResult result, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
32internal void BinaryOperatorOverloadResolution_EasyOut(BinaryOperatorKind kind, BoundExpression left, BoundExpression right, BinaryOperatorOverloadResolutionResult result)
51BoundExpression left,
52BoundExpression right,
211BoundExpression left, BoundExpression right, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo,
323private void GetDelegateOperations(BinaryOperatorKind kind, BoundExpression left, BoundExpression right,
453BoundExpression nonDelegate = leftDelegate ? right : left;
464private void GetEnumOperation(BinaryOperatorKind kind, TypeSymbol enumType, BoundExpression right, ArrayBuilder<BinaryOperatorSignature> operators)
588private void GetEnumOperations(BinaryOperatorKind kind, BoundExpression left, BoundExpression right, ArrayBuilder<BinaryOperatorSignature> results)
675BoundExpression left,
676BoundExpression right,
706private void GetAllBuiltInOperators(BinaryOperatorKind kind, bool isChecked, BoundExpression left, BoundExpression right, ArrayBuilder<BinaryOperatorAnalysisResult> results, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
763static bool useOnlyReferenceEquality(Conversions conversions, BoundExpression left, BoundExpression right, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
772static bool isUtf8ByteRepresentation(BoundExpression value)
777Conversion getOperandConversionForAllowByRefLikeNullCheck(bool isChecked, BoundExpression operand, TypeSymbol objectType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
792BoundExpression left,
793BoundExpression right,
855BoundExpression left,
856BoundExpression right,
1059BoundExpression left,
1060BoundExpression right,
1126BoundExpression left,
1127BoundExpression right,
1179private BetterResult BetterOperator(BinaryOperatorSignature op1, BinaryOperatorSignature op2, BoundExpression left, BoundExpression right, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Operators\UnaryOperatorOverloadResolution.cs (9)
23public void UnaryOperatorOverloadResolution(UnaryOperatorKind kind, bool isChecked, BoundExpression operand, UnaryOperatorOverloadResolutionResult result, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
65BoundExpression operand,
131BoundExpression operand,
183private BetterResult BetterOperator(UnaryOperatorSignature op1, UnaryOperatorSignature op2, BoundExpression operand, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
241private void GetAllBuiltInOperators(UnaryOperatorKind kind, bool isChecked, BoundExpression operand, ArrayBuilder<UnaryOperatorAnalysisResult> results, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
272private bool CandidateOperators(bool isChecked, ArrayBuilder<UnaryOperatorSignature> operators, BoundExpression operand, ArrayBuilder<UnaryOperatorAnalysisResult> results, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
292private void GetEnumOperations(UnaryOperatorKind kind, BoundExpression operand, ArrayBuilder<UnaryOperatorSignature> operators)
323private static UnaryOperatorSignature? GetPointerOperation(UnaryOperatorKind kind, BoundExpression operand)
347private bool GetUserDefinedOperators(UnaryOperatorKind kind, bool isChecked, BoundExpression operand, ArrayBuilder<UnaryOperatorAnalysisResult> results, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\OverloadResolution\MethodTypeInference.cs (27)
97internal abstract TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr);
103internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr)
138private readonly ImmutableArray<BoundExpression> _arguments;
272ImmutableArray<BoundExpression> arguments,// Required; in scenarios like method group conversions where there are
321ImmutableArray<BoundExpression> arguments,
585BoundExpression argument = _arguments[arg];
594private void MakeExplicitParameterTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations target, ExactOrBoundsKind kind, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
667MakeExplicitParameterTypeInferences(binder, (BoundExpression)element, targetElementType, kind, ref useSiteInfo);
724var sourceArgument = sourceArguments[i];
844var argument = _arguments[arg];
849private void MakeOutputTypeInferences(Binder binder, BoundExpression argument, TypeWithAnnotations formalType, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
886if (element is BoundExpression expression)
917var sourceArgument = sourceArguments[i];
982private static bool DoesInputTypeContain(BoundExpression argument, TypeSymbol formalParameterType, TypeParameterSymbol typeParameter)
1018private bool HasUnfixedParamInInputType(BoundExpression pSource, TypeSymbol pDest)
1037private static bool DoesOutputTypeContain(BoundExpression argument, TypeSymbol formalParameterType,
1078private bool HasUnfixedParamInOutputType(BoundExpression argument, TypeSymbol formalParameterType)
1119var argument = _arguments[iArg];
1341private void OutputTypeInference(Binder binder, BoundExpression expression, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1374private bool InferredReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1410private bool MethodGroupReturnTypeInference(Binder binder, BoundExpression source, TypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1517private void ExplicitParameterTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
1572private void ExplicitReturnTypeInference(BoundExpression source, TypeWithAnnotations target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3033private TypeWithAnnotations InferReturnType(BoundExpression source, NamedTypeSymbol target, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3177ImmutableArray<BoundExpression> arguments,
3192ImmutableArray<BoundExpression> arguments,
3238var argument = _arguments[0];
Binder\Semantics\OverloadResolution\OverloadResolution.cs (17)
139BoundExpression receiver,
165BoundExpression receiverOpt,
187BoundExpression receiver,
430BoundExpression receiver,
582BoundExpression receiverOpt) where TMember : Symbol
2081ArrayBuilder<BoundExpression> arguments,
2120ArrayBuilder<BoundExpression> arguments,
2602ArrayBuilder<BoundExpression> arguments,
2666private static void GetParameterCounts<TMember>(MemberResolutionResult<TMember> m, ArrayBuilder<BoundExpression> arguments, out int declaredParameterCount, out int parametersUsedIncludingExpansionAndOptional) where TMember : Symbol
2818private BetterResult BetterConversionFromExpression(BoundExpression node, TypeSymbol t1, TypeSymbol t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
2833BoundExpression node,
2888private BetterResult BetterConversionFromExpression(BoundExpression node, TypeSymbol t1, Conversion conv1, TypeSymbol t2, Conversion conv2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool okToDowngradeToNeither)
3106elementBetterResult = BetterConversionFromExpression((BoundExpression)element, elementType1, conversionToE1, elementType2, conversionToE2, ref useSiteInfo, okToDowngradeToNeither: out _);
3226private bool ExpressionMatchExactly(BoundExpression node, TypeSymbol t, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
3384if (!(node is BoundExpression))
4421BoundExpression argument = arguments.Argument(argumentPosition);
4560BoundExpression argument,
Binder\Semantics\OverloadResolution\OverloadResolutionResult.cs (7)
194BoundExpression receiver,
644BoundExpression receiverOpt,
741BoundExpression receiver,
1083BoundExpression receiver,
1159BoundExpression argument = arguments.Argument(arg);
1368static bool isStringLiteralToInterpolatedStringHandlerArgumentConversion(BoundExpression argument, ParameterSymbol parameter)
1389private bool HadAmbiguousWorseMethods(BindingDiagnosticBag diagnostics, ImmutableArray<Symbol> symbols, Location location, bool isQuery, BoundExpression receiver, string name)
BoundTree\BoundObjectCreationExpression.cs (3)
12public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt,
18public BoundObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded,
24public BoundObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<MethodSymbol> constructorsGroup, ImmutableArray<BoundExpression> arguments,
BoundTree\Constructors.cs (72)
16BoundExpression? receiver,
26BoundExpression? receiver,
38BoundExpression? receiver,
50BoundExpression? receiver,
59private static bool NeedsByValueFieldAccess(BoundExpression? receiver, FieldSymbol fieldSymbol)
88BoundExpression? receiverOpt,
91ImmutableArray<BoundExpression> arguments,
106public BoundCall Update(BoundExpression? receiverOpt,
109ImmutableArray<BoundExpression> arguments,
123BoundExpression receiverOpt,
125ImmutableArray<BoundExpression> arguments,
158public BoundCall Update(ImmutableArray<BoundExpression> arguments)
163public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments)
168public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method)
170return Synthesized(syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning: initialBindingReceiverIsSubjectToCloning, method, ImmutableArray<BoundExpression>.Empty);
173public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0)
178public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0, BoundExpression arg1)
183public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt = default)
253public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, params BoundExpression[] arguments)
254: this(syntax, constructor, ImmutableArray.Create<BoundExpression>(arguments), default(ImmutableArray<string?>), default(ImmutableArray<RefKind>), false, default(ImmutableArray<int>), default(BitVector), null, null, constructor.ContainingType)
257public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments)
267BoundExpression receiverOpt,
269ImmutableArray<BoundExpression> arguments,
292BoundExpression? receiverOpt,
295ImmutableArray<BoundExpression> arguments,
307public BoundIndexerAccess Update(BoundExpression? receiverOpt,
310ImmutableArray<BoundExpression> arguments,
328public static BoundConversion SynthesizedNonUserDefined(SyntaxNode syntax, BoundExpression operand, Conversion conversion, TypeSymbol type, ConstantValue? constantValueOpt = null)
351BoundExpression operand,
377BoundExpression operand,
401BoundExpression operand,
414public BoundConversion Update(BoundExpression operand,
430BoundExpression left,
431BoundExpression right,
457BoundExpression left,
458BoundExpression right,
470BoundExpression left,
471BoundExpression right,
489BoundExpression left,
490BoundExpression right,
522BoundExpression left,
523BoundExpression right,
543public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false)
550: this(syntax, aliasOpt, boundContainingTypeOpt, ImmutableArray<BoundExpression>.Empty, typeWithAnnotations, hasErrors)
564public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, ImmutableArray<BoundExpression> dimensionsOpt, TypeWithAnnotations typeWithAnnotations, bool hasErrors = false)
590public BoundAssignmentOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right,
599public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol type)
631public static BoundReturnStatement Synthesized(SyntaxNode syntax, RefKind refKind, BoundExpression expression, bool hasErrors = false)
695public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
708public static BoundDagTemp ForOriginalInput(BoundExpression expr) => new BoundDagTemp(expr.Syntax, expr.Type!, source: null);
715BoundExpression left,
716BoundExpression right,
718BoundExpression? leftConversion,
720BoundExpression? finalConversion,
729BoundExpression left,
730BoundExpression right,
732BoundExpression? leftConversion,
734BoundExpression? finalConversion,
745BoundExpression operand,
757BoundExpression operand,
771BoundExpression operand,
775BoundExpression? operandConversion,
777BoundExpression? resultConversion,
785public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, TypeSymbol type)
BoundTree\UnboundLambda.cs (10)
205var types = ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)>.GetInstance();
246ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)> returns,
355if (!(node is BoundExpression))
376var expression = node.ExpressionOpt;
584protected abstract BoundExpression? GetLambdaExpressionBody(BoundBlock body);
589protected abstract BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics);
800GetLambdaExpressionBody(returnInferenceLambda.Body) is BoundExpression expression &&
1564protected override BoundExpression? GetLambdaExpressionBody(BoundBlock body)
1571statements[0] is BoundReturnStatement { RefKind: Microsoft.CodeAnalysis.RefKind.None, ExpressionOpt: BoundExpression expr })
1579protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics)
CodeGen\EmitArrayInitializer.cs (27)
68ImmutableArray<BoundExpression> inits,
82ImmutableArray<BoundExpression> inits,
87var init = inits[i];
101private static bool ShouldEmitInitExpression(bool includeConstants, BoundExpression init)
124public IndexDesc(int index, ImmutableArray<BoundExpression> initializers)
131public readonly ImmutableArray<BoundExpression> Initializers;
135ImmutableArray<BoundExpression> inits,
216private static ConstantValue AsConstOrDefault(BoundExpression init)
246private ArrayInitializerStyle ShouldEmitBlockInitializer(TypeSymbol elementType, ImmutableArray<BoundExpression> inits)
297private void InitializerCountRecursive(ImmutableArray<BoundExpression> inits, ref int initCount, ref int constInits)
304foreach (var init in inits)
332private ImmutableArray<byte> GetRawData(ImmutableArray<BoundExpression> initializers)
344private void SerializeArrayRecursive(BlobBuilder bw, ImmutableArray<BoundExpression> inits)
350foreach (var init in inits)
357foreach (var init in inits)
368private static bool IsMultidimensionalInitializer(ImmutableArray<BoundExpression> inits)
398private bool TryEmitOptimizedReadonlySpanCreation(NamedTypeSymbol spanType, BoundExpression wrappedExpression, bool used, BoundExpression inPlaceTarget, out bool avoidInPlace, BoundExpression? start = null, BoundExpression? length = null)
482ImmutableArray<BoundExpression> initializers = initializer.Initializers;
632bool tryEmitAsCachedArrayFromBlob(NamedTypeSymbol spanType, BoundExpression wrappedExpression, int elementCount, ImmutableArray<byte> data, ref ArrayTypeSymbol arrayType, TypeSymbol elementType)
682bool tryEmitAsCachedArrayOfConstants(BoundArrayCreation arrayCreation, ArrayTypeSymbol arrayType, TypeSymbol elementType, NamedTypeSymbol spanType, bool used, BoundExpression? inPlaceTarget, out bool avoidInPlace)
756void emitEmptyReadonlySpan(NamedTypeSymbol spanType, BoundExpression wrappedExpression, bool used, BoundExpression? inPlaceTarget)
813private ImmutableArray<byte> GetRawDataForArrayInit(ImmutableArray<BoundExpression> initializers)
820foreach (var init in initializers)
CodeGen\EmitExpression.cs (51)
36private void EmitExpression(BoundExpression expression, bool used)
77private void EmitExpressionCoreWithStackGuard(BoundExpression expression, bool used)
94private void EmitExpressionCore(BoundExpression expression, bool used)
407var receiver = expression.Receiver;
542var whenNull = expression.WhenNullOpt;
709BoundExpression argument = expression.Arguments[i];
715private void EmitArgument(BoundExpression argument, RefKind refKind)
800var receiver = mg != null ? mg.ReceiverOpt : expression.Argument;
939foreach (var se in sideEffects)
946private void EmitArguments(ImmutableArray<BoundExpression> arguments, ImmutableArray<ParameterSymbol> parameters, ImmutableArray<RefKind> argRefKindsOpt)
967internal static RefKind GetArgumentRefKind(ImmutableArray<BoundExpression> arguments, ImmutableArray<ParameterSymbol> parameters, ImmutableArray<RefKind> argRefKindsOpt, int i)
1169var receiver = fieldAccess.ReceiverOpt;
1197private LocalDefinition EmitFieldLoadReceiver(BoundExpression receiver)
1225private bool EmitFieldLoadReceiverAddress(BoundExpression receiver)
1264private bool FieldLoadPrefersRef(BoundExpression receiver)
1317internal static bool FieldLoadMustUseRef(BoundExpression expr)
1506private bool CanUseCallOnRefTypeReceiver(BoundExpression receiver)
1574var seqValue = ((BoundSequence)(receiver)).Value;
1578var rhs = ((BoundAssignmentOperator)receiver).Right;
1596private bool IsThisReceiver(BoundExpression receiver)
1604var seqValue = ((BoundSequence)(receiver)).Value;
1638var receiver = call.ReceiverOpt;
1658var receiver = call.ReceiverOpt;
1826var receiver = call.ReceiverOpt;
1916var receiver = call.ReceiverOpt;
1943var receiver = call.ReceiverOpt;
2022var receiver = call.ReceiverOpt;
2084internal static bool IsPossibleReferenceTypeReceiverOfConstrainedCall(BoundExpression receiver)
2096internal static bool ReceiverIsKnownToReferToTempIfReferenceType(BoundExpression receiver)
2114internal static bool IsSafeToDereferenceReceiverRefAfterEvaluatingArguments(ImmutableArray<BoundExpression> arguments)
2118static bool isSafeToDereferenceReceiverRefAfterEvaluatingArgument(BoundExpression expression)
2120var current = expression;
2209internal static bool IsRef(BoundExpression receiver)
2235private static int GetCallStackBehavior(MethodSymbol method, ImmutableArray<BoundExpression> arguments)
2413foreach (var init in initializer.Initializers)
2434foreach (var arg in expression.Arguments)
2462private bool TryEmitOptimizedReadonlySpan(BoundObjectCreationExpression expression, bool used, BoundExpression inPlaceTarget, out bool avoidInPlace)
2582var left = assignmentOperator.Left;
2597var right = assignmentOperator.Right;
2645private bool SafeToGetWriteableReference(BoundExpression left)
2672private void InPlaceInit(BoundExpression target, bool used)
2687private bool TryInPlaceCtorCall(BoundExpression target, BoundObjectCreationExpression objCreation, bool used)
2726private bool PartialCtorResultCannotEscape(BoundExpression left)
2752private static bool TargetIsNotOnHeap(BoundExpression left)
2770var assignmentTarget = assignmentOperator.Left;
2990BoundExpression lhs = assignmentOperator.Left;
3061BoundExpression expression = assignment.Left;
3096var array = ((BoundArrayAccess)expression).Expression;
3381var operand = isOp.Operand;
3407var operand = asOp.Operand;
3904private TypeSymbol StackMergeType(BoundExpression expr)
CodeGen\EmitStackAllocInitializer.cs (8)
16private void EmitStackAlloc(TypeSymbol type, BoundArrayInitialization? inits, BoundExpression count)
129private ArrayInitializerStyle ShouldEmitBlockInitializerForStackAlloc(TypeSymbol elementType, ImmutableArray<BoundExpression> inits)
163private void StackAllocInitializerCount(ImmutableArray<BoundExpression> inits, ref int initCount, ref int constInits)
170foreach (var init in inits)
182private void EmitElementStackAllocInitializers(TypeSymbol elementType, ImmutableArray<BoundExpression> inits, bool includeConstants)
186foreach (BoundExpression init in inits)
200private void EmitPointerElementAccess(BoundExpression init, TypeSymbol elementType, int elementTypeSizeInBytes, int index)
227private void EmitIntConstantOrSizeOf(BoundExpression init, TypeSymbol elementType, int elementTypeSizeInBytes)
CodeGen\EmitStatement.cs (19)
172private void EmitThrow(BoundExpression thrown)
228private static BoundExpression TryReduce(BoundBinaryOperator condition, ref bool sense)
235BoundExpression nonConstOp;
236BoundExpression constOp = (condition.Left.ConstantValueOpt != null) ? condition.Left : null;
358private void EmitCondBranch(BoundExpression condition, ref object dest, bool sense)
376private void EmitCondBranchCoreWithStackGuard(BoundExpression condition, ref object dest, bool sense)
393private void EmitCondBranchCore(BoundExpression condition, ref object dest, bool sense)
426var stack = ArrayBuilder<(BoundExpression? condition, StrongBox<object?> destBox, bool sense)>.GetInstance();
432(BoundExpression? condition, StrongBox<object?> destBox, bool sense) top = stack.Pop();
500var reduced = TryReduce(binOp, ref sense);
529var receiver = ca.Receiver;
587var operand = isOp.Operand;
864var expressionOpt = boundReturnStatement.ExpressionOpt;
1121var exceptionSourceOpt = catchBlock.ExceptionSourceOpt;
1134BoundExpression exceptionSource = exceptionSourceOpt;
1249BoundExpression expression,
1957BoundExpression caseExpressionOpt = node.CaseExpressionOpt;
1969BoundExpression condition = node.Condition;
1977BoundExpression expression = node.Expression;
CodeGen\Optimizer.cs (118)
398private readonly ArrayBuilder<(BoundExpression, ExprContext)> _evalStack;
419ArrayBuilder<ValueTuple<BoundExpression, ExprContext>> evalStack,
436var evalStack = ArrayBuilder<ValueTuple<BoundExpression, ExprContext>>.GetInstance();
448BoundExpression expr = node as BoundExpression;
462private BoundExpression VisitExpressionCore(BoundExpression node, ExprContext context)
469var result = node.ConstantValueOpt == null ?
470node = (BoundExpression)base.Visit(node) :
499private BoundExpression VisitExpression(BoundExpression node, ExprContext context)
501BoundExpression result;
519private BoundExpression VisitExpressionCoreWithStackGuard(BoundExpression node, ExprContext context)
525var result = VisitExpressionCore(node, context);
540private void PushEvalStack(BoundExpression result, ExprContext context)
721ArrayBuilder<BoundExpression> rewrittenSideeffects = null;
726var sideeffect = sideeffects[i];
727var rewrittenSideeffect = this.VisitExpression(sideeffect, ExprContext.Sideeffects);
731rewrittenSideeffects = ArrayBuilder<BoundExpression>.GetInstance();
742var value = this.VisitExpression(node.Value, origContext);
759var value = node.Value;
765var lastSideeffect = sideeffects.LastOrDefault();
906BoundExpression rewritten = sequence.Update(sequence.Locals,
911rewritten = (BoundExpression)Visit(rewritten);
921var left = VisitExpression(node.Left, isIndirectAssignment ?
949BoundExpression right = node.Right;
1016internal static bool IsFixedBufferAssignmentToRefLocal(BoundExpression left, BoundExpression right, bool isRef)
1028var lhs = node.Left;
1099var lhs = node.Left;
1124BoundExpression rewrittenReceiver = visitReceiver(node);
1150BoundExpression rewrittenReceiver = visitReceiver(node);
1154BoundExpression visitReceiver(BoundCall node)
1156var receiver = node.ReceiverOpt;
1174receiver = typeExpression.Update(aliasOpt: null, boundContainingTypeOpt: null, boundDimensionsOpt: ImmutableArray<BoundExpression>.Empty,
1186BoundCall visitArgumentsAndUpdateCall(BoundCall node, BoundExpression receiver)
1193private BoundExpression VisitCallOrConditionalAccessReceiver(BoundExpression receiver, BoundCall callOpt)
1208private void CheckCallReceiver(BoundExpression receiver, BoundCall call)
1214var unwrappedSequence = receiver;
1228private static ExprContext GetReceiverContext(BoundExpression receiver)
1255private ImmutableArray<BoundExpression> VisitArguments(ImmutableArray<BoundExpression> arguments, ImmutableArray<ParameterSymbol> parameters, ImmutableArray<RefKind> argRefKindsOpt)
1262ArrayBuilder<BoundExpression> rewrittenArguments = null;
1272private void VisitArgument(ImmutableArray<BoundExpression> arguments, ref ArrayBuilder<BoundExpression> rewrittenArguments, int i, RefKind argRefKind)
1276var arg = arguments[i];
1277BoundExpression rewrittenArg = VisitExpression(arg, context);
1281rewrittenArguments = ArrayBuilder<BoundExpression>.GetInstance();
1294ArrayBuilder<BoundExpression> rewrittenArguments = null;
1295ImmutableArray<BoundExpression> arguments = node.Arguments;
1312var rewrittenOperand = VisitExpression(node.Operand, ExprContext.Address);
1342var receiver = node.ReceiverOpt;
1424BoundExpression boundExpression = node.Expression;
1434boundExpression = (BoundExpression)this.Visit(boundExpression);
1454BoundExpression condition = this.VisitExpression(node.Condition, ExprContext.Value);
1461BoundExpression consequence = this.VisitExpression(node.Consequence, context);
1466BoundExpression alternative = this.VisitExpression(node.Alternative, context);
1475BoundExpression child = node.Left;
1504var left = (BoundExpression)this.Visit(child);
1519var right = (BoundExpression)this.Visit(binary.Right);
1552BoundExpression left = (BoundExpression)this.Visit(node.Left);
1557BoundExpression right = (BoundExpression)this.Visit(node.Right);
1572BoundExpression left = (BoundExpression)this.Visit(node.LeftOperand);
1579BoundExpression right = (BoundExpression)this.Visit(node.RightOperand);
1589BoundExpression receiver = VisitCallOrConditionalAccessReceiver(node.Receiver, callOpt: null);
1596BoundExpression whenNotNull = (BoundExpression)this.Visit(node.WhenNotNull);
1600var whenNull = node.WhenNullOpt;
1604whenNull = (BoundExpression)this.Visit(whenNull);
1627var valueTypeReceiver = (BoundExpression)this.Visit(node.ValueTypeReceiver);
1633var unwrappedSequence = node.ReferenceTypeReceiver;
1645var referenceTypeReceiver = (BoundExpression)this.Visit(node.ReferenceTypeReceiver);
1659BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
1687var exceptionSourceOpt = node.ExceptionSourceOpt;
1724BoundExpression boundFilter;
1727boundFilter = (BoundExpression)this.Visit(node.ExceptionFilterOpt);
1760ArrayBuilder<BoundExpression> rewrittenInitializers = null;
1768var initializer = initializers[i];
1769var rewrittenInitializer = this.VisitExpression(initializer, ExprContext.Value);
1773rewrittenInitializers = ArrayBuilder<BoundExpression>.GetInstance();
1791BoundExpression visitedOperand = this.VisitExpression(node.Operand, ExprContext.Address);
1797BoundExpression expressionOpt = (BoundExpression)this.Visit(node.ExpressionOpt);
2052var asExpression = node as BoundExpression;
2069BoundExpression child = node.Left;
2095var left = (BoundExpression)this.Visit(child);
2100var right = (BoundExpression)this.Visit(binary.Right);
2143ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
2180var right = (BoundExpression)Visit(node.Right);
2226BoundExpression? rewrittenReceiver = visitReceiver(node);
2247BoundExpression? rewrittenReceiver = visitReceiver(node);
2251BoundExpression? visitReceiver(BoundCall node)
2253BoundExpression? receiverOpt = node.ReceiverOpt;
2257receiverOpt = (BoundExpression?)this.Visit(receiverOpt);
2265receiverOpt = typeExpression.Update(aliasOpt: null, boundContainingTypeOpt: null, boundDimensionsOpt: ImmutableArray<BoundExpression>.Empty,
2277BoundExpression visitArgumentsAndUpdateCall(BoundCall node, BoundExpression? receiverOpt)
2279ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
2288var exceptionSource = node.ExceptionSourceOpt;
2291var filter = node.ExceptionFilterOpt;
2313exceptionSource = (BoundExpression)Visit(exceptionSource);
2324filter = (BoundExpression)this.Visit(filter);
2416internal override ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue)
Compilation\CSharpSemanticModel.cs (27)
167internal abstract BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols);
251private static BoundExpression GetSpeculativelyBoundExpressionHelper(Binder binder, ExpressionSyntax expression, SpeculativeBindingOption bindingOption)
258BoundExpression boundNode;
279protected BoundExpression GetSpeculativelyBoundExpressionWithoutNullability(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
320var boundNode = GetSpeculativelyBoundExpressionHelper(binder, expression, bindingOption);
824BoundExpression expression = bnode.Expression;
1873BoundExpression boundExpr;
1888case BoundExpression boundExpr2:
1905if (highestBoundNode is BoundExpression highestBoundExpr)
2034var boundExpr = lowestBoundNode as BoundExpression;
2035var highestBoundExpr = highestBoundNode as BoundExpression;
2265static (TypeSymbol, NullabilityInfo) getTypeAndNullability(BoundExpression expr) => (expr.Type, expr.TopLevelNullability);
2278if (lowestBoundNode is BoundExpression boundExpr)
2299var boundExpr = lowestBoundNode as BoundExpression;
2854var bnode = binder.BindExpression(expression, BindingDiagnosticBag.Discarded);
2906var bnode = binder.BindExpression(expression, BindingDiagnosticBag.Discarded);
3342BoundExpression boundNode,
3426BoundExpression valueExpression = ((BoundTypeOrValueExpression)boundNode).Data.ValueExpression;
3939private static void GetSymbolsAndResultKind(BoundExpression node, Symbol symbolOpt, ImmutableArray<MethodSymbol> originalCandidates, out OneOrMany<Symbol> symbols, out LookupResultKind resultKind)
3962BoundExpression boundNode,
4081private ImmutableArray<IPropertySymbol> GetIndexerGroupSemanticSymbols(BoundExpression boundNode, Binder binderOpt)
4605var receiver = node.ReceiverOpt;
4792BoundExpression receiver = call.Arguments[0];
4801private OneOrMany<Symbol> CreateReducedExtensionMethodIfPossible(BoundDelegateCreationExpression delegateCreation, BoundExpression receiverOpt)
Compilation\MemberSemanticModel.cs (22)
191internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
204var boundRoot = binder.BindExpression(expression, BindingDiagnosticBag.Discarded);
206return (BoundExpression)NullableWalker.AnalyzeAndRewriteSpeculation(position, boundRoot, binder, snapshotManager, newSnapshots: out _, remappedSymbols: ref ignored);
475var boundExpression = this.GetLowerBoundNode(bindableNode) as BoundExpression;
499var boundExpression = this.GetLowerBoundNode(bindableNode) as BoundExpression;
1055var operation = call.IsDelegateCall ? call.ReceiverOpt : call;
1259BoundExpression boundExpr = this.GetLowerBoundNode(bindableNode) as BoundExpression;
1275var boundAdd = boundCollectionInitializer.Initializers[collectionInitializer.Expressions.IndexOf(node)];
1767BoundExpression node = queryClause;
1785BoundExpression receiver = call.ReceiverOpt;
1831private static BoundExpression GetContainingArgument(ImmutableArray<BoundExpression> arguments, int position)
1833BoundExpression result = null;
1835foreach (var arg in arguments)
1837var expr = GetContainingExprOrQueryClause(arg, position);
1854private static BoundExpression GetContainingExprOrQueryClause(BoundExpression expr, int position)
1858var value = GetQueryClauseValue((BoundQueryClause)expr);
1871private static BoundExpression GetQueryClauseValue(BoundQueryClause queryClause)
Compiler\MethodBodySynthesizer.cs (12)
40BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true };
48arguments: ImmutableArray<BoundExpression>.Empty,
106ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.Create(slotIndex), intType) { WasCompilerGenerated = true }),
126ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.Create(0), intType) { WasCompilerGenerated = true }),
154ImmutableArray.Create<BoundExpression>(new BoundLiteral(syntax, ConstantValue.Create(targetSubmissionIndex), intType) { WasCompilerGenerated = true }),
180BoundExpression thisReference = null;
390BoundExpression delegateUpdate;
402arguments: ImmutableArray.Create<BoundExpression>(boundBackingField, boundParameter)),
467arguments: ImmutableArray.Create<BoundExpression>(boundTmps[1], boundParameter)),
481BoundExpression compareExchange = BoundCall.Synthesized(syntax,
485arguments: ImmutableArray.Create<BoundExpression>(boundBackingField, boundTmps[2], boundTmps[1]));
497BoundExpression loopExitCondition = new BoundBinaryOperator(syntax,
FlowAnalysis\AbstractFlowPass.cs (55)
364if (node is BoundExpression or BoundPattern)
550protected void VisitLvalue(BoundExpression node)
626protected void VisitCondition(BoundExpression node)
632private void AdjustConditionalState(BoundExpression node)
660protected virtual void VisitRvalue(BoundExpression node, bool isKnownToBeAnLvalue = false)
676protected static bool IsConstantTrue(BoundExpression node)
681protected static bool IsConstantFalse(BoundExpression node)
686protected static bool IsConstantNull(BoundExpression node)
1175(BoundExpression? construction, bool useBoolReturns, bool firstPartIsConditional) = data switch
1196protected virtual void VisitInterpolatedStringHandlerConstructor(BoundExpression? constructor)
1419private void VisitReceiverBeforeCall(BoundExpression receiverOpt, MethodSymbol method)
1427private void VisitReceiverAfterCall(BoundExpression receiverOpt, MethodSymbol method)
1516protected virtual void VisitArguments(ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> refKindsOpt, MethodSymbol method)
1523private void VisitArgumentsBeforeCall(ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> refKindsOpt)
1543private void VisitArgumentsAfterCall(ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> refKindsOpt, MethodSymbol method)
1571protected virtual void WriteArgument(BoundExpression arg, RefKind refKind, MethodSymbol method)
1577foreach (var child in node.ChildBoundNodes)
1579VisitRvalue(child as BoundExpression);
1595VisitRvalue(child as BoundExpression);
1604foreach (var child in node.Initializers)
1666protected void SplitIfBooleanConstant(BoundExpression node)
1740BoundExpression receiver = ((BoundMethodGroup)node.Operand).ReceiverOpt;
2084if (element is BoundExpression expression)
2114protected virtual void PropertySetter(BoundExpression node, BoundExpression receiver, MethodSymbol setter, BoundExpression value = null)
2122private bool RegularPropertyAccess(BoundExpression expr)
2231private void VisitFieldAccessInternal(BoundExpression receiverOpt, FieldSymbol fieldSymbol)
2357foreach (var i in node.Indices)
2409private void VisitBinaryLogicalOperatorChildren(BoundExpression node)
2412var stack = ArrayBuilder<BoundExpression>.GetInstance();
2414BoundExpression binary;
2415BoundExpression child = node;
2456BoundExpression right;
2497protected virtual void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression binary, BoundExpression right, bool isAnd, bool isBool, ref TLocalState leftTrue, ref TLocalState leftFalse)
2503protected void AfterRightChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression right, bool isAnd, bool isBool, ref TLocalState leftTrue, ref TLocalState leftFalse)
2628static bool isKnownNullOrNotNull(BoundExpression expr)
2727ReadOnlySpan<BoundExpression> parts;
2740foreach (var part in parts)
2824foreach (var expr in node.Bounds)
2972private bool TryVisitConditionalAccess(BoundExpression node, [NotNullWhen(true)] out TLocalState? stateWhenNotNull)
3023private bool VisitPossibleConditionalAccess(BoundExpression node, [NotNullWhen(true)] out TLocalState? stateWhenNotNull)
3082BoundExpression expr = node.AccessExpression;
3096Debug.Assert(expr is BoundExpression);
3156foreach (var se in sideEffects)
3247BoundExpression node,
3249BoundExpression condition,
3250BoundExpression consequence,
3251BoundExpression alternative)
3295private void VisitConditionalOperand(TLocalState state, BoundExpression operand, bool isByRef)
3420BoundExpression expr = node.ExpressionOpt;
3477protected void VisitAddressOfOperand(BoundExpression operand, bool shouldReadOperand)
3568private BoundNode VisitObjectOrCollectionInitializerExpression(ImmutableArray<BoundExpression> initializers)
3570foreach (var initializer in initializers)
FlowAnalysis\DefiniteAssignment.cs (21)
312protected override void VisitRvalue(BoundExpression node, bool isKnownToBeAnLvalue = false)
849protected virtual void NoteWrite(Symbol variable, BoundExpression value, bool read, bool isRef)
900internal static bool WriteConsideredUse(TypeSymbol type, BoundExpression value)
957private void NoteWrite(BoundExpression n, BoundExpression value, bool read, bool isRef)
1065protected override bool TryGetReceiverAndMember(BoundExpression expr, out BoundExpression receiver, out Symbol member)
1134protected bool MayRequireTracking(BoundExpression receiverOpt, FieldSymbol fieldSymbol)
1368protected virtual void CheckAssigned(BoundExpression expr, FieldSymbol fieldSymbol, SyntaxNode node)
1378private bool IsAssigned(BoundExpression node, out int unassignedSlot)
1481private Symbol UseNonFieldSymbolUnsafely(BoundExpression expression)
1516protected void Assign(BoundNode node, BoundExpression value, bool isRef = false, bool read = true)
1533protected virtual void AssignImpl(BoundNode node, BoundExpression value, bool isRef, bool written, bool read)
1650var expression = (BoundExpression)node;
1921foreach (var attributeArgument in boundAttribute.ConstructorArguments)
2521var initializer = node.Expression;
2539BoundExpression operand = node.Operand;
2567protected override void WriteArgument(BoundExpression arg, RefKind refKind, MethodSymbol method)
2590protected void CheckAssigned(BoundExpression expr, SyntaxNode node)
2681var exceptionSource = catchBlock.ExceptionSourceOpt;
FlowAnalysis\NullableWalker.cs (280)
216private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)>.Builder? _analyzedNullabilityMapOpt;
231private PooledDictionary<BoundExpression, TypeWithState>? _methodGroupReceiverMapOpt;
233private PooledDictionary<BoundValuePlaceholderBase, (BoundExpression? Replacement, VisitResult Result)>? _resultForPlaceholdersOpt;
242private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>? _targetTypedAnalysisCompletionOpt;
247/// The delegate is invoked by <see cref="VisitConversion(BoundConversion, BoundExpression, Conversion, TypeWithAnnotations, TypeWithState, bool, bool, bool, AssignmentKind, ParameterSymbol, bool, bool, bool, bool, Optional<LocalState>,bool, Location, ArrayBuilder<VisitResult>)"/>.
249private PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>> TargetTypedAnalysisCompletion
250=> _targetTypedAnalysisCompletionOpt ??= PooledDictionary<BoundExpression, Func<TypeWithAnnotations, TypeWithState>>.GetInstance();
296private void SetResultType(BoundExpression? expression, TypeWithState type, bool updateAnalyzedNullability = true)
301private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState type)
309private void UseRvalueOnly(BoundExpression? expression)
320private void SetLvalueResultType(BoundExpression? expression, TypeWithAnnotations type)
328private void UseLvalueOnly(BoundExpression? expression)
335private void SetResult(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool updateAnalyzedNullability = true, bool? isLvalue = null)
340private void SetResult(BoundExpression? expression, VisitResult visitResult, bool updateAnalyzedNullability, bool? isLvalue)
355private void SetAnalyzedNullability(BoundExpression? expression, TypeWithState resultType, TypeWithAnnotations lvalueType, bool? isLvalue = null)
363private void SetAnalyzedNullability(BoundExpression? expr, VisitResult result, bool? isLvalue = null)
426/// Used to allow <see cref="MakeSlot(BoundExpression)"/> to substitute the correct slot for a <see cref="BoundConditionalReceiver"/> when
460ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>.Builder? analyzedNullabilityMapOpt,
535private void AddPlaceholderReplacement(BoundValuePlaceholderBase placeholder, BoundExpression? expression, VisitResult result)
542_resultForPlaceholdersOpt ??= PooledDictionary<BoundValuePlaceholderBase, (BoundExpression? Replacement, VisitResult Result)>.GetInstance();
1497ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)> analyzedNullabilitiesMap;
1502private static (SnapshotManager?, ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>) AnalyzeWithSemanticInfo(
1512var analyzedNullabilities = ImmutableDictionary.CreateBuilder<BoundExpression, (NullabilityInfo, TypeSymbol?)>(EqualityComparer<BoundExpression>.Default, NullabilityInfoTypeComparer.Instance);
1569var analyzedNullabilities = ImmutableDictionary.CreateBuilder<BoundExpression, (NullabilityInfo, TypeSymbol?)>(EqualityComparer<BoundExpression>.Default, NullabilityInfoTypeComparer.Instance);
1608private static BoundNode Rewrite(ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)> updatedNullabilities, SnapshotManager? snapshotManager, BoundNode node, ref ImmutableDictionary<Symbol, Symbol>? remappedSymbols)
1730ImmutableDictionary<BoundExpression, (NullabilityInfo, TypeSymbol?)>.Builder? analyzedNullabilityMapOpt,
1939protected override bool TryGetReceiverAndMember(BoundExpression expr, out BoundExpression? receiver, [NotNullWhen(true)] out Symbol? member)
1997protected override int MakeSlot(BoundExpression node)
2017int makeSlot(BoundExpression node)
2040var operand = conv.Operand;
2094int getPlaceholderSlot(BoundExpression expr)
2195protected override void VisitRvalue(BoundExpression? node, bool isKnownToBeAnLvalue = false)
2209private void VisitRvalueEpilogue(BoundExpression? node)
2215private TypeWithState VisitRvalueWithState(BoundExpression? node)
2221private TypeWithAnnotations VisitLvalueWithAnnotations(BoundExpression node)
2297BoundExpression? value,
2319var unwrappedValue = SkipReferenceConversions(value);
2486private static bool IsDefaultValue(BoundExpression expr)
2519BoundExpression? valueOpt,
2882var expr = node.ExpressionOpt;
2951private TypeWithState VisitRefExpression(BoundExpression expr, TypeWithAnnotations destinationType)
3387var receiver = withExpr.Receiver;
3486var initializer = node.InitializerOpt;
3528Debug.Assert(node is BoundExpression or BoundPattern);
3532if (node is BoundExpression expr)
3540private void VisitExpressionWithoutStackGuardEpilogue(BoundExpression node)
3557bool shouldMakeNotNullRvalue(BoundExpression node) => node.IsSuppressed || node.HasAnyErrors || !IsReachable();
3716var iteratorBody = ((BoundExpressionStatement)spread.IteratorBody).Expression;
3726var elementExpr = (BoundExpression)element;
3952BoundExpression node, TypeSymbol type, MethodSymbol? constructor,
3953ImmutableArray<BoundExpression> arguments, ImmutableArray<VisitResult> argumentResults,
4004var operand = arguments[0];
4022BoundExpression node,
4023ImmutableArray<BoundExpression> arguments,
4049foreach (var initializer in objectInitializer.Initializers)
4064foreach (var initializer in collectionInitializer.Initializers)
4095var left = node.Left;
4408private void SetNotNullResult(BoundExpression node)
4413private void SetNotNullResultForLambda(BoundExpression node, LocalState stateForLambda)
4460private int GetOrCreatePlaceholderSlot(BoundExpression node)
4503var argument = arguments[i];
4547foreach (var expr in node.Bounds)
4567var expressions = ArrayBuilder<BoundExpression>.GetInstance(initialization.Initializers.Length);
4592var expressionsNoConversions = ArrayBuilder<BoundExpression>.GetInstance(n);
4595var placeholderBuilder = ArrayBuilder<BoundExpression>.GetInstance(n);
4599(BoundExpression expressionNoConversion, Conversion conversion) = RemoveConversion(expression, includeExplicitConversions: false);
4684internal static bool IsTargetTypedExpression(BoundExpression node)
4699ArrayBuilder<(BoundExpression expr, TypeWithAnnotations resultType, bool isChecked)> returns,
4722var placeholdersBuilder = ArrayBuilder<BoundExpression>.GetInstance(n);
4742BoundExpression placeholder = placeholders[i];
4763private static void GetArrayElements(BoundArrayInitialization node, ArrayBuilder<BoundExpression> builder)
4765foreach (var child in node.Initializers)
4792foreach (var i in node.Indices)
4965static bool isKnownNullOrNotNull(BoundExpression expr, TypeWithState resultType)
4971LocalState getUnconditionalStateWhenNotNull(BoundExpression otherOperand, PossiblyConditionalState conditionalStateWhenNotNull)
5059BoundExpression leftOperand,
5062BoundExpression rightOperand,
5072BoundExpression binary,
5076BoundExpression left,
5077BoundExpression leftOperand,
5080BoundExpression right,
5081BoundExpression rightOperand,
5108BoundExpression expr,
5109BoundExpression operand,
5149BoundExpression expr,
5150BoundExpression operand,
5189TypeSymbol? getTypeIfContainingType(TypeSymbol baseType, TypeSymbol? derivedType, BoundExpression operand)
5207BoundExpression leftOperand,
5225BoundExpression? operandComparedToNull = null;
5248BoundExpression? operandComparedToNonNull = null;
5278private void SplitAndLearnFromNonNullTest(BoundExpression operandComparedToNonNull, bool whenTrue)
5310private void GetSlotsToMarkAsNotNullable(BoundExpression operand, ArrayBuilder<int> slotBuilder)
5404private void LearnFromNonNullTest(BoundExpression expression, ref LocalState state)
5432private void LearnFromNullTest(BoundExpression expression, ref LocalState state)
5439var expressionWithoutConversion = RemoveConversion(expression, includeExplicitConversions: true).expression;
5525private static BoundExpression SkipReferenceConversions(BoundExpression possiblyConversion)
5546BoundExpression leftOperand = node.LeftOperand;
5547BoundExpression rightOperand = node.RightOperand;
5585BoundExpression leftOperand = node.LeftOperand;
5586BoundExpression rightOperand = node.RightOperand;
5681private bool TryVisitConditionalAccess(BoundExpression node, out PossiblyConditionalState stateWhenNotNull)
5717private bool VisitPossibleConditionalAccess(BoundExpression node, out PossiblyConditionalState stateWhenNotNull)
5750var receiver = node.Receiver;
5788BoundExpression expr = node.AccessExpression;
5805Debug.Assert(expr is BoundExpression);
5815Debug.Assert(expr is BoundExpression);
5849void makeAndAdjustReceiverSlot(BoundExpression receiver)
5871BoundExpression node,
5873BoundExpression condition,
5874BoundExpression originalConsequence,
5875BoundExpression originalAlternative)
5906BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(originalConsequence, consequenceLValue);
5907BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(originalAlternative, alternativeLValue);
5925(var consequence, var consequenceConversion, consequenceRValue) = visitConditionalOperand(consequenceState, originalConsequence);
5930(var alternative, var alternativeConversion, alternativeRValue) = visitConditionalOperand(alternativeState, originalAlternative);
5962BoundExpression consequencePlaceholder = CreatePlaceholderIfNecessary(consequence, consequenceRValue.ToTypeWithAnnotations(compilation));
5963BoundExpression alternativePlaceholder = CreatePlaceholderIfNecessary(alternative, alternativeRValue.ToTypeWithAnnotations(compilation));
6004BoundExpression node, BoundExpression originalConsequence, BoundExpression originalAlternative, LocalState consequenceState, LocalState alternativeState,
6005TypeWithState consequenceRValue, TypeWithState alternativeRValue, BoundExpression consequence, Conversion consequenceConversion, bool consequenceEndReachable,
6006BoundExpression alternative, Conversion alternativeConversion, bool alternativeEndReachable, TypeWithAnnotations resultTypeWithAnnotations, bool wasTargetTyped)
6048BoundExpression node,
6049BoundExpression originalConsequence,
6050BoundExpression originalAlternative,
6055BoundExpression consequence,
6058BoundExpression alternative,
6072(BoundExpression, Conversion, TypeWithState) visitConditionalOperand(LocalState state, BoundExpression operand)
6078BoundExpression operandNoConversion;
6085(TypeWithAnnotations LValueType, TypeWithState RValueType) visitConditionalRefOperand(LocalState state, BoundExpression operand)
6093void reportMismatchIfNecessary(BoundExpression node, TypeWithAnnotations source, TypeWithAnnotations destination)
6103BoundExpression node,
6104BoundExpression operand,
6154private static BoundExpression CreatePlaceholderIfNecessary(BoundExpression expr, TypeWithAnnotations type)
6334if (node.ReceiverOpt is BoundExpression receiver &&
6441void learnFromEqualsMethodArguments(BoundExpression left, TypeWithState leftType, BoundExpression right, TypeWithState rightType)
6483public readonly ImmutableArray<BoundExpression> Arguments;
6487public CompareExchangeInfo(ImmutableArray<BoundExpression> arguments, ImmutableArray<VisitResult> results, ImmutableArray<int> argsToParamsOpt)
6526var comparand = compareExchangeInfo.Arguments[comparandIndex];
6542private void CheckCallReceiver(BoundExpression? receiverOpt, TypeWithState receiverType, MethodSymbol method)
6708protected override void VisitArguments(ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> refKindsOpt, MethodSymbol method)
6715BoundExpression node,
6716ImmutableArray<BoundExpression> arguments,
6728BoundExpression node,
6729ImmutableArray<BoundExpression> arguments,
6744ImmutableArray<BoundExpression> arguments,
6765ImmutableArray<BoundExpression> arguments,
6790(ImmutableArray<BoundExpression> argumentsNoConversions, ImmutableArray<Conversion> conversions) = RemoveArgumentConversions(arguments, refKindsOpt);
6803ImmutableArray<BoundExpression> arguments,
6804ImmutableArray<BoundExpression> argumentsNoConversions,
6857var argumentNoConversion = argumentsNoConversions[i];
6858var argument = i < arguments.Length ? arguments[i] : argumentNoConversion;
6956var argument = arguments[i];
6958var argumentNoConversion = argumentsNoConversions[i];
6974ImmutableArray<BoundExpression> arguments,
6975ImmutableArray<BoundExpression> argumentsNoConversions,
6995static void expandParamsCollection(ref ImmutableArray<BoundExpression> arguments, ref ImmutableArray<RefKind> refKindsOpt, ImmutableArray<ParameterSymbol> parametersOpt, ref ImmutableArray<int> argsToParamsOpt, ref BitVector defaultArguments)
7005BoundExpression argument = arguments[a];
7009ImmutableArray<BoundExpression> elements;
7017elements = ((BoundCollectionExpression)((BoundConversion)argument).Operand).UnconvertedCollectionExpression.Elements.CastArray<BoundExpression>();
7038var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(arguments.Length + elements.Length - 1);
7070bool tryShortCircuitTargetTypedExpression(BoundExpression argument, BoundExpression argumentNoConversion)
7086private void ApplyMemberPostConditions(BoundExpression? receiverOpt, MethodSymbol? method)
7217ImmutableArray<BoundExpression> arguments,
7251private ImmutableArray<FlowAnalysisAnnotations> GetParametersAnnotations(ImmutableArray<BoundExpression> arguments, ImmutableArray<ParameterSymbol> parametersOpt, ImmutableArray<int> argsToParamsOpt, bool expanded)
7279private VisitResult VisitArgumentEvaluate(BoundExpression argument, RefKind refKind, FlowAnalysisAnnotations annotations)
7285private bool VisitArgumentEvaluateNeedsCloningState(BoundExpression argument)
7291private VisitResult VisitArgumentEvaluateEpilogue(BoundExpression argument, RefKind refKind, FlowAnalysisAnnotations annotations)
7344BoundExpression argumentNoConversion,
7431private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null)
7482BoundExpression argument,
7598void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations)
7688private void LearnFromPostConditions(BoundExpression argument, FlowAnalysisAnnotations parameterAnnotations)
7734private (ImmutableArray<BoundExpression> arguments, ImmutableArray<Conversion> conversions) RemoveArgumentConversions(
7735ImmutableArray<BoundExpression> arguments,
7742var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(n);
7748var argument = arguments[i];
7752var before = argument;
7817ImmutableArray<BoundExpression> arguments,
7880internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr)
7891private static NullableAnnotation GetNullableAnnotation(BoundExpression expr)
7926private ImmutableArray<BoundExpression> GetArgumentsForMethodTypeInference(ImmutableArray<VisitResult> argumentResults, ImmutableArray<BoundExpression> arguments)
7934var builder = ArrayBuilder<BoundExpression>.GetInstance(n);
7942BoundExpression getArgumentForMethodTypeInference(BoundExpression argument, VisitResult visitResult)
7966if (collection.Elements[i] is BoundExpression elementExpression)
8041private static (BoundExpression expression, Conversion conversion) RemoveConversion(BoundExpression expr, bool includeExplicitConversions)
8079private Conversion GenerateConversionForConditionalOperator(BoundExpression sourceExpression, TypeSymbol? sourceType, TypeSymbol destinationType, bool reportMismatch, bool isChecked)
8090private Conversion GenerateConversion(Conversions conversions, BoundExpression? sourceExpression, TypeSymbol? sourceType, TypeSymbol destinationType, bool fromExplicitCast, bool extensionMethodThisArgument, bool isChecked)
8119private bool UseExpressionForConversion([NotNullWhen(true)] BoundExpression? value)
8272(BoundExpression operand, Conversion conversion) = RemoveConversion(node, includeExplicitConversions: true);
8307private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind)
8320BoundExpression expr,
8327(BoundExpression operand, Conversion conversion) = RemoveConversion(expr, includeExplicitConversions: false);
8334BoundExpression expr,
8337BoundExpression operand,
8370Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType)
8462ImmutableArray<BoundExpression> values,
8493void trackState(BoundExpression value, FieldSymbol field, TypeWithState valueType)
8507private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot)
8522BoundExpression convertedNode,
8745private static BoundConversion? GetConversionIfApplicable(BoundExpression? conversionOpt, BoundExpression convertedNode)
8776BoundExpression conversionOperand,
9328BoundExpression conversionOperand,
9472private void SnapshotWalkerThroughConversionGroup(BoundExpression conversionExpression, BoundExpression convertedNode)
9491private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode)
9548BoundExpression node,
9614case BoundExpression arg when arg.Type is { TypeKind: TypeKind.Delegate }:
9726Action<NamedTypeSymbol>? visitDelegateArgument(NamedTypeSymbol delegateType, BoundExpression arg, bool isTargetTyped)
9740Action<NamedTypeSymbol>? analyzeDelegateConversion(NamedTypeSymbol delegateType, BoundExpression arg, bool isTargetTyped)
9760Action<NamedTypeSymbol> analyzeDelegateConversionAsContinuation(BoundExpression arg)
9770var receiverOpt = node.ReceiverOpt;
9784private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out TypeWithState type)
9799private void SetMethodGroupReceiverNullability(BoundExpression receiver, TypeWithState type)
9801_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression, TypeWithState>.GetInstance();
9807var receiverOpt = group.ReceiverOpt;
9817var arguments = ArrayBuilder<BoundExpression>.GetInstance();
9914private void VisitThisOrBaseReference(BoundExpression node)
9935var left = node.Left;
9936var right = node.Right;
10007private void AdjustSetValue(BoundExpression left, ref TypeWithState rightState)
10022private FlowAnalysisAnnotations GetLValueAnnotations(BoundExpression expr)
10083private static bool UseLegacyWarnings(BoundExpression expr)
10131private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt = null)
10145private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt)
10180ArrayBuilder<BoundExpression> placeholderArgs = ArrayBuilder<BoundExpression>.GetInstance(n + 1);
10216var nestedRight = CreatePlaceholderIfNecessary(invocation.Arguments[i + offset], parameter.TypeWithAnnotations);
10243private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right, TypeWithState? rightResultOpt)
10254var rightPart = rightParts[i];
10329internal readonly BoundExpression Expression;
10333internal DeconstructionVariable(BoundExpression expression, TypeWithAnnotations type)
10340internal DeconstructionVariable(BoundExpression expression, ArrayBuilder<DeconstructionVariable> nestedVariables)
10352foreach (var argument in arguments)
10358DeconstructionVariable getDeconstructionAssignmentVariable(BoundExpression expr)
10376private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr, TypeWithState? rightResultOpt)
10406return fields.SelectAsArray((f, e) => (BoundExpression)new BoundFieldAccess(e.Syntax, e, f, constantValueOpt: null), expr);
10576var initializer = node.Expression;
10598private void ReportArgumentWarnings(BoundExpression argument, TypeWithState argumentType, ParameterSymbol parameter)
10609private void ReportNullabilityMismatchInRefArgument(BoundExpression argument, TypeSymbol argumentType, ParameterSymbol parameter, TypeSymbol parameterType)
10687var receiverOpt = node.ReceiverOpt;
10755private Symbol VisitMemberAccess(BoundExpression node, BoundExpression? receiverOpt, Symbol member)
10858BoundExpression collectionExpression,
10860BoundExpression expr,
11180foreach (var child in node.ChildBoundNodes)
11191VisitRvalue(child as BoundExpression);
11352protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse)
11359BoundExpression? left = null;
11411private TypeWithState InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node, TypeWithState leftType, TypeWithState rightType)
11505var operand = node.Operand;
11649var receiver = node.Receiver;
11661var expr = node.Expression;
11665var receiverOpt = (expr as BoundMethodGroup)?.ReceiverOpt;
11681var receiverOpt = node.ReceiverOpt;
11766private void SetUnknownResultNullability(BoundExpression expression)
11773var receiver = node.Receiver;
11785private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, bool checkNullableValueType = false)
11790private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, TypeWithState resultType, bool checkNullableValueType)
11834private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter, TypeWithState result)
11901protected override void VisitInterpolatedStringHandlerConstructor(BoundExpression? constructor)
11970private void VisitThrow(BoundExpression? expr)
11989BoundExpression expr = node.Expression;
FlowAnalysis\NullableWalker.DebugVerifier.cs (12)
21private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> _analyzedNullabilityMap;
23private readonly HashSet<BoundExpression> _visitedExpressions = new HashSet<BoundExpression>();
26private DebugVerifier(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> analyzedNullabilityMap, SnapshotManager? snapshotManager)
37public static void Verify(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> analyzedNullabilityMap, SnapshotManager? snapshotManagerOpt, BoundNode node)
46foreach (var analyzedNode in verifier._analyzedNullabilityMap.Keys)
56foreach (var verifiedNode in verifier._visitedExpressions)
66private void VerifyExpression(BoundExpression expression, bool overrideSkippedExpression = false)
82if (node is BoundExpression expr)
98if (node is BoundExpression or BoundPattern)
162foreach (var child in node.ChildBoundNodes)
236foreach (var arg in enumeratorInfo.GetEnumeratorInfo.Arguments)
FlowAnalysis\ReadWriteWalker.cs (5)
132protected override void NoteWrite(Symbol variable, BoundExpression value, bool read, bool isRef)
139protected override void CheckAssigned(BoundExpression expr, FieldSymbol fieldSymbol, SyntaxNode node)
174var receiver = expr.ReceiverOpt;
178private void NoteExpressionReadOrWritten(BoundExpression receiver, HashSet<Symbol> readOrWritten)
231protected override void AssignImpl(BoundNode node, BoundExpression value, bool isRef, bool written, bool read)
Generated\BoundNodes.xml.Generated.cs (1049)
292protected BoundEqualsValue(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false)
304public BoundExpression Value { get; }
309public BoundFieldEqualsValue(SyntaxNode syntax, FieldSymbol field, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false)
325public BoundFieldEqualsValue Update(FieldSymbol field, ImmutableArray<LocalSymbol> locals, BoundExpression value)
339public BoundPropertyEqualsValue(SyntaxNode syntax, PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false)
355public BoundPropertyEqualsValue Update(PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value)
369public BoundParameterEqualsValue(SyntaxNode syntax, ParameterSymbol parameter, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false)
385public BoundParameterEqualsValue Update(ParameterSymbol parameter, ImmutableArray<LocalSymbol> locals, BoundExpression value)
500public BoundCapturedReceiverPlaceholder(SyntaxNode syntax, BoundExpression receiver, SafeContext localScopeDepth, TypeSymbol? type, bool hasErrors = false)
510public BoundExpression Receiver { get; }
516public BoundCapturedReceiverPlaceholder Update(BoundExpression receiver, SafeContext localScopeDepth, TypeSymbol? type)
952public BoundPassByCopy(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
961public BoundExpression Expression { get; }
966public BoundPassByCopy Update(BoundExpression expression, TypeSymbol? type)
980public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type, bool hasErrors = false)
994public ImmutableArray<BoundExpression> ChildBoundNodes { get; }
999public BoundBadExpression Update(LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type)
1069public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false)
1083public ImmutableArray<BoundExpression> BoundDimensionsOpt { get; }
1090public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type)
1183public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
1201public BoundExpression Operand { get; }
1211public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
1225public BoundIncrementOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
1246public BoundExpression Operand { get; }
1250public BoundExpression? OperandConversion { get; }
1252public BoundExpression? ResultConversion { get; }
1259public BoundIncrementOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, BoundValuePlaceholder? resultPlaceholder, BoundExpression? resultConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
1273public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, bool isManaged, TypeSymbol type, bool hasErrors = false)
1285public BoundExpression Operand { get; }
1291public BoundAddressOfOperator Update(BoundExpression operand, bool isManaged, TypeSymbol type)
1377public BoundPointerIndirectionOperator(SyntaxNode syntax, BoundExpression operand, bool refersToLocation, TypeSymbol type, bool hasErrors = false)
1389public BoundExpression Operand { get; }
1395public BoundPointerIndirectionOperator Update(BoundExpression operand, bool refersToLocation, TypeSymbol type)
1409public BoundPointerElementAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression index, bool @checked, bool refersToLocation, TypeSymbol type, bool hasErrors = false)
1424public BoundExpression Expression { get; }
1425public BoundExpression Index { get; }
1432public BoundPointerElementAccess Update(BoundExpression expression, BoundExpression index, bool @checked, bool refersToLocation, TypeSymbol type)
1446public BoundFunctionPointerInvocation(SyntaxNode syntax, BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
1461public BoundExpression InvokedExpression { get; }
1462public ImmutableArray<BoundExpression> Arguments { get; }
1469public BoundFunctionPointerInvocation Update(BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type)
1483public BoundRefTypeOperator(SyntaxNode syntax, BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false)
1495public BoundExpression Operand { get; }
1501public BoundRefTypeOperator Update(BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type)
1515public BoundMakeRefOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
1526public BoundExpression Operand { get; }
1531public BoundMakeRefOperator Update(BoundExpression operand, TypeSymbol type)
1545public BoundRefValueOperator(SyntaxNode syntax, NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type, bool hasErrors = false)
1558public BoundExpression Operand { get; }
1563public BoundRefValueOperator Update(NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type)
1577public BoundFromEndIndexExpression(SyntaxNode syntax, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false)
1589public BoundExpression Operand { get; }
1595public BoundFromEndIndexExpression Update(BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type)
1609public BoundRangeExpression(SyntaxNode syntax, BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false)
1621public BoundExpression? LeftOperandOpt { get; }
1622public BoundExpression? RightOperandOpt { get; }
1628public BoundRangeExpression Update(BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type)
1642protected BoundBinaryOperatorBase(BoundKind kind, SyntaxNode syntax, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
1655public BoundExpression Left { get; }
1656public BoundExpression Right { get; }
1661public BoundBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
1681public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type)
1695public BoundTupleBinaryOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type, bool hasErrors = false)
1711public BoundExpression Left { get; }
1712public BoundExpression Right { get; }
1719public BoundTupleBinaryOperator Update(BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type)
1733public BoundUserDefinedConditionalLogicalOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false)
1764public BoundUserDefinedConditionalLogicalOperator Update(BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type)
1778public BoundCompoundAssignmentOperator(SyntaxNode syntax, BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false)
1799public BoundExpression Left { get; }
1800public BoundExpression Right { get; }
1802public BoundExpression? LeftConversion { get; }
1804public BoundExpression? FinalConversion { get; }
1811public BoundCompoundAssignmentOperator Update(BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type)
1825public BoundAssignmentOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, bool isRef, TypeSymbol type, bool hasErrors = false)
1838public BoundExpression Left { get; }
1839public BoundExpression Right { get; }
1845public BoundAssignmentOperator Update(BoundExpression left, BoundExpression right, bool isRef, TypeSymbol type)
1894public BoundNullCoalescingOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, bool @checked, TypeSymbol type, bool hasErrors = false)
1911public BoundExpression LeftOperand { get; }
1912public BoundExpression RightOperand { get; }
1914public BoundExpression? LeftConversion { get; }
1921public BoundNullCoalescingOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, bool @checked, TypeSymbol type)
1935public BoundNullCoalescingAssignmentOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type, bool hasErrors = false)
1946public BoundExpression LeftOperand { get; }
1947public BoundExpression RightOperand { get; }
1952public BoundNullCoalescingAssignmentOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type)
1966public BoundUnconvertedConditionalOperator(SyntaxNode syntax, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, ErrorCode noCommonTypeError, bool hasErrors = false)
1982public BoundExpression Condition { get; }
1983public BoundExpression Consequence { get; }
1984public BoundExpression Alternative { get; }
1991public BoundUnconvertedConditionalOperator Update(BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, ErrorCode noCommonTypeError)
2005public BoundConditionalOperator(SyntaxNode syntax, bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
2025public BoundExpression Condition { get; }
2026public BoundExpression Consequence { get; }
2027public BoundExpression Alternative { get; }
2035public BoundConditionalOperator Update(bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, TypeSymbol type)
2049public BoundArrayAccess(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> indices, TypeSymbol type, bool hasErrors = false)
2062public BoundExpression Expression { get; }
2063public ImmutableArray<BoundExpression> Indices { get; }
2068public BoundArrayAccess Update(BoundExpression expression, ImmutableArray<BoundExpression> indices, TypeSymbol type)
2111public BoundArrayLength(SyntaxNode syntax, BoundExpression expression, TypeSymbol type, bool hasErrors = false)
2122public BoundExpression Expression { get; }
2127public BoundArrayLength Update(BoundExpression expression, TypeSymbol type)
2141public BoundAwaitableInfo(SyntaxNode syntax, BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, bool hasErrors = false)
2153public BoundExpression? GetAwaiter { get; }
2160public BoundAwaitableInfo Update(BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult)
2174public BoundAwaitExpression(SyntaxNode syntax, BoundExpression expression, BoundAwaitableInfo awaitableInfo, BoundAwaitExpressionDebugInfo debugInfo, TypeSymbol type, bool hasErrors = false)
2188public BoundExpression Expression { get; }
2195public BoundAwaitExpression Update(BoundExpression expression, BoundAwaitableInfo awaitableInfo, BoundAwaitExpressionDebugInfo debugInfo, TypeSymbol type)
2848public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false)
2862public BoundExpression Operand { get; }
2869public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type)
2883public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type, bool hasErrors = false)
2898public BoundExpression Operand { get; }
2901public BoundExpression? OperandConversion { get; }
2906public BoundAsOperator Update(BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type)
2952public BoundConversion(SyntaxNode syntax, BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, ImmutableArray<MethodSymbol> originalUserDefinedConversionsOpt, TypeSymbol type, bool hasErrors = false)
2970public BoundExpression Operand { get; }
2982public BoundConversion Update(BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, ImmutableArray<MethodSymbol> originalUserDefinedConversionsOpt, TypeSymbol type)
2996public BoundReadOnlySpanFromArray(SyntaxNode syntax, BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type, bool hasErrors = false)
3009public BoundExpression Operand { get; }
3015public BoundReadOnlySpanFromArray Update(BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type)
3064public BoundArgListOperator(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, TypeSymbol? type, bool hasErrors = false)
3075public ImmutableArray<BoundExpression> Arguments { get; }
3081public BoundArgListOperator Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, TypeSymbol? type)
3095public BoundFixedLocalCollectionInitializer(SyntaxNode syntax, TypeSymbol elementPointerType, BoundValuePlaceholder? elementPointerPlaceholder, BoundExpression? elementPointerConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type, bool hasErrors = false)
3113public BoundExpression? ElementPointerConversion { get; }
3114public BoundExpression Expression { get; }
3120public BoundFixedLocalCollectionInitializer Update(TypeSymbol elementPointerType, BoundValuePlaceholder? elementPointerPlaceholder, BoundExpression? elementPointerConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type)
3401public BoundLocalDeclaration(SyntaxNode syntax, LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType, bool hasErrors = false)
3416public BoundExpression? InitializerOpt { get; }
3417public ImmutableArray<BoundExpression> ArgumentsOpt { get; }
3423public BoundLocalDeclaration Update(LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType)
3570public BoundReturnStatement(SyntaxNode syntax, RefKind refKind, BoundExpression? expressionOpt, bool @checked, bool hasErrors = false)
3579public BoundExpression? ExpressionOpt { get; }
3585public BoundReturnStatement Update(RefKind refKind, BoundExpression? expressionOpt, bool @checked)
3599public BoundYieldReturnStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false)
3608public BoundExpression Expression { get; }
3613public BoundYieldReturnStatement Update(BoundExpression expression)
3644public BoundThrowStatement(SyntaxNode syntax, BoundExpression? expressionOpt, bool hasErrors = false)
3650public BoundExpression? ExpressionOpt { get; }
3655public BoundThrowStatement Update(BoundExpression? expressionOpt)
3669public BoundExpressionStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false)
3678public BoundExpression Expression { get; }
3683public BoundExpressionStatement Update(BoundExpression expression)
3771public BoundSwitchStatement(SyntaxNode syntax, BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<LocalFunctionSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel, bool hasErrors = false)
3791public BoundExpression Expression { get; }
3802public BoundSwitchStatement Update(BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<LocalFunctionSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel)
3816public BoundSwitchDispatch(SyntaxNode syntax, BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt, bool hasErrors = false)
3830public BoundExpression Expression { get; }
3838public BoundSwitchDispatch Update(BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt)
3852public BoundIfStatement(SyntaxNode syntax, BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt, bool hasErrors = false)
3864public BoundExpression Condition { get; }
3871public BoundIfStatement Update(BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt)
3913protected BoundConditionalLoopStatement(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
3929public BoundExpression Condition { get; }
3935public BoundDoStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
3951public BoundDoStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
3965public BoundWhileStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
3981public BoundWhileStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
3995public BoundForStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
4016public BoundExpression? Condition { get; }
4023public BoundForStatement Update(ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
4037public BoundForEachStatement(SyntaxNode syntax, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false)
4062public BoundExpression? ElementConversion { get; }
4065public BoundExpression? IterationErrorExpressionOpt { get; }
4066public BoundExpression Expression { get; }
4074public BoundForEachStatement Update(ForEachEnumeratorInfo? enumeratorInfoOpt, BoundValuePlaceholder? elementPlaceholder, BoundExpression? elementConversion, BoundTypeExpression iterationVariableType, ImmutableArray<LocalSymbol> iterationVariables, BoundExpression? iterationErrorExpressionOpt, BoundExpression expression, BoundForEachDeconstructStep? deconstructionOpt, BoundAwaitableInfo? awaitOpt, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel)
4119public BoundUsingStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt, bool hasErrors = false)
4136public BoundExpression? ExpressionOpt { get; }
4144public BoundUsingStatement Update(ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt)
4192public BoundLockStatement(SyntaxNode syntax, BoundExpression argument, BoundStatement body, bool hasErrors = false)
4203public BoundExpression Argument { get; }
4209public BoundLockStatement Update(BoundExpression argument, BoundStatement body)
4260public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false)
4277public BoundExpression? ExceptionSourceOpt { get; }
4280public BoundExpression? ExceptionFilterOpt { get; }
4287public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll)
4600public BoundRangeVariable(SyntaxNode syntax, RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type, bool hasErrors = false)
4614public BoundExpression Value { get; }
4619public BoundRangeVariable Update(RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type)
4710public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt, bool hasErrors = false)
4722public BoundExpression? CaseExpressionOpt { get; }
4728public BoundGotoStatement Update(LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt)
4847public BoundConditionalGoto(SyntaxNode syntax, BoundExpression condition, bool jumpIfTrue, LabelSymbol label, bool hasErrors = false)
4859public BoundExpression Condition { get; }
4866public BoundConditionalGoto Update(BoundExpression condition, bool jumpIfTrue, LabelSymbol label)
4880protected BoundSwitchExpression(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false)
4895public BoundExpression Expression { get; }
4904public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false)
4922public BoundExpression? WhenClause { get; }
4923public BoundExpression Value { get; }
4929public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label)
4943public BoundUnconvertedSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false)
4957public BoundUnconvertedSwitchExpression Update(BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type)
4971public BoundConvertedSwitchExpression(SyntaxNode syntax, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false)
4991public BoundConvertedSwitchExpression Update(TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type)
5112public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse, bool hasErrors = false)
5126public BoundExpression? WhenExpression { get; }
5133public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse)
5534public BoundDagIndexerEvaluation(SyntaxNode syntax, TypeSymbol indexerType, BoundDagTemp lengthTemp, int index, BoundExpression indexerAccess, BoundListPatternReceiverPlaceholder receiverPlaceholder, BoundListPatternIndexPlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false)
5560public BoundExpression IndexerAccess { get; }
5567public BoundDagIndexerEvaluation Update(TypeSymbol indexerType, BoundDagTemp lengthTemp, int index, BoundExpression indexerAccess, BoundListPatternReceiverPlaceholder receiverPlaceholder, BoundListPatternIndexPlaceholder argumentPlaceholder, BoundDagTemp input)
5581public BoundDagSliceEvaluation(SyntaxNode syntax, TypeSymbol sliceType, BoundDagTemp lengthTemp, int startIndex, int endIndex, BoundExpression indexerAccess, BoundSlicePatternReceiverPlaceholder receiverPlaceholder, BoundSlicePatternRangePlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false)
5609public BoundExpression IndexerAccess { get; }
5616public BoundDagSliceEvaluation Update(TypeSymbol sliceType, BoundDagTemp lengthTemp, int startIndex, int endIndex, BoundExpression indexerAccess, BoundSlicePatternReceiverPlaceholder receiverPlaceholder, BoundSlicePatternRangePlaceholder argumentPlaceholder, BoundDagTemp input)
5691public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause, bool hasErrors = false)
5705public BoundExpression? WhenClause { get; }
5710public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause)
5724protected BoundMethodOrPropertyGroup(BoundKind kind, SyntaxNode syntax, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
5732public BoundExpression? ReceiverOpt { get; }
5738public BoundSequencePointExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
5747public BoundExpression Expression { get; }
5752public BoundSequencePointExpression Update(BoundExpression expression, TypeSymbol? type)
5766public BoundSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false)
5782public ImmutableArray<BoundExpression> SideEffects { get; }
5783public BoundExpression Value { get; }
5788public BoundSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type)
5802public BoundSpillSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false)
5819public BoundExpression Value { get; }
5824public BoundSpillSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type)
5838public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false)
5854public BoundExpression Receiver { get; }
5863public BoundDynamicMemberAccess Update(BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type)
5877protected BoundDynamicInvocableBase(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol? type, bool hasErrors = false)
5888public BoundExpression Expression { get; }
5889public ImmutableArray<BoundExpression> Arguments { get; }
5894public BoundDynamicInvocation(SyntaxNode syntax, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false)
5916public BoundDynamicInvocation Update(ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type)
5930public BoundConditionalAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type, bool hasErrors = false)
5943public BoundExpression Receiver { get; }
5944public BoundExpression AccessExpression { get; }
5949public BoundConditionalAccess Update(BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type)
5963public BoundLoweredConditionalAccess(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, bool forceCopyOfNullableValueType, TypeSymbol type, bool hasErrors = false)
5980public BoundExpression Receiver { get; }
5982public BoundExpression WhenNotNull { get; }
5983public BoundExpression? WhenNullOpt { get; }
5990public BoundLoweredConditionalAccess Update(BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, bool forceCopyOfNullableValueType, TypeSymbol type)
6042public BoundComplexConditionalReceiver(SyntaxNode syntax, BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type, bool hasErrors = false)
6055public BoundExpression ValueTypeReceiver { get; }
6056public BoundExpression ReferenceTypeReceiver { get; }
6061public BoundComplexConditionalReceiver Update(BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type)
6075public BoundMethodGroup(SyntaxNode syntax, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
6102public BoundMethodGroup Update(ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind)
6116public BoundPropertyGroup(SyntaxNode syntax, ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false)
6130public BoundPropertyGroup Update(ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind)
6144public BoundCall(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalMethodsOpt, TypeSymbol type, bool hasErrors = false)
6168public BoundExpression? ReceiverOpt { get; }
6171public ImmutableArray<BoundExpression> Arguments { get; }
6185public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool isDelegateCall, bool expanded, bool invokedAsExtensionMethod, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalMethodsOpt, TypeSymbol type)
6199public BoundEventAssignmentOperator(SyntaxNode syntax, EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type, bool hasErrors = false)
6218public BoundExpression? ReceiverOpt { get; }
6219public BoundExpression Argument { get; }
6224public BoundEventAssignmentOperator Update(EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type)
6238public BoundAttribute(SyntaxNode syntax, MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
6258public ImmutableArray<BoundExpression> ConstructorArguments { get; }
6269public BoundAttribute Update(MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type)
6283public BoundUnconvertedObjectCreationExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder, bool hasErrors = false)
6298public ImmutableArray<BoundExpression> Arguments { get; }
6307public BoundUnconvertedObjectCreationExpression Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder)
6342public BoundObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<MethodSymbol> constructorsGroup, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ConstantValue? constantValueOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
6366public override ImmutableArray<BoundExpression> Arguments { get; }
6379public BoundObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<MethodSymbol> constructorsGroup, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ConstantValue? constantValueOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, bool wasTargetTyped, TypeSymbol type)
6434public BoundCollectionExpression(SyntaxNode syntax, CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, bool wasTargetTyped, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type, bool hasErrors = false)
6455public BoundExpression? CollectionCreation { get; }
6458public BoundExpression? CollectionBuilderInvocationConversion { get; }
6465public BoundCollectionExpression Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, bool wasTargetTyped, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type)
6507public BoundCollectionExpressionSpreadElement(SyntaxNode syntax, BoundExpression expression, BoundCollectionExpressionSpreadExpressionPlaceholder? expressionPlaceholder, BoundExpression? conversion, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundExpression? lengthOrCount, BoundValuePlaceholder? elementPlaceholder, BoundStatement? iteratorBody, bool hasErrors = false)
6522public BoundExpression Expression { get; }
6524public BoundExpression? Conversion { get; }
6526public BoundExpression? LengthOrCount { get; }
6533public BoundCollectionExpressionSpreadElement Update(BoundExpression expression, BoundCollectionExpressionSpreadExpressionPlaceholder? expressionPlaceholder, BoundExpression? conversion, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundExpression? lengthOrCount, BoundValuePlaceholder? elementPlaceholder, BoundStatement? iteratorBody)
6547protected BoundTupleExpression(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
6558public ImmutableArray<BoundExpression> Arguments { get; }
6565public BoundTupleLiteral(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
6578public BoundTupleLiteral Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type)
6592public BoundConvertedTupleLiteral(SyntaxNode syntax, BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false)
6608public BoundConvertedTupleLiteral Update(BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type)
6622public BoundDynamicObjectCreationExpression(SyntaxNode syntax, string name, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray<MethodSymbol> applicableMethods, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
6641public override ImmutableArray<BoundExpression> Arguments { get; }
6651public BoundDynamicObjectCreationExpression Update(string name, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray<MethodSymbol> applicableMethods, bool wasTargetTyped, TypeSymbol type)
6697protected BoundObjectInitializerExpressionBase(BoundKind kind, SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false)
6711public ImmutableArray<BoundExpression> Initializers { get; }
6716public BoundObjectInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false)
6730public BoundObjectInitializerExpression Update(BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type)
6744public BoundObjectInitializerMember(SyntaxNode syntax, Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type, bool hasErrors = false)
6766public ImmutableArray<BoundExpression> Arguments { get; }
6779public BoundObjectInitializerMember Update(Symbol? memberSymbol, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, LookupResultKind resultKind, AccessorKind accessorKind, TypeSymbol receiverType, TypeSymbol type)
6838public BoundCollectionInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false)
6852public BoundCollectionInitializerExpression Update(BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type)
6866public BoundCollectionElementInitializer(SyntaxNode syntax, MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
6886public ImmutableArray<BoundExpression> Arguments { get; }
6887public BoundExpression? ImplicitReceiverOpt { get; }
6897public BoundCollectionElementInitializer Update(MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type)
6911public BoundDynamicCollectionElementInitializer(SyntaxNode syntax, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false)
6929public BoundDynamicCollectionElementInitializer Update(ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type)
6978public BoundAnonymousObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<BoundAnonymousPropertyDeclaration> declarations, TypeSymbol type, bool hasErrors = false)
6994public ImmutableArray<BoundExpression> Arguments { get; }
7000public BoundAnonymousObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<BoundAnonymousPropertyDeclaration> declarations, TypeSymbol type)
7084public BoundDelegateCreationExpression(SyntaxNode syntax, BoundExpression argument, MethodSymbol? methodOpt, bool isExtensionMethod, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false)
7098public BoundExpression Argument { get; }
7106public BoundDelegateCreationExpression Update(BoundExpression argument, MethodSymbol? methodOpt, bool isExtensionMethod, bool wasTargetTyped, TypeSymbol type)
7120public BoundArrayCreation(SyntaxNode syntax, ImmutableArray<BoundExpression> bounds, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false)
7132public ImmutableArray<BoundExpression> Bounds { get; }
7138public BoundArrayCreation Update(ImmutableArray<BoundExpression> bounds, BoundArrayInitialization? initializerOpt, TypeSymbol type)
7152public BoundArrayInitialization(SyntaxNode syntax, bool isInferred, ImmutableArray<BoundExpression> initializers, bool hasErrors = false)
7164public ImmutableArray<BoundExpression> Initializers { get; }
7169public BoundArrayInitialization Update(bool isInferred, ImmutableArray<BoundExpression> initializers)
7183protected BoundStackAllocArrayCreationBase(BoundKind kind, SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false)
7196public BoundExpression Count { get; }
7202public BoundStackAllocArrayCreation(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false)
7215public BoundStackAllocArrayCreation Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type)
7229public BoundConvertedStackAllocExpression(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false)
7244public BoundConvertedStackAllocExpression Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol type)
7258public BoundFieldAccess(SyntaxNode syntax, BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type, bool hasErrors = false)
7274public BoundExpression? ReceiverOpt { get; }
7284public BoundFieldAccess Update(BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type)
7338public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
7353public BoundExpression? ReceiverOpt { get; }
7362public BoundPropertyAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type)
7376public BoundEventAccess(SyntaxNode syntax, BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false)
7390public BoundExpression? ReceiverOpt { get; }
7398public BoundEventAccess Update(BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type)
7412public BoundIndexerAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol indexer, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, AccessorKind accessorKind, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ImmutableArray<PropertySymbol> originalIndexersOpt, TypeSymbol type, bool hasErrors = false)
7434public BoundExpression? ReceiverOpt { get; }
7437public ImmutableArray<BoundExpression> Arguments { get; }
7449public BoundIndexerAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol indexer, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, bool expanded, AccessorKind accessorKind, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, ImmutableArray<PropertySymbol> originalIndexersOpt, TypeSymbol type)
7463public BoundImplicitIndexerAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression argument, BoundExpression lengthOrCountAccess, BoundImplicitIndexerReceiverPlaceholder receiverPlaceholder, BoundExpression indexerOrSliceAccess, ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders, TypeSymbol type, bool hasErrors = false)
7488public BoundExpression Receiver { get; }
7489public BoundExpression Argument { get; }
7490public BoundExpression LengthOrCountAccess { get; }
7492public BoundExpression IndexerOrSliceAccess { get; }
7498public BoundImplicitIndexerAccess Update(BoundExpression receiver, BoundExpression argument, BoundExpression lengthOrCountAccess, BoundImplicitIndexerReceiverPlaceholder receiverPlaceholder, BoundExpression indexerOrSliceAccess, ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders, TypeSymbol type)
7512public BoundInlineArrayAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression argument, bool isValue, WellKnownMember getItemOrSliceHelper, TypeSymbol type, bool hasErrors = false)
7531public BoundExpression Expression { get; }
7532public BoundExpression Argument { get; }
7539public BoundInlineArrayAccess Update(BoundExpression expression, BoundExpression argument, bool isValue, WellKnownMember getItemOrSliceHelper, TypeSymbol type)
7553public BoundDynamicIndexerAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type, bool hasErrors = false)
7570public BoundExpression Receiver { get; }
7571public ImmutableArray<BoundExpression> Arguments { get; }
7579public BoundDynamicIndexerAccess Update(BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type)
7677public BoundQueryClause(SyntaxNode syntax, BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type, bool hasErrors = false)
7694public BoundExpression Value { get; }
7696public BoundExpression? Operation { get; }
7697public BoundExpression? Cast { get; }
7699public BoundExpression? UnoptimizedForm { get; }
7704public BoundQueryClause Update(BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type)
7744public BoundNameOfOperator(SyntaxNode syntax, BoundExpression argument, ConstantValue constantValueOpt, TypeSymbol type, bool hasErrors = false)
7757public BoundExpression Argument { get; }
7763public BoundNameOfOperator Update(BoundExpression argument, ConstantValue constantValueOpt, TypeSymbol type)
7777protected BoundInterpolatedStringBase(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false)
7787public ImmutableArray<BoundExpression> Parts { get; }
7793public BoundUnconvertedInterpolatedString(SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false)
7805public BoundUnconvertedInterpolatedString Update(ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type)
7819public BoundInterpolatedString(SyntaxNode syntax, InterpolatedStringHandlerData? interpolationData, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false)
7833public BoundInterpolatedString Update(InterpolatedStringHandlerData? interpolationData, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type)
7913public BoundStringInsert(SyntaxNode syntax, BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall, bool hasErrors = false)
7926public BoundExpression Value { get; }
7927public BoundExpression? Alignment { get; }
7934public BoundStringInsert Update(BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall)
7948public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false)
7966public BoundExpression Expression { get; }
7976public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type)
8018public BoundConstantPattern(SyntaxNode syntax, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8031public BoundExpression Value { get; }
8037public BoundConstantPattern Update(BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType)
8087protected BoundObjectPattern(BoundKind kind, SyntaxNode syntax, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8099public BoundExpression? VariableAccess { get; }
8104public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8122public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType)
8136public BoundRecursivePattern(SyntaxNode syntax, BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8159public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType)
8173public BoundListPattern(SyntaxNode syntax, ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8195public BoundExpression? LengthAccess { get; }
8196public BoundExpression? IndexerAccess { get; }
8203public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType)
8217public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8235public BoundExpression? IndexerAccess { get; }
8242public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType)
8493public BoundRelationalPattern(SyntaxNode syntax, BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false)
8508public BoundExpression Value { get; }
8514public BoundRelationalPattern Update(BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType)
8563public BoundThrowExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false)
8572public BoundExpression Expression { get; }
8577public BoundThrowExpression Update(BoundExpression expression, TypeSymbol? type)
8591protected VariablePendingInference(BoundKind kind, SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false)
8603public BoundExpression? ReceiverOpt { get; }
8608public OutVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false)
8620public OutVariablePendingInference Update(Symbol variableSymbol, BoundExpression? receiverOpt)
8634public DeconstructionVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false)
8646public DeconstructionVariablePendingInference Update(Symbol variableSymbol, BoundExpression? receiverOpt)
8761public BoundExpressionWithNullability(SyntaxNode syntax, BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type, bool hasErrors = false)
8771public BoundExpression Expression { get; }
8778public BoundExpressionWithNullability Update(BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type)
8792public BoundWithExpression(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? cloneMethod, BoundObjectInitializerExpressionBase initializerExpression, TypeSymbol type, bool hasErrors = false)
8806public BoundExpression Receiver { get; }
8813public BoundWithExpression Update(BoundExpression receiver, MethodSymbol? cloneMethod, BoundObjectInitializerExpressionBase initializerExpression, TypeSymbol type)
10802BoundExpression value = (BoundExpression)this.Visit(node.Value);
10807BoundExpression value = (BoundExpression)this.Visit(node.Value);
10812BoundExpression value = (BoundExpression)this.Visit(node.Value);
10827BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
10893BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
10899ImmutableArray<BoundExpression> childBoundNodes = this.VisitList(node.ChildBoundNodes);
10916ImmutableArray<BoundExpression> boundDimensionsOpt = this.VisitList(node.BoundDimensionsOpt);
10932BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
10939BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
10941BoundExpression? operandConversion = node.OperandConversion;
10943BoundExpression? resultConversion = node.ResultConversion;
10950BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
10968BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
10974BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
10975BoundExpression index = (BoundExpression)this.Visit(node.Index);
10981BoundExpression invokedExpression = (BoundExpression)this.Visit(node.InvokedExpression);
10982ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
10988BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
10994BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
11000BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
11006BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
11012BoundExpression? leftOperandOpt = (BoundExpression?)this.Visit(node.LeftOperandOpt);
11013BoundExpression? rightOperandOpt = (BoundExpression?)this.Visit(node.RightOperandOpt);
11019BoundExpression left = (BoundExpression)this.Visit(node.Left);
11020BoundExpression right = (BoundExpression)this.Visit(node.Right);
11026BoundExpression left = (BoundExpression)this.Visit(node.Left);
11027BoundExpression right = (BoundExpression)this.Visit(node.Right);
11033BoundExpression left = (BoundExpression)this.Visit(node.Left);
11034BoundExpression right = (BoundExpression)this.Visit(node.Right);
11041BoundExpression left = (BoundExpression)this.Visit(node.Left);
11042BoundExpression right = (BoundExpression)this.Visit(node.Right);
11044BoundExpression? leftConversion = node.LeftConversion;
11046BoundExpression? finalConversion = node.FinalConversion;
11052BoundExpression left = (BoundExpression)this.Visit(node.Left);
11053BoundExpression right = (BoundExpression)this.Visit(node.Right);
11066BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand);
11067BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand);
11069BoundExpression? leftConversion = node.LeftConversion;
11075BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand);
11076BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand);
11082BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
11083BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence);
11084BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative);
11090BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
11091BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence);
11092BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative);
11099BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11100ImmutableArray<BoundExpression> indices = this.VisitList(node.Indices);
11112BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11119BoundExpression? getAwaiter = (BoundExpression?)this.Visit(node.GetAwaiter);
11124BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11219BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
11226BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
11229BoundExpression? operandConversion = node.OperandConversion;
11241BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
11247BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
11258ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11265BoundExpression? elementPointerConversion = node.ElementPointerConversion;
11266BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11303BoundExpression? initializerOpt = (BoundExpression?)this.Visit(node.InitializerOpt);
11304ImmutableArray<BoundExpression> argumentsOpt = this.VisitList(node.ArgumentsOpt);
11327BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt);
11332BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11338BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt);
11343BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11350BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11358BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11363BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
11370BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
11376BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
11383BoundExpression? condition = (BoundExpression?)this.Visit(node.Condition);
11391BoundExpression? elementConversion = node.ElementConversion;
11393BoundExpression? iterationErrorExpressionOpt = (BoundExpression?)this.Visit(node.IterationErrorExpressionOpt);
11394BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11409BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt);
11422BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
11435BoundExpression? exceptionSourceOpt = (BoundExpression?)this.Visit(node.ExceptionSourceOpt);
11437BoundExpression? exceptionFilterOpt = (BoundExpression?)this.Visit(node.ExceptionFilterOpt);
11484BoundExpression value = (BoundExpression)this.Visit(node.Value);
11496BoundExpression? caseExpressionOpt = (BoundExpression?)this.Visit(node.CaseExpressionOpt);
11517BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
11523BoundExpression? whenClause = (BoundExpression?)this.Visit(node.WhenClause);
11524BoundExpression value = (BoundExpression)this.Visit(node.Value);
11529BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11537BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11564BoundExpression? whenExpression = (BoundExpression?)this.Visit(node.WhenExpression);
11631BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess);
11641BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess);
11663BoundExpression? whenClause = (BoundExpression?)this.Visit(node.WhenClause);
11668BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11674ImmutableArray<BoundExpression> sideEffects = this.VisitList(node.SideEffects);
11675BoundExpression value = (BoundExpression)this.Visit(node.Value);
11682BoundExpression value = (BoundExpression)this.Visit(node.Value);
11688BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
11694BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11695ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11701BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
11702BoundExpression accessExpression = (BoundExpression)this.Visit(node.AccessExpression);
11708BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
11709BoundExpression whenNotNull = (BoundExpression)this.Visit(node.WhenNotNull);
11710BoundExpression? whenNullOpt = (BoundExpression?)this.Visit(node.WhenNullOpt);
11721BoundExpression valueTypeReceiver = (BoundExpression)this.Visit(node.ValueTypeReceiver);
11722BoundExpression referenceTypeReceiver = (BoundExpression)this.Visit(node.ReferenceTypeReceiver);
11728BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11734BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11740BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11741ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11747BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11748BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
11754ImmutableArray<BoundExpression> constructorArguments = this.VisitList(node.ConstructorArguments);
11761ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11767ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11781BoundExpression? collectionCreation = node.CollectionCreation;
11783BoundExpression? collectionBuilderInvocationConversion = node.CollectionBuilderInvocationConversion;
11796BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11798BoundExpression? conversion = node.Conversion;
11799BoundExpression? lengthOrCount = node.LengthOrCount;
11806ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11813ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11819ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11833ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers);
11839ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11853ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers);
11859ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11860BoundExpression? implicitReceiverOpt = (BoundExpression?)this.Visit(node.ImplicitReceiverOpt);
11866BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11867ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11878ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11896BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
11902ImmutableArray<BoundExpression> bounds = this.VisitList(node.Bounds);
11909ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers);
11915BoundExpression count = (BoundExpression)this.Visit(node.Count);
11923BoundExpression count = (BoundExpression)this.Visit(node.Count);
11931BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11942BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11948BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11954BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
11955ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11961BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
11962BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
11963BoundExpression lengthOrCountAccess = node.LengthOrCountAccess;
11965BoundExpression indexerOrSliceAccess = node.IndexerOrSliceAccess;
11972BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
11973BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
11979BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
11980ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
11998BoundExpression value = (BoundExpression)this.Visit(node.Value);
11999BoundExpression? operation = node.Operation;
12000BoundExpression? cast = node.Cast;
12001BoundExpression? unoptimizedForm = node.UnoptimizedForm;
12012BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
12018ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts);
12024ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts);
12040BoundExpression value = (BoundExpression)this.Visit(node.Value);
12041BoundExpression? alignment = (BoundExpression?)this.Visit(node.Alignment);
12048BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
12056BoundExpression value = (BoundExpression)this.Visit(node.Value);
12070BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess);
12080BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess);
12088BoundExpression? lengthAccess = node.LengthAccess;
12089BoundExpression? indexerAccess = node.IndexerAccess;
12092BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess);
12100BoundExpression? indexerAccess = node.IndexerAccess;
12155BoundExpression value = (BoundExpression)this.Visit(node.Value);
12167BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
12173BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
12179BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
12203BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
12209BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
12218private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> _updatedNullabilities;
12222public NullabilityRewriter(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> updatedNullabilities, NullableWalker.SnapshotManager? snapshotManager, ImmutableDictionary<Symbol, Symbol>.Builder remappedSymbols)
12233BoundExpression value = (BoundExpression)this.Visit(node.Value);
12241BoundExpression value = (BoundExpression)this.Visit(node.Value);
12249BoundExpression value = (BoundExpression)this.Visit(node.Value);
12267BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
12433BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
12451ImmutableArray<BoundExpression> childBoundNodes = this.VisitList(node.ChildBoundNodes);
12469ImmutableArray<BoundExpression> boundDimensionsOpt = this.VisitList(node.BoundDimensionsOpt);
12513BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12533BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12535BoundExpression? operandConversion = node.OperandConversion;
12537BoundExpression? resultConversion = node.ResultConversion;
12554BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12606BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12623BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
12624BoundExpression index = (BoundExpression)this.Visit(node.Index);
12641BoundExpression invokedExpression = (BoundExpression)this.Visit(node.InvokedExpression);
12642ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
12660BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12677BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12694BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12712BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
12730BoundExpression? leftOperandOpt = (BoundExpression?)this.Visit(node.LeftOperandOpt);
12731BoundExpression? rightOperandOpt = (BoundExpression?)this.Visit(node.RightOperandOpt);
12748BoundExpression left = (BoundExpression)this.Visit(node.Left);
12749BoundExpression right = (BoundExpression)this.Visit(node.Right);
12767BoundExpression left = (BoundExpression)this.Visit(node.Left);
12768BoundExpression right = (BoundExpression)this.Visit(node.Right);
12770BoundExpression? leftConversion = node.LeftConversion;
12772BoundExpression? finalConversion = node.FinalConversion;
12789BoundExpression left = (BoundExpression)this.Visit(node.Left);
12790BoundExpression right = (BoundExpression)this.Visit(node.Right);
12825BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand);
12826BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand);
12828BoundExpression? leftConversion = node.LeftConversion;
12845BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand);
12846BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand);
12863BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
12864BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence);
12865BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative);
12883BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
12884BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence);
12885BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative);
12902BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
12903ImmutableArray<BoundExpression> indices = this.VisitList(node.Indices);
12937BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
12957BoundExpression? getAwaiter = (BoundExpression?)this.Visit(node.GetAwaiter);
12963BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13213BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
13231BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
13234BoundExpression? operandConversion = node.OperandConversion;
13269BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
13287BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
13316ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
13336BoundExpression? elementPointerConversion = node.ElementPointerConversion;
13337BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13379BoundExpression? initializerOpt = (BoundExpression?)this.Visit(node.InitializerOpt);
13380ImmutableArray<BoundExpression> argumentsOpt = this.VisitList(node.ArgumentsOpt);
13396BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13406BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
13414BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
13424BoundExpression? condition = (BoundExpression?)this.Visit(node.Condition);
13434BoundExpression? elementConversion = node.ElementConversion;
13436BoundExpression? iterationErrorExpressionOpt = (BoundExpression?)this.Visit(node.IterationErrorExpressionOpt);
13437BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13448BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt);
13466BoundExpression? exceptionSourceOpt = (BoundExpression?)this.Visit(node.ExceptionSourceOpt);
13468BoundExpression? exceptionFilterOpt = (BoundExpression?)this.Visit(node.ExceptionFilterOpt);
13582BoundExpression value = (BoundExpression)this.Visit(node.Value);
13630BoundExpression? whenClause = (BoundExpression?)this.Visit(node.WhenClause);
13631BoundExpression value = (BoundExpression)this.Visit(node.Value);
13637BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13657BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13706BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess);
13717BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess);
13734BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13752ImmutableArray<BoundExpression> sideEffects = this.VisitList(node.SideEffects);
13753BoundExpression value = (BoundExpression)this.Visit(node.Value);
13772BoundExpression value = (BoundExpression)this.Visit(node.Value);
13789BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
13807BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
13808ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
13825BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
13826BoundExpression accessExpression = (BoundExpression)this.Visit(node.AccessExpression);
13844BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
13845BoundExpression whenNotNull = (BoundExpression)this.Visit(node.WhenNotNull);
13846BoundExpression? whenNullOpt = (BoundExpression?)this.Visit(node.WhenNullOpt);
13875BoundExpression valueTypeReceiver = (BoundExpression)this.Visit(node.ValueTypeReceiver);
13876BoundExpression referenceTypeReceiver = (BoundExpression)this.Visit(node.ReferenceTypeReceiver);
13896BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
13914BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
13933BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
13934ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
13952BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
13953BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
13971ImmutableArray<BoundExpression> constructorArguments = this.VisitList(node.ConstructorArguments);
13989ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14008ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14045BoundExpression? collectionCreation = node.CollectionCreation;
14047BoundExpression? collectionBuilderInvocationConversion = node.CollectionBuilderInvocationConversion;
14078ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14096ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14114ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14150ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers);
14169ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14204ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers);
14222ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14223BoundExpression? implicitReceiverOpt = (BoundExpression?)this.Visit(node.ImplicitReceiverOpt);
14241BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
14242ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14272ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14325BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
14342ImmutableArray<BoundExpression> bounds = this.VisitList(node.Bounds);
14360ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers);
14378BoundExpression count = (BoundExpression)this.Visit(node.Count);
14397BoundExpression count = (BoundExpression)this.Visit(node.Count);
14416BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
14451BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
14469BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
14488BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
14489ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14506BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
14507BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
14525BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
14526ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments);
14580BoundExpression value = (BoundExpression)this.Visit(node.Value);
14581BoundExpression? operation = node.Operation;
14582BoundExpression? cast = node.Cast;
14583BoundExpression? unoptimizedForm = node.UnoptimizedForm;
14600BoundExpression argument = (BoundExpression)this.Visit(node.Argument);
14617ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts);
14634ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts);
14675BoundExpression value = (BoundExpression)this.Visit(node.Value);
14676BoundExpression? alignment = (BoundExpression?)this.Visit(node.Alignment);
14694BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
14715BoundExpression value = (BoundExpression)this.Visit(node.Value);
14732BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess);
14745BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess);
14755BoundExpression? lengthAccess = node.LengthAccess;
14756BoundExpression? indexerAccess = node.IndexerAccess;
14759BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess);
14768BoundExpression? indexerAccess = node.IndexerAccess;
14827BoundExpression value = (BoundExpression)this.Visit(node.Value);
14845BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
14863BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
14881BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
14924BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
14942BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (20)
64private readonly Dictionary<BoundValuePlaceholderBase, BoundExpression> _placeholderMap;
98_placeholderMap = new Dictionary<BoundValuePlaceholderBase, BoundExpression>();
260? ImmutableArray.Create<BoundExpression>(F.Local(_exprRetValue))
261: ImmutableArray<BoundExpression>.Empty));
323BoundExpression expr = (BoundExpression)this.Visit(node.Expression);
343private BoundBlock VisitAwaitExpression(BoundAwaitExpression node, BoundExpression resultPlace)
347var expression = (BoundExpression)Visit(node.Expression);
355var getAwaiter = node.AwaitableInfo.IsDynamic ?
357(BoundExpression)Visit(node.AwaitableInfo.GetAwaiter);
359resultPlace = (BoundExpression)Visit(resultPlace);
387BoundExpression getResultCall = MakeCallMaybeDynamic(
414private BoundExpression MakeCallMaybeDynamic(
415BoundExpression receiver,
436loweredArguments: ImmutableArray<BoundExpression>.Empty,
443private BoundExpression GenerateGetIsCompleted(LocalSymbol awaiterTemp, MethodSymbol getIsCompletedMethod)
634BoundExpression result =
644ImmutableArray.Create<BoundExpression>(F.AssignmentExpression(F.Local(thisTemp), F.This())),
662F.Assignment(F.Local(_exprRetValue), (BoundExpression)Visit(node.ExpressionOpt)),
Lowering\ClosureConversion\ClosureConversion.cs (49)
122private BoundExpression _thisProxyInitDeferred;
577private BoundExpression FrameOfType(SyntaxNode syntax, NamedTypeSymbol frameType)
579BoundExpression result = FramePointer(syntax, frameType.OriginalDefinition);
592protected override BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass)
645result.Add(new BoundExpressionStatement(node.Syntax, (BoundExpression)(BoundNode)node));
659private BoundNode IntroduceFrame(BoundNode node, Analysis.ClosureEnvironment env, Func<ArrayBuilder<BoundExpression>, ArrayBuilder<LocalSymbol>, BoundNode> F)
672var prologue = ArrayBuilder<BoundExpression>.GetInstance();
693BoundExpression left = new BoundFieldAccess(syntax, new BoundLocal(syntax, framePointer, null, frameType), frameParent, null);
694BoundExpression right = FrameOfType(syntax, frameParent.Type as NamedTypeSymbol);
695BoundExpression assignment = new BoundAssignmentOperator(syntax, left, right, left.Type);
744private void InitVariableProxy(SyntaxNode syntax, Symbol symbol, LocalSymbol framePointer, ArrayBuilder<BoundExpression> prologue)
749BoundExpression value;
783var left = proxy.Replacement(
871out BoundExpression receiver,
873ref ImmutableArray<BoundExpression> arguments,
890var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(loweredSymbol.ParameterCount);
909var frame = FrameOfType(syntax, frameType);
1016out BoundExpression receiver,
1082out var receiver,
1124sideEffects: ImmutableArray.Create<BoundExpression>(rewritten),
1134private BoundSequence RewriteSequence(BoundSequence node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals)
1138foreach (var effect in node.SideEffects)
1140var replacement = (BoundExpression)this.Visit(effect);
1144var newValue = (BoundExpression)this.Visit(node.Value);
1155return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) =>
1160return RewriteBlock(node, ArrayBuilder<BoundExpression>.GetInstance(), ArrayBuilder<LocalSymbol>.GetInstance());
1164private BoundBlock RewriteBlock(BoundBlock node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals)
1219return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) =>
1226return RewriteCatch(node, ArrayBuilder<BoundExpression>.GetInstance(), ArrayBuilder<LocalSymbol>.GetInstance());
1230private BoundNode RewriteCatch(BoundCatchBlock node, ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals)
1238BoundExpression rewrittenExceptionSource = null;
1240var rewrittenFilter = (BoundExpression)this.Visit(node.ExceptionFilterOpt);
1243rewrittenExceptionSource = (BoundExpression)Visit(node.ExceptionSourceOpt);
1293return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) =>
1300return RewriteSequence(node, ArrayBuilder<BoundExpression>.GetInstance(), ArrayBuilder<LocalSymbol>.GetInstance());
1310return IntroduceFrame(node, frame, (ArrayBuilder<BoundExpression> prologue, ArrayBuilder<LocalSymbol> newLocals) =>
1340var arguments = default(ImmutableArray<BoundExpression>);
1346out var receiver,
1367ImmutableArray<BoundExpression> arguments = default;
1373out BoundExpression receiver,
1397var result = (BoundExpression)RewriteLambdaConversion((BoundLambda)conversion.Operand);
1649BoundExpression receiver;
1661BoundExpression result = new BoundDelegateCreationExpression(
1688BoundExpression cache;
1731return new BoundBadExpression(F.Syntax, LookupResultKind.Empty, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (135)
21private readonly Dictionary<ParameterSymbol, BoundExpression> _parameterMap = new Dictionary<ParameterSymbol, BoundExpression>();
117var result = r.VisitLambdaInternal(node);
131private BoundExpression TranslateLambdaBody(BoundBlock block)
141var result = Visit(((BoundReturnStatement)stmt).ExpressionOpt);
165private BoundExpression Visit(BoundExpression node)
174var result = VisitInternal(node);
179private BoundExpression VisitExpressionWithoutStackGuard(BoundExpression node)
253private BoundExpression VisitInternal(BoundExpression node)
255BoundExpression result;
279private BoundExpression VisitExpressionWithStackGuard(BoundExpression node)
291private BoundExpression VisitArrayAccess(BoundArrayAccess node)
293var array = Visit(node.Expression);
296var arg = node.Indices[0];
297var index = Visit(arg);
310private BoundExpression Indices(ImmutableArray<BoundExpression> expressions)
312var builder = ArrayBuilder<BoundExpression>.GetInstance();
313foreach (var arg in expressions)
315var index = Visit(arg);
326private BoundExpression Expressions(ImmutableArray<BoundExpression> expressions)
328var builder = ArrayBuilder<BoundExpression>.GetInstance();
329foreach (var arg in expressions)
337private BoundExpression VisitArrayCreation(BoundArrayCreation node)
340var boundType = _bound.Typeof(arrayType.ElementType, _bound.WellKnownType(WellKnownType.System_Type));
351return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), ExpressionType);
360private BoundExpression VisitArrayLength(BoundArrayLength node)
365private BoundExpression VisitAsOperator(BoundAsOperator node)
369var operand = _bound.Null(_bound.SpecialType(SpecialType.System_Object));
378private BoundExpression VisitBaseReference(BoundBaseReference node)
382return new BoundBadExpression(node.Syntax, 0, ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), ExpressionType);
487private BoundExpression VisitBinaryOperator(BinaryOperatorKind opKind, MethodSymbol methodOpt, TypeSymbol type, BoundExpression left, BoundExpression right)
509var enumOperand = (opKind.OperandTypes() == BinaryOperatorKind.UnderlyingAndEnum) ? right : left;
516var loweredLeft = VisitAndPromoteEnumOperand(left, promotedType, isChecked);
517var loweredRight = VisitAndPromoteEnumOperand(right, promotedType, isChecked);
519var result = MakeBinary(methodOpt, type, isLifted, requiresLifted, opFactory, loweredLeft, loweredRight);
524var loweredLeft = Visit(left);
525var loweredRight = Visit(right);
531private static BoundExpression DemoteEnumOperand(BoundExpression operand)
548private BoundExpression VisitAndPromoteEnumOperand(BoundExpression operand, TypeSymbol promotedType, bool isChecked)
561var demotedOperand = DemoteEnumOperand(operand);
562var loweredOperand = Visit(demotedOperand);
567private BoundExpression MakeBinary(MethodSymbol methodOpt, TypeSymbol type, bool isLifted, bool requiresLifted, WellKnownMember opFactory, BoundExpression loweredLeft, BoundExpression loweredRight)
598private BoundExpression Demote(BoundExpression node, TypeSymbol type, bool isChecked)
618private BoundExpression ConvertIndex(BoundExpression expr, TypeSymbol oldType, TypeSymbol newType)
636private BoundExpression VisitCall(BoundCall node)
655private BoundExpression VisitConditionalOperator(BoundConditionalOperator node)
657var condition = Visit(node.Condition);
658var consequence = VisitExactType(node.Consequence);
659var alternative = VisitExactType(node.Alternative);
667private BoundExpression VisitExactType(BoundExpression e)
686private BoundExpression VisitConversion(BoundConversion node)
708var e1 = requireAdditionalCast
711var e2 = _bound.StaticCall(node.Checked && SyntaxFacts.IsCheckedOperator(method.Name) ?
721var operand = Visit(node.Operand);
734var e1 = Convert(Visit(node.Operand), node.Operand.Type, intermediate, node.Checked, false);
744private BoundExpression Convert(BoundExpression operand, TypeSymbol oldType, TypeSymbol newType, bool isChecked, bool isExplicit)
749private BoundExpression Convert(BoundExpression expr, TypeSymbol type, bool isChecked)
757private BoundExpression DelegateCreation(BoundExpression receiver, MethodSymbol method, TypeSymbol delegateType, bool requiresInstanceReceiver)
759var nullObject = _bound.Null(_objectType);
763BoundExpression unquoted;
785private BoundExpression VisitDelegateCreationExpression(BoundDelegateCreationExpression node)
808private BoundExpression VisitFieldAccess(BoundFieldAccess node)
810var receiver = node.FieldSymbol.IsStatic ? _bound.Null(ExpressionType) : Visit(node.ReceiverOpt);
816private BoundExpression VisitIsOperator(BoundIsOperator node)
818var operand = node.Operand;
827private BoundExpression VisitLambda(BoundLambda node)
829var result = VisitLambdaInternal(node);
833private BoundExpression VisitLambdaInternal(BoundLambda node)
837var initializers = ArrayBuilder<BoundExpression>.GetInstance();
838var parameters = ArrayBuilder<BoundExpression>.GetInstance();
845var parameter = _bound.StaticCall(
868private BoundExpression VisitNewT(BoundNewT node)
873private BoundExpression VisitNullCoalescingOperator(BoundNullCoalescingOperator node)
875var left = Visit(node.LeftOperand);
876var right = Visit(node.RightOperand);
889private BoundExpression MakeConversionLambda(Conversion conversion, TypeSymbol fromType, TypeSymbol toType)
895var parameter = _bound.StaticCall(WellKnownMember.System_Linq_Expressions_Expression__Parameter, _bound.Typeof(fromType, _bound.WellKnownType(WellKnownType.System_Type)), _bound.Literal(parameterName));
897var convertedValue = Visit(_bound.Convert(toType, _bound.Parameter(lambdaParameter), conversion));
899var result = _bound.Sequence(
901ImmutableArray.Create<BoundExpression>(_bound.AssignmentExpression(parameterReference, parameter)),
905_bound.ArrayOrEmpty(ParameterExpressionType, ImmutableArray.Create<BoundExpression>(parameterReference))));
909private BoundExpression InitializerMemberSetter(Symbol symbol)
924private BoundExpression InitializerMemberGetter(Symbol symbol)
941private BoundExpression VisitInitializer(BoundExpression node, out InitializerKind kind)
948var builder = ArrayBuilder<BoundExpression>.GetInstance();
957var value = VisitInitializer(a.Right, out elementKind);
962var left = InitializerMemberGetter(sym);
971var left = InitializerMemberSetter(sym);
980var left = InitializerMemberGetter(sym);
1002var builder = ArrayBuilder<BoundExpression>.GetInstance();
1008BoundExpression elementInit = _bound.StaticCall(WellKnownMember.System_Linq_Expressions_Expression__ElementInit,
1025private BoundExpression VisitObjectCreationExpression(BoundObjectCreationExpression node)
1030private BoundExpression VisitObjectCreationContinued(BoundExpression creation, BoundExpression initializerExpressionOpt)
1032var result = creation;
1035var init = VisitInitializer(initializerExpressionOpt, out initializerKind);
1047private BoundExpression VisitObjectCreationExpressionInternal(BoundObjectCreationExpression node)
1062var ctor = _bound.ConstructorInfo(node.Constructor);
1063var args = _bound.Convert(_IEnumerableType.Construct(ExpressionType), Expressions(node.Arguments));
1067var membersBuilder = ArrayBuilder<BoundExpression>.GetInstance();
1082private BoundExpression VisitParameter(BoundParameter node)
1087private static BoundExpression VisitPointerIndirectionOperator(BoundPointerIndirectionOperator node)
1091return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
1094private static BoundExpression VisitPointerElementAccess(BoundPointerElementAccess node)
1098return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
1101private BoundExpression VisitPropertyAccess(BoundPropertyAccess node)
1103var receiver = node.PropertySymbol.IsStatic ? _bound.Null(ExpressionType) : Visit(node.ReceiverOpt);
1126private static BoundExpression VisitSizeOfOperator(BoundSizeOfOperator node)
1130return new BoundBadExpression(node.Syntax, default(LookupResultKind), ImmutableArray<Symbol>.Empty, ImmutableArray.Create<BoundExpression>(node), node.Type);
1133private BoundExpression VisitUnaryOperator(BoundUnaryOperator node)
1135var arg = node.Operand;
1136var loweredArg = Visit(arg);
1191var result = _bound.StaticCall(opFactory, loweredArg);
1202private BoundExpression Constant(BoundExpression node)
Lowering\Instrumentation\CompoundInstrumenter.cs (25)
94public override BoundExpression InstrumentDoStatementCondition(BoundDoStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
129public override BoundExpression InstrumentForStatementCondition(BoundForStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
139public override BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
154public override BoundExpression InstrumentUserDefinedLocalAssignment(BoundAssignmentOperator original)
159public override BoundExpression InstrumentCall(BoundCall original, BoundExpression rewritten)
166ref BoundExpression? receiver,
167ref ImmutableArray<BoundExpression> arguments,
173public override BoundExpression InstrumentObjectCreationExpression(BoundObjectCreationExpression original, BoundExpression rewritten)
178public override BoundExpression InstrumentFunctionPointerInvocation(BoundFunctionPointerInvocation original, BoundExpression rewritten)
198public override BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody)
208public override BoundExpression InstrumentWhileStatementCondition(BoundWhileStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
220ref BoundExpression? rewrittenSource,
222ref BoundExpression? rewrittenFilter,
237public override BoundExpression InstrumentSwitchStatementExpression(BoundStatement original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory)
242public override BoundExpression InstrumentSwitchExpressionArmExpression(BoundExpression original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory)
Lowering\Instrumentation\DebugInfoInjector.cs (16)
227public override BoundExpression InstrumentDoStatementCondition(BoundDoStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
234public override BoundExpression InstrumentWhileStatementCondition(BoundWhileStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
351public override BoundExpression InstrumentForStatementCondition(BoundForStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
370public override BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
437public override BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody)
456ref BoundExpression? rewrittenSource,
458ref BoundExpression? rewrittenFilter,
486public override BoundExpression InstrumentSwitchStatementExpression(BoundStatement original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory)
493public override BoundExpression InstrumentSwitchExpressionArmExpression(BoundExpression original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory)
Lowering\Instrumentation\Instrumenter.cs (25)
112public virtual BoundExpression InstrumentDoStatementCondition(BoundDoStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
120public virtual BoundExpression InstrumentWhileStatementCondition(BoundWhileStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
184public virtual BoundExpression InstrumentForStatementCondition(BoundForStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
198public virtual BoundExpression InstrumentIfStatementCondition(BoundIfStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory)
220public virtual BoundExpression InstrumentUserDefinedLocalAssignment(BoundAssignmentOperator original)
227public virtual BoundExpression InstrumentCall(BoundCall original, BoundExpression rewritten)
240ref BoundExpression? receiver,
241ref ImmutableArray<BoundExpression> arguments,
246public virtual BoundExpression InstrumentObjectCreationExpression(BoundObjectCreationExpression original, BoundExpression rewritten)
251public virtual BoundExpression InstrumentFunctionPointerInvocation(BoundFunctionPointerInvocation original, BoundExpression rewritten)
279public virtual BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody)
295ref BoundExpression? rewrittenSource,
297ref BoundExpression? rewrittenFilter,
305public virtual BoundExpression InstrumentSwitchStatementExpression(BoundStatement original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory)
317public virtual BoundExpression InstrumentSwitchExpressionArmExpression(BoundExpression original, BoundExpression rewrittenExpression, SyntheticBoundNodeFactory factory)
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (27)
356public override BoundExpression InstrumentUserDefinedLocalAssignment(BoundAssignmentOperator original)
360var assignment = base.InstrumentUserDefinedLocalAssignment(original);
363BoundExpression? refAssignmentSourceIndex;
388if (!TryGetLocalOrParameterInfo(original.Left, out var targetSymbol, out var targetType, out var targetIndex))
409private bool TryGetLocalOrParameterInfo(BoundNode node, [NotNullWhen(true)] out Symbol? symbol, [NotNullWhen(true)] out TypeSymbol? type, [NotNullWhen(true)] out BoundExpression? indexExpression)
435private ImmutableArray<BoundExpression> MakeStoreLoggerArguments(
439BoundExpression value,
440BoundExpression? refAssignmentSourceIndex,
441BoundExpression index)
455var addressOf = value is BoundLocal or BoundParameter ?
456(BoundExpression)new BoundAddressOfOperator(_factory.Syntax, value, isManaged: false, parameter.Type) :
466BoundExpression toString;
485private BoundExpression VariableRead(Symbol localOrParameterSymbol)
495ref BoundExpression? rewrittenSource,
497ref BoundExpression? rewrittenFilter,
523var targetIndex = _factory.LocalId(targetSymbol);
543public override BoundExpression InstrumentCall(BoundCall original, BoundExpression rewritten)
546public override BoundExpression InstrumentObjectCreationExpression(BoundObjectCreationExpression original, BoundExpression rewritten)
549public override BoundExpression InstrumentFunctionPointerInvocation(BoundFunctionPointerInvocation original, BoundExpression rewritten)
552private BoundExpression InstrumentCall(BoundExpression invocation, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> refKinds)
562var builder = ArrayBuilder<BoundExpression>.GetInstance();
583if (!TryGetLocalOrParameterInfo(arguments[i], out var targetSymbol, out var targetType, out var targetIndex))
Lowering\LocalRewriter\LocalRewriter.cs (30)
53private Dictionary<BoundValuePlaceholderBase, BoundExpression>? _placeholderReplacementMapDoNotUseDirectly;
211BoundExpression? expr = node as BoundExpression;
221private BoundExpression? VisitExpression(BoundExpression? node)
244private BoundExpression? VisitExpressionImpl(BoundExpression node)
262var result = MakeLiteral(node.Syntax, constantValue, type);
273var visited = (BoundExpression)VisitExpressionOrPatternWithStackGuard(node);
297private static BoundExpression RefAccessMustMakeCopy(BoundExpression visited)
307private static bool IsUnusedDeconstruction(BoundExpression node)
501private BoundExpression PlaceholderReplacement(BoundValuePlaceholderBase placeholder)
504var value = _placeholderReplacementMapDoNotUseDirectly[placeholder];
510private static void AssertPlaceholderReplacement(BoundValuePlaceholderBase placeholder, BoundExpression value)
531private void AddPlaceholderReplacement(BoundValuePlaceholderBase placeholder, BoundExpression value)
537_placeholderReplacementMapDoNotUseDirectly = new Dictionary<BoundValuePlaceholderBase, BoundExpression>();
575private static BoundExpression BadExpression(BoundExpression node)
581private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, BoundExpression child)
586private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, BoundExpression child1, BoundExpression child2)
591private static BoundExpression BadExpression(SyntaxNode syntax, TypeSymbol resultType, ImmutableArray<BoundExpression> children)
683var operand = this.VisitExpression(node.Operand);
930BoundExpression rhs = assignment.Right;
1011internal static bool CanBePassedByReference(BoundExpression expr)
Lowering\LocalRewriter\LocalRewriter.DecisionDagRewriter.cs (23)
131public bool MightAssignSomething(BoundExpression expr)
144if (node is BoundExpression { ConstantValueOpt: { } })
167private static bool MethodMayMutateReceiver(BoundExpression receiver, MethodSymbol method)
339BoundExpression loweredSwitchGoverningExpression,
341out BoundExpression savedInputExpression)
360BoundExpression inputTemp = _tempAllocator.GetTemp(BoundDagTemp.ForOriginalInput(loweredSwitchGoverningExpression));
447TryLowerTypeTestAndCast(testNode.Test, evaluationNode.Evaluation, out BoundExpression sideEffect, out BoundExpression test)
471private void GenerateTest(BoundExpression test, BoundDecisionDagNode whenTrue, BoundDecisionDagNode whenFalse, BoundDecisionDagNode nextNode)
658private void LowerValueDispatchNode(ValueDispatchNode n, BoundExpression input)
676private void LowerRelationalDispatchNode(ValueDispatchNode.RelationalDispatch rel, BoundExpression input)
678var test = MakeRelationalTest(rel.Syntax, input, rel.Operator, rel.Value);
742private void LowerSwitchDispatchNode(ValueDispatchNode.SwitchDispatch node, BoundExpression input)
1002var whenExpressionMap = PooledDictionary<BoundExpression, (LabelSymbol LabelToWhenExpression, ArrayBuilder<BoundWhenDecisionDagNode> WhenNodes)>.GetInstance();
1008var whenExpression = whenNode.WhenExpression;
1056var whenExpression = whenNode.WhenExpression;
1079void lowerWhenExpressionIfShared(BoundExpression whenExpression, LabelSymbol labelToWhenExpression, ArrayBuilder<BoundWhenDecisionDagNode> whenNodes)
1123void addConditionalGoto(BoundExpression whenExpression, SyntaxNode whenClauseSyntax, LabelSymbol whenTrueLabel, ArrayBuilder<BoundStatement> sectionBuilder)
1137bool isSharedWhenExpression(BoundExpression? whenExpression)
1181BoundExpression left = _localRewriter.VisitExpression(binding.VariableAccess);
1185BoundExpression right = _tempAllocator.GetTemp(binding.TempContainingValue);
1205BoundExpression sideEffect = LowerEvaluation(evaluationNode.Evaluation);
1226BoundExpression test = base.LowerTest(testNode.Test);
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (55)
56private readonly PooledDictionary<BoundDagTemp, BoundExpression> _map = PooledDictionary<BoundDagTemp, BoundExpression>.GetInstance();
94public BoundExpression GetTemp(BoundDagTemp dagTemp)
96if (!_map.TryGetValue(dagTemp, out BoundExpression result))
115public bool TrySetTemp(BoundDagTemp dagTemp, BoundExpression translation)
135protected BoundExpression LowerEvaluation(BoundDagEvaluation evaluation)
137BoundExpression input = _tempAllocator.GetTemp(evaluation.Input);
144BoundExpression output = _tempAllocator.GetTemp(outputTemp);
145BoundExpression access = _localRewriter.MakeFieldAccess(f.Syntax, input, field, null, LookupResultKind.Viable, field.Type);
154BoundExpression output = _tempAllocator.GetTemp(outputTemp);
162var argBuilder = ArrayBuilder<BoundExpression>.GetInstance();
163BoundExpression receiver;
164void addArg(RefKind refKind, BoundExpression expression)
209BoundExpression output = _tempAllocator.GetTemp(outputTemp);
215BoundExpression evaluated;
246BoundExpression output = _tempAllocator.GetTemp(outputTemp);
256var indexerAccess = e.IndexerAccess;
262var placeholderValues = PooledDictionary<BoundEarlyValuePlaceholderBase, BoundExpression>.GetInstance();
268var access = (BoundExpression)_localRewriter.Visit(indexerAccess);
271BoundExpression output = _tempAllocator.GetTemp(outputTemp);
282var indexerAccess = e.IndexerAccess;
288var placeholderValues = PooledDictionary<BoundEarlyValuePlaceholderBase, BoundExpression>.GetInstance();
294var access = (BoundExpression)_localRewriter.Visit(indexerAccess);
297BoundExpression output = _tempAllocator.GetTemp(outputTemp);
306BoundExpression makeUnloweredIndexArgument(int index)
320BoundExpression makeUnloweredRangeArgument(BoundDagSliceEvaluation e)
336protected BoundExpression LowerTest(BoundDagTest test)
339BoundExpression input = _tempAllocator.GetTemp(test.Input);
367private BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewrittenExpr, BinaryOperatorKind operatorKind)
387protected BoundExpression MakeValueTest(SyntaxNode syntax, BoundExpression input, ConstantValue value)
401protected BoundExpression MakeRelationalTest(SyntaxNode syntax, BoundExpression input, BinaryOperatorKind operatorKind, ConstantValue value)
410BoundExpression literal = _localRewriter.MakeLiteral(syntax, value, input.Type);
431private BoundExpression MakeSpanStringTest(BoundExpression input, ConstantValue value)
461[NotNullWhen(true)] out BoundExpression sideEffect,
462[NotNullWhen(true)] out BoundExpression testExpression)
473BoundExpression input = _tempAllocator.GetTemp(test.Input);
474BoundExpression output = _tempAllocator.GetTemp(new BoundDagTemp(evaluation.Syntax, typeEvaluation1.Type, evaluation));
488BoundExpression input = _tempAllocator.GetTemp(test.Input);
490BoundExpression output = _tempAllocator.GetTemp(new BoundDagTemp(evaluation.Syntax, baseType, evaluation));
506BoundExpression loweredInput,
508Action<BoundExpression> addCode,
509out BoundExpression savedInputExpression)
567BoundExpression inputTemp = _tempAllocator.GetTemp(inputDagTemp);
612Action<BoundExpression> addCode,
614out BoundExpression savedInputExpression)
620var newArguments = ArrayBuilder<BoundExpression>.GetInstance(loweredInput.Arguments.Length);
625var expr = loweredInput.Arguments[i];
640void storeToTemp(BoundDagTemp temp, BoundExpression expr)
650var tempToHoldInput = _tempAllocator.GetTemp(temp);
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (28)
21private BoundExpression VisitAssignmentOperator(BoundAssignmentOperator node, bool used)
23var loweredRight = VisitExpression(node.Right);
25BoundExpression left = node.Left;
26BoundExpression loweredLeft;
58var loweredReceiver = VisitExpression(memberAccess.Receiver);
66var loweredReceiver = VisitExpression(indexerAccess.Receiver);
91private BoundExpression MakeAssignmentOperator(SyntaxNode syntax, BoundExpression rewrittenLeft, BoundExpression rewrittenRight,
139private BoundExpression MakeDynamicSetIndex(
141BoundExpression loweredReceiver,
142ImmutableArray<BoundExpression> loweredArguments,
145BoundExpression loweredRight,
166private BoundExpression MakeStaticAssignmentOperator(
168BoundExpression rewrittenLeft,
169BoundExpression rewrittenRight,
183BoundExpression? rewrittenReceiver = propertyAccess.ReceiverOpt;
190ImmutableArray<BoundExpression>.Empty,
202BoundExpression? rewrittenReceiver = indexerAccess.ReceiverOpt;
203ImmutableArray<BoundExpression> arguments = indexerAccess.Arguments;
267private BoundExpression MakePropertyAssignment(
269BoundExpression? rewrittenReceiver,
271ImmutableArray<BoundExpression> arguments,
275BoundExpression rewrittenRight,
327BoundExpression boundRhs = new BoundLocal(syntax, rhsTemp, null, exprType);
329BoundExpression rhsAssignment = new BoundAssignmentOperator(
335BoundExpression setterCall = BoundCall.Synthesized(
367ImmutableArray<BoundExpression>.Empty,
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (211)
75BoundExpression loweredLeft = VisitExpression(node.Left);
76BoundExpression loweredRight = VisitExpression(node.Right);
92var andOperatorCall = LowerUserDefinedBinaryOperator(syntax, operatorKind & ~BinaryOperatorKind.Logical, boundTemp, loweredRight, type, node.LogicalOperator, node.ConstrainedToTypeOpt);
95BoundExpression conditionalExpression = RewriteConditionalOperator(
108sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
113public BoundExpression VisitBinaryOperator(BoundBinaryOperator node, BoundUnaryOperator? applyParentUnaryOperator)
118ImmutableArray<BoundExpression> parts = CollectBinaryOperatorInterpolatedStringParts(node);
147BoundExpression loweredLeft = VisitExpression(stack.Peek().Left);
151BoundExpression loweredRight = VisitExpression(original.Right);
160private static ImmutableArray<BoundExpression> CollectBinaryOperatorInterpolatedStringParts(BoundBinaryOperator node)
164var partsBuilder = ArrayBuilder<BoundExpression>.GetInstance();
166static (BoundInterpolatedString interpolatedString, ArrayBuilder<BoundExpression> partsBuilder) =>
174private BoundExpression MakeBinaryOperator(
177BoundExpression loweredLeft,
178BoundExpression loweredRight,
189private BoundExpression MakeBinaryOperator(
193BoundExpression loweredLeft,
194BoundExpression loweredRight,
537private BoundExpression RewriteLiftedBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, MethodSymbol? method, TypeSymbol? constrainedToTypeOpt)
554var result = operatorKind.IsComparison() ?
562BoundExpression? whenNullOpt = null;
590private BoundExpression UnconvertArrayLength(BoundArrayLength arrLength)
595private BoundExpression MakeDynamicLogicalBinaryOperator(
598BoundExpression loweredLeft,
599BoundExpression loweredRight,
645BoundExpression result;
666var op = _dynamicFactory.MakeDynamicBinaryOperator(operatorKind, loweredLeft, loweredRight, isCompoundAssignment, type).ToExpression();
680BoundExpression leftTest = MakeTruthTestForDynamicLogicalOperator(syntax, loweredLeft, boolean, leftTruthOperator, constrainedToTypeOpt, negative: isAnd);
696BoundExpression leftTest = MakeTruthTestForDynamicLogicalOperator(syntax, loweredLeft, boolean, leftTruthOperator, constrainedToTypeOpt, negative: isAnd);
697var convertedLeft = MakeConversionNode(loweredLeft, type, @checked: false);
705return _factory.Sequence(ImmutableArray.Create(temp.LocalSymbol), ImmutableArray.Create<BoundExpression>(tempAssignment), result);
711private static ConstantValue? UnboxConstant(BoundExpression expression)
725private BoundExpression MakeTruthTestForDynamicLogicalOperator(SyntaxNode syntax, BoundExpression loweredLeft, TypeSymbol boolean, MethodSymbol? leftTruthOperator, TypeSymbol? constrainedToTypeOpt, bool negative)
744var converted = MakeConversionNode(loweredLeft, boolean, @checked: false, markAsChecked: true); // The conversion was checked in binding
767private BoundExpression LowerUserDefinedBinaryOperator(
770BoundExpression loweredLeft,
771BoundExpression loweredRight,
795private BoundExpression? TrivialLiftedComparisonOperatorOptimizations(
798BoundExpression left,
799BoundExpression right,
821BoundExpression? leftNonNull = NullableAlwaysHasValue(left);
822BoundExpression? rightNonNull = NullableAlwaysHasValue(right);
843BoundExpression result = MakeLiteral(syntax, ConstantValue.Create(operatorKind == BinaryOperatorKind.NotEqual), boolType);
845BoundExpression? nonNull = leftAlwaysNull ? rightNonNull : leftNonNull;
853sideEffects: ImmutableArray.Create<BoundExpression>(nonNull),
868BoundExpression maybeNull = leftAlwaysNull ? right : left;
872BoundExpression callHasValue = _factory.MakeNullableHasValue(syntax, maybeNull);
873BoundExpression result = operatorKind == BinaryOperatorKind.Equal ?
880BoundExpression falseExpr = MakeBooleanConstant(syntax, operatorKind == BinaryOperatorKind.NotEqual);
888private BoundExpression MakeOptimizedGetValueOrDefault(SyntaxNode syntax, BoundExpression expression)
906private BoundExpression MakeBooleanConstant(SyntaxNode syntax, bool value)
911private BoundExpression MakeOptimizedHasValue(SyntaxNode syntax, BoundExpression expression)
925private BoundExpression MakeNullableHasValue(SyntaxNode syntax, BoundExpression expression)
935private BoundExpression LowerLiftedBuiltInComparisonOperator(
938BoundExpression loweredLeft,
939BoundExpression loweredRight)
955BoundExpression? optimized = TrivialLiftedComparisonOperatorOptimizations(syntax, kind, loweredLeft, loweredRight, method: null, constrainedToTypeOpt: null);
994BoundExpression? xNonNull = NullableAlwaysHasValue(loweredLeft);
995BoundExpression? yNonNull = NullableAlwaysHasValue(loweredRight);
1032BoundExpression callX_GetValueOrDefault = MakeOptimizedGetValueOrDefault(syntax, boundTempX);
1033BoundExpression callY_GetValueOrDefault = MakeOptimizedGetValueOrDefault(syntax, boundTempY);
1034BoundExpression callX_HasValue = MakeOptimizedHasValue(syntax, boundTempX);
1035BoundExpression callY_HasValue = MakeOptimizedHasValue(syntax, boundTempY);
1055BoundExpression leftExpression = MakeBinaryOperator(
1065BoundExpression rightExpression = MakeBinaryOperator(
1076BoundExpression binaryExpression = MakeBinaryOperator(
1099sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignmentX, tempAssignmentY),
1125private BoundExpression LowerLiftedUserDefinedComparisonOperator(
1128BoundExpression loweredLeft,
1129BoundExpression loweredRight,
1135BoundExpression? optimized = TrivialLiftedComparisonOperatorOptimizations(syntax, kind, loweredLeft, loweredRight, method, constrainedToTypeOpt);
1190BoundExpression? xNonNull = NullableAlwaysHasValue(loweredLeft);
1191BoundExpression? yNonNull = NullableAlwaysHasValue(loweredRight);
1205BoundExpression callX_GetValueOrDefault = MakeOptimizedGetValueOrDefault(syntax, boundTempX);
1206BoundExpression callY_GetValueOrDefault = MakeOptimizedGetValueOrDefault(syntax, boundTempY);
1207BoundExpression callX_HasValue = MakeOptimizedHasValue(syntax, boundTempX);
1208BoundExpression callY_HasValue = MakeOptimizedHasValue(syntax, boundTempY);
1226BoundExpression condition = MakeBinaryOperator(
1236BoundExpression unliftedOp = MakeBinaryOperator(
1245BoundExpression consequence;
1274BoundExpression alternative = MakeBooleanConstant(syntax, operatorKind == BinaryOperatorKind.NotEqual);
1276BoundExpression conditionalExpression = RewriteConditionalOperator(
1288sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignmentX, tempAssignmentY),
1293private BoundExpression? TrivialLiftedBinaryArithmeticOptimizations(
1296BoundExpression left,
1297BoundExpression right,
1322BoundExpression? leftNonNull = NullableAlwaysHasValue(left);
1323BoundExpression? rightNonNull = NullableAlwaysHasValue(right);
1333private BoundExpression MakeLiftedBinaryOperatorConsequence(
1336BoundExpression left,
1337BoundExpression right,
1343BoundExpression unliftedOp = MakeBinaryOperator(
1359private static BoundExpression? OptimizeLiftedArithmeticOperatorOneNull(
1361BoundExpression left,
1362BoundExpression right,
1380BoundExpression notAlwaysNull = leftAlwaysNull ? right : left;
1381BoundExpression? neverNull = NullableAlwaysHasValue(notAlwaysNull);
1382BoundExpression sideEffect = neverNull ?? notAlwaysNull;
1397sideEffects: ImmutableArray.Create<BoundExpression>(sideEffect),
1402private BoundExpression LowerLiftedBinaryArithmeticOperator(
1405BoundExpression loweredLeft,
1406BoundExpression loweredRight,
1415BoundExpression? optimized = OptimizeLiftedBinaryArithmetic(syntax, kind, loweredLeft, loweredRight, type, method, constrainedToTypeOpt);
1439var sideeffects = ArrayBuilder<BoundExpression>.GetInstance();
1442BoundExpression? leftNeverNull = NullableAlwaysHasValue(loweredLeft);
1443BoundExpression? rightNeverNull = NullableAlwaysHasValue(loweredRight);
1445BoundExpression boundTempX = leftNeverNull ?? loweredLeft;
1448BoundExpression boundTempY = rightNeverNull ?? loweredRight;
1451BoundExpression callX_GetValueOrDefault = MakeOptimizedGetValueOrDefault(syntax, boundTempX);
1452BoundExpression callY_GetValueOrDefault = MakeOptimizedGetValueOrDefault(syntax, boundTempY);
1453BoundExpression callX_HasValue = MakeOptimizedHasValue(syntax, boundTempX);
1454BoundExpression callY_HasValue = MakeOptimizedHasValue(syntax, boundTempY);
1458BoundExpression condition = MakeBinaryOperator(syntax, BinaryOperatorKind.BoolAnd, callX_HasValue, callY_HasValue, boolType, method: null, constrainedToTypeOpt: null);
1461BoundExpression consequence = MakeLiftedBinaryOperatorConsequence(syntax, kind, callX_GetValueOrDefault, callY_GetValueOrDefault, type, method, constrainedToTypeOpt);
1464BoundExpression alternative = new BoundDefaultExpression(syntax, type);
1469BoundExpression conditionalExpression = RewriteConditionalOperator(
1486private BoundExpression CaptureExpressionInTempIfNeeded(
1487BoundExpression operand,
1488ArrayBuilder<BoundExpression> sideeffects,
1504private BoundExpression? OptimizeLiftedBinaryArithmetic(
1507BoundExpression left,
1508BoundExpression right,
1513BoundExpression? optimized = TrivialLiftedBinaryArithmeticOptimizations(syntax, kind, left, right, type, method, constrainedToTypeOpt);
1607BoundExpression? nonNullRight = NullableAlwaysHasValue(right);
1640private BoundExpression MakeNewNullableBoolean(SyntaxNode syntax, bool? value)
1655private BoundExpression? OptimizeLiftedBooleanOperatorOneNull(
1658BoundExpression left,
1659BoundExpression right)
1686BoundExpression alwaysNull = leftAlwaysNull ? left : right;
1687BoundExpression notAlwaysNull = leftAlwaysNull ? right : left;
1688BoundExpression? neverNull = NullableAlwaysHasValue(notAlwaysNull);
1690BoundExpression nullBool = new BoundDefaultExpression(syntax, alwaysNull.Type);
1694BoundExpression newNullBool = MakeNewNullableBoolean(syntax, kind == BinaryOperatorKind.LiftedBoolOr);
1720BoundExpression condition = MakeOptimizedGetValueOrDefault(syntax, boundTemp);
1721BoundExpression consequence = kind == BinaryOperatorKind.LiftedBoolAnd ? nullBool : boundTemp;
1722BoundExpression alternative = kind == BinaryOperatorKind.LiftedBoolAnd ? boundTemp : nullBool;
1723BoundExpression conditionalExpression = RewriteConditionalOperator(
1735sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
1740private BoundExpression? OptimizeLiftedBooleanOperatorOneNonNull(
1743BoundExpression left,
1744BoundExpression right)
1762BoundExpression? leftNonNull = NullableAlwaysHasValue(left);
1763BoundExpression? rightNonNull = NullableAlwaysHasValue(right);
1779BoundExpression nonNullTemp = leftNonNull == null ? boundTempY : boundTempX;
1780BoundExpression maybeNullTemp = leftNonNull == null ? boundTempX : boundTempY;
1781BoundExpression condition = nonNullTemp;
1782BoundExpression newNullBool = MakeNewNullableBoolean(syntax, kind == BinaryOperatorKind.LiftedBoolOr);
1783BoundExpression consequence = kind == BinaryOperatorKind.LiftedBoolOr ? newNullBool : maybeNullTemp;
1784BoundExpression alternative = kind == BinaryOperatorKind.LiftedBoolOr ? maybeNullTemp : newNullBool;
1785BoundExpression conditionalExpression = RewriteConditionalOperator(
1796sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignmentX, tempAssignmentY),
1801private BoundExpression LowerLiftedBooleanOperator(
1804BoundExpression loweredLeft,
1805BoundExpression loweredRight)
1811BoundExpression? optimized = OptimizeLiftedBooleanOperatorOneNull(syntax, kind, loweredLeft, loweredRight);
1840BoundExpression callX_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempX, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultX);
1842BoundExpression callY_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempY, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultY);
1844BoundExpression callX_HasValue = _factory.MakeNullableHasValue(syntax, boundTempX);
1847BoundExpression innerOr = MakeBinaryOperator(
1857BoundExpression invert = MakeUnaryOperator(UnaryOperatorKind.BoolLogicalNegation, syntax, method: null, constrainedToTypeOpt: null, innerOr, boolType);
1860BoundExpression condition = MakeBinaryOperator(
1869BoundExpression consequence = kind == BinaryOperatorKind.LiftedBoolAnd ? boundTempY : boundTempX;
1870BoundExpression alternative = kind == BinaryOperatorKind.LiftedBoolAnd ? boundTempX : boundTempY;
1872BoundExpression conditionalExpression = RewriteConditionalOperator(
1884sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignmentX, tempAssignmentY),
1923private BoundExpression RewriteNullableNullEquality(
1926BoundExpression loweredLeft,
1927BoundExpression loweredRight,
1945BoundExpression nullable = loweredRight.IsLiteralNull() ? loweredLeft : loweredRight;
1954BoundExpression? nonNullValue = NullableAlwaysHasValue(nullable);
1965sideEffects: ImmutableArray.Create<BoundExpression>(nonNullValue),
1975BoundExpression whenNotNull = RewriteNullableNullEquality(
1982var whenNull = kind == BinaryOperatorKind.NullableNullEqual ? MakeBooleanConstant(syntax, true) : null;
1987BoundExpression call = MakeNullableHasValue(syntax, nullable);
1988BoundExpression result = kind == BinaryOperatorKind.NullableNullNotEqual ?
1995private BoundExpression RewriteStringEquality(BoundBinaryOperator? oldNode, SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, SpecialMember member)
2008private BoundExpression RewriteDelegateOperation(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, SpecialMember member)
2029BoundExpression call = _inExpressionLambda
2031: (BoundExpression)BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
2032BoundExpression result = method.ReturnType.SpecialType == SpecialType.System_Delegate ?
2038private BoundExpression RewriteDecimalBinaryOperation(SyntaxNode syntax, BoundExpression loweredLeft, BoundExpression loweredRight, BinaryOperatorKind operatorKind)
2069private BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewrittenExpr, BinaryOperatorKind operatorKind)
2126private BoundExpression RewriteBuiltInShiftOperation(
2130BoundExpression loweredLeft,
2131BoundExpression loweredRight,
2188private BoundExpression RewriteBuiltInNativeShiftOperation(
2192BoundExpression loweredLeft,
2193BoundExpression loweredRight,
2249private BoundExpression RewritePointerNumericOperator(
2252BoundExpression loweredLeft,
2253BoundExpression loweredRight,
2302private BoundExpression MakeSizeOfMultiplication(BoundExpression numericOperand, PointerTypeSymbol pointerType, bool isChecked)
2304var sizeOfExpression = _factory.Sizeof(pointerType.PointedAtType);
2446private BoundExpression RewritePointerSubtraction(
2448BoundExpression loweredLeft,
2449BoundExpression loweredRight,
2457var sizeOfExpression = _factory.Sizeof(pointerType.PointedAtType);
Lowering\LocalRewriter\LocalRewriter_Call.cs (81)
23public BoundExpression VisitDynamicInvocation(BoundDynamicInvocation node, bool resultDiscarded)
30BoundExpression loweredReceiver;
81var loweredExpression = VisitExpression(node.Expression);
97private void EmbedIfNeedTo(BoundExpression receiver, ImmutableArray<MethodSymbol> methods, SyntaxNode syntaxNode)
116private void EmbedIfNeedTo(BoundExpression receiver, ImmutableArray<PropertySymbol> properties, SyntaxNode syntaxNode)
137ref BoundExpression? receiverOpt,
138ref ImmutableArray<BoundExpression> arguments,
324BoundExpression rewrittenCall;
341BoundExpression? rewrittenReceiver = VisitExpression(node.ReceiverOpt);
355BoundExpression? rewrittenReceiver = VisitExpression(node.ReceiverOpt);
381BoundExpression visitArgumentsAndFinishRewrite(BoundCall node, BoundExpression? rewrittenReceiver)
386ImmutableArray<BoundExpression> arguments = node.Arguments;
390BoundExpression? firstRewrittenArgument = null;
426var rewrittenCall = MakeCall(node, node.Syntax, rewrittenReceiver, method, rewrittenArguments, argRefKindsOpt, node.ResultKind, temps.ToImmutableAndFree());
437private BoundExpression MakeCall(
440BoundExpression? rewrittenReceiver,
442ImmutableArray<BoundExpression> rewrittenArguments,
447BoundExpression rewrittenBoundCall;
514sideEffects: ImmutableArray<BoundExpression>.Empty,
522private BoundExpression MakeCall(SyntaxNode syntax, BoundExpression? rewrittenReceiver, MethodSymbol method, ImmutableArray<BoundExpression> rewrittenArguments)
535private static bool IsSafeForReordering(BoundExpression expression, RefKind kind)
542var current = expression;
621internal static bool IsCapturedPrimaryConstructorParameter(BoundExpression expression)
653private ImmutableArray<BoundExpression> VisitArgumentsAndCaptureReceiverIfNeeded(
654[NotNullIfNotNull(nameof(rewrittenReceiver))] ref BoundExpression? rewrittenReceiver,
656ImmutableArray<BoundExpression> arguments,
660ArrayBuilder<BoundExpression>? storesOpt,
662BoundExpression? firstRewrittenArgument = null)
721ImmutableArray<BoundExpression> rewrittenArguments;
730var visitedArgumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(arguments.Length);
739var argument = arguments[i];
808extraRefInitialization is object ? ImmutableArray.Create<BoundExpression>(extraRefInitialization, assignmentToTemp) : ImmutableArray.Create<BoundExpression>(assignmentToTemp),
827ArrayBuilder<BoundExpression> visitedArgumentsBuilder,
833var argument = arguments[argumentIndex];
884visitedArgumentsBuilder[argIndex] = _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create<BoundExpression>(store), local);
906static bool usesReceiver(BoundExpression argument)
964_factory.Sequence(new BoundExpression[] { _factory.AssignmentExpression(cache, intermediateRef) }, cache),
982_factory.Sequence(new BoundExpression[] { _factory.AssignmentExpression(cache, assignmentToTemp.Right) }, cache),
997private ImmutableArray<BoundExpression> MakeArguments(
998ImmutableArray<BoundExpression> rewrittenArguments,
1017BoundExpression? optimized;
1083BoundExpression[] actualArguments = new BoundExpression[parameters.Length]; // The actual arguments that will be passed; one actual argument per formal parameter.
1130private bool TryOptimizeParamsArray(BoundExpression possibleParamsArray, [NotNullWhen(true)] out BoundExpression? optimized)
1210ImmutableArray<BoundExpression> rewrittenArguments,
1255private delegate BoundExpression ParamsArrayElementRewriter<TArg>(BoundExpression element, ref TArg arg);
1256private static BoundExpression RewriteParamsArray<TArg>(BoundExpression paramsArray, ParamsArrayElementRewriter<TArg> elementRewriter, ref TArg arg)
1262ArrayBuilder<BoundExpression>? elementsBuilder = null;
1266var element = elements[i];
1267var replacement = elementRewriter(element, ref arg);
1273elementsBuilder = ArrayBuilder<BoundExpression>.GetInstance(elements.Length);
1306ImmutableArray<BoundExpression> rewrittenArguments,
1308/* out */ BoundExpression[] arguments,
1319BoundExpression argument = rewrittenArguments[a];
1345static (BoundExpression element, ref (LocalRewriter rewriter, bool forceLambdaSpilling, ArrayBuilder<BoundAssignmentOperator> storesToTemps) arg) =>
1375private BoundExpression StoreArgumentToTempIfNecessary(bool forceLambdaSpilling, ArrayBuilder<BoundAssignmentOperator> storesToTemps, BoundExpression argument, RefKind argRefKind, RefKind paramRefKind)
1394bool isLambdaConversion(BoundExpression expr)
1398private BoundExpression CreateEmptyArray(SyntaxNode syntax, ArrayTypeSymbol arrayType)
1400BoundExpression? arrayEmpty = CreateArrayEmptyCallIfAvailable(syntax, arrayType.ElementType);
1408ImmutableArray.Create<BoundExpression>(
1418private BoundExpression? CreateArrayEmptyCallIfAvailable(SyntaxNode syntax, TypeSymbol elementType)
1440ImmutableArray<BoundExpression>.Empty,
1453BoundExpression[] arguments,
1483BoundExpression[] arguments,
1508var argument = arguments[a];
1515static (BoundExpression element, ref (ArrayBuilder<BoundAssignmentOperator> tempStores, int tempsRemainedInUse, int firstUnclaimedStore) arg) =>
1530static BoundExpression mergeArgumentAndSideEffect(BoundExpression argument, ArrayBuilder<BoundAssignmentOperator> tempStores, ref int tempsRemainedInUse, ref int firstUnclaimedStore)
1568var sideeffects = new BoundExpression[correspondingStore - firstUnclaimedStore];
1601BoundExpression[] actualArguments, //already re-ordered to match parameters
1625var argument = actualArguments[argIndex];
1644sideEffects: ImmutableArray.Create<BoundExpression>(boundAssignmentToTemp),
1663var loweredReceiver = VisitExpression(node.Receiver);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (105)
31private BoundExpression RewriteCollectionExpressionConversion(Conversion conversion, BoundCollectionExpression node)
48if (TryRewriteSingleElementSpreadToList(node, listElementType, out var result))
116BoundExpression expr;
124expr = (BoundExpression)element;
151var result = Binder.GetUnderlyingCollectionExpressionElement(node, (BoundExpression)element, throwOnErrors: true);
160private bool TryRewriteSingleElementSpreadToList(BoundCollectionExpression node, TypeWithAnnotations listElementType, [NotNullWhen(true)] out BoundExpression? result)
183var rewrittenSpreadExpression = VisitExpression(singleSpread.Expression);
217private static bool CanOptimizeSingleSpreadAsCollectionBuilderArgument(BoundCollectionExpression node, [NotNullWhen(true)] out BoundExpression? spreadExpression)
235private BoundExpression VisitImmutableArrayCollectionExpression(BoundCollectionExpression node, TypeWithAnnotations elementType, MethodSymbol asImmutableArray)
237var arrayCreation = VisitArrayOrSpanCollectionExpression(
246private BoundExpression VisitArrayOrSpanCollectionExpression(BoundCollectionExpression node, CollectionExpressionTypeKind collectionTypeKind, TypeSymbol collectionType, TypeWithAnnotations elementType)
280var rewrittenElements = elements.SelectAsArray(static (element, rewriter) => rewriter.VisitExpression((BoundExpression)element), this);
301BoundExpression array;
314var list = CreateAndPopulateList(node, elementType, elements);
332private BoundExpression VisitCollectionInitializerCollectionExpression(BoundCollectionExpression node, TypeSymbol collectionType)
337var rewrittenReceiver = VisitExpression(node.CollectionCreation);
344var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(elements.Length + 1);
354var rewrittenElement = element is BoundCollectionExpressionSpreadElement spreadElement ?
361var rewrittenValue = rewriteCollectionInitializer(temp, ((BoundExpressionStatement)iteratorBody).Expression);
367rewriteCollectionInitializer(temp, (BoundExpression)element);
383BoundExpression? rewriteCollectionInitializer(BoundLocal rewrittenReceiver, BoundExpression expressionElement)
394private BoundExpression VisitListInterfaceCollectionExpression(BoundCollectionExpression node)
407BoundExpression arrayOrList;
437BoundExpression fieldValue = kind switch
440SynthesizedReadOnlyListKind.SingleElement => this.VisitExpression((BoundExpression)elements.Single()),
459BoundExpression createArray(BoundCollectionExpression node, ArrayTypeSymbol arrayType)
468private BoundExpression VisitCollectionBuilderCollectionExpression(BoundCollectionExpression node)
489BoundExpression span = CanOptimizeSingleSpreadAsCollectionBuilderArgument(node, out var spreadExpression)
511var result = VisitExpression(node.CollectionBuilderInvocationConversion);
530node.Elements.All(e => ((BoundExpression)e).ConstantValueOpt is { });
540private BoundExpression CreateAndPopulateSpanFromInlineArray(
547Debug.Assert(elements.All(e => e is BoundExpression));
564var element = VisitExpression((BoundExpression)elements[0]);
582var sideEffects = ArrayBuilder<BoundExpression>.GetInstance();
592var element = VisitExpression((BoundExpression)elements[i]);
657private BoundExpression? TryOptimizeSingleSpreadToArray(BoundCollectionExpression node, ArrayTypeSymbol arrayType)
670var rewrittenSpreadExpression = VisitExpression(spreadExpression);
694var rewrittenSpreadExpression = CallAsSpanMethod(VisitExpression(spreadExpression), asSpanMethod);
719private BoundExpression CreateAndPopulateArray(BoundCollectionExpression node, ArrayTypeSymbol arrayType)
745elements.SelectAsArray(static (element, rewriter) => rewriter.VisitExpression((BoundExpression)element), this));
748ImmutableArray.Create<BoundExpression>(
760var sideEffects = ArrayBuilder<BoundExpression>.GetInstance();
787addElement: (ArrayBuilder<BoundExpression> expressions, BoundExpression arrayTemp, BoundExpression rewrittenValue, bool isLastElement) =>
815tryOptimizeSpreadElement: (ArrayBuilder<BoundExpression> sideEffects, BoundExpression arrayTemp, BoundCollectionExpressionSpreadElement spreadElement, BoundExpression rewrittenSpreadOperand) =>
822if (!TryConvertToSpan(arrayTemp, writableOnly: true, out var targetSpan))
901private bool TryConvertToSpan(BoundExpression expression, bool writableOnly, [NotNullWhen(true)] out BoundExpression? span)
916private BoundExpression CallAsSpanMethod(BoundExpression spreadExpression, MethodSymbol? asSpanMethod)
940private (MethodSymbol spanSliceMethod, BoundExpression spreadElementAsSpan, MethodSymbol getLengthMethod, MethodSymbol copyToMethod)? PrepareCopyToOptimization(
942BoundExpression rewrittenSpreadOperand)
952if (!TryConvertToSpan(rewrittenSpreadOperand, writableOnly: false, out var spreadOperandAsSpan))
982ArrayBuilder<BoundExpression> sideEffects,
985BoundExpression spanTemp,
986BoundExpression rewrittenSpreadOperand,
988BoundExpression spreadOperandAsSpan,
1021private BoundExpression CreateAndPopulateList(BoundCollectionExpression node, TypeWithAnnotations elementType, ImmutableArray<BoundNode> elements)
1029var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(elements.Length + 1);
1059var knownLengthExpression = GetKnownLengthExpression(elements, numberIncludingLastSpread, localsBuilder);
1071rewrittenReceiver = _factory.New(constructor, ImmutableArray.Create<BoundExpression>(knownLengthTemp));
1083rewrittenReceiver = _factory.New(constructor, ImmutableArray<BoundExpression>.Empty);
1123addElement: (ArrayBuilder<BoundExpression> expressions, BoundExpression spanTemp, BoundExpression rewrittenValue, bool isLastElement) =>
1151tryOptimizeSpreadElement: (ArrayBuilder<BoundExpression> sideEffects, BoundExpression spanTemp, BoundCollectionExpressionSpreadElement spreadElement, BoundExpression rewrittenSpreadOperand) =>
1170addElement: (ArrayBuilder<BoundExpression> expressions, BoundExpression listTemp, BoundExpression rewrittenValue, bool isLastElement) =>
1176tryOptimizeSpreadElement: (ArrayBuilder<BoundExpression> sideEffects, BoundExpression listTemp, BoundCollectionExpressionSpreadElement spreadElement, BoundExpression rewrittenSpreadOperand) =>
1204private BoundExpression RewriteCollectionExpressionElementExpression(BoundNode element)
1206var expression = element is BoundCollectionExpressionSpreadElement spreadElement ?
1208(BoundExpression)element;
1216ArrayBuilder<BoundExpression> sideEffects)
1220var rewrittenExpression = RewriteCollectionExpressionElementExpression(elements[i]);
1230BoundExpression rewrittenReceiver,
1233ArrayBuilder<BoundExpression> sideEffects,
1234Action<ArrayBuilder<BoundExpression>, BoundExpression, BoundExpression, bool> addElement,
1235Func<ArrayBuilder<BoundExpression>, BoundExpression, BoundCollectionExpressionSpreadElement, BoundExpression, bool> tryOptimizeSpreadElement)
1249var rewrittenElement = MakeCollectionExpressionSpreadElement(
1254var rewrittenValue = VisitExpression(((BoundExpressionStatement)iteratorBody).Expression);
1255var builder = ArrayBuilder<BoundExpression>.GetInstance();
1274private BoundExpression GetKnownLengthExpression(ImmutableArray<BoundNode> elements, int numberIncludingLastSpread, ArrayBuilder<BoundLocal> rewrittenExpressions)
1279BoundExpression? sum = null;
1289var lengthAccess = VisitExpression(spreadElement.LengthOrCount);
1314BoundExpression add(BoundExpression? sum, BoundExpression value)
1322private BoundExpression MakeCollectionExpressionSpreadElement(
1324BoundExpression rewrittenExpression,
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (58)
22private BoundExpression VisitCompoundAssignmentOperator(BoundCompoundAssignmentOperator node, bool used)
25BoundExpression loweredRight = VisitExpression(node.Right);
28var stores = ArrayBuilder<BoundExpression>.GetInstance();
37BoundExpression transformedLHS = TransformCompoundAssignmentLHS(node.Left, isRegularCompoundAssignment: true, stores, temps, isDynamic);
38var lhsRead = MakeRValue(transformedLHS);
39BoundExpression rewrittenAssignment;
59var sequence = ArrayBuilder<BoundExpression>.GetInstance();
95var condition = _factory.Conditional(isEvent, invokeEventAccessor.ToExpression(), rewrittenAssignment, rewrittenAssignment.Type);
105BoundExpression result = (temps.Count == 0 && stores.Count == 0) ?
118BoundExpression rewriteAssignment(BoundExpression leftRead)
131BoundExpression opLHS = leftRead;
142BoundExpression operand = MakeBinaryOperator(syntax, node.Operator.Kind, opLHS, loweredRight, node.Operator.ReturnType, node.Operator.Method, node.Operator.ConstrainedToTypeOpt, isCompoundAssignment: true);
145BoundExpression opFinal = operand;
161private BoundExpression? TransformPropertyOrEventReceiver(Symbol propertyOrEvent, BoundExpression? receiverOpt, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps)
191BoundExpression rewrittenReceiver = VisitExpression(receiverOpt);
227private BoundDynamicMemberAccess TransformDynamicMemberAccess(BoundDynamicMemberAccess memberAccess, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps)
235var rewrittenReceiver = VisitExpression(memberAccess.Receiver);
244private BoundIndexerAccess TransformIndexerAccess(BoundIndexerAccess indexerAccess, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps)
246var receiverOpt = indexerAccess.ReceiverOpt;
249BoundExpression transformedReceiver = VisitExpression(receiverOpt);
296ImmutableArray<BoundExpression> rewrittenArguments = VisitArgumentsAndCaptureReceiverIfNeeded(
317BoundExpression transformedReceiver,
318ImmutableArray<BoundExpression> rewrittenArguments,
319ArrayBuilder<BoundExpression> stores,
330BoundExpression[] actualArguments = new BoundExpression[parameters.Length]; // The actual arguments that will be passed; one actual argument per formal parameter.
351if (TryOptimizeParamsArray(array, out BoundExpression? optimized))
405private BoundExpression TransformImplicitIndexerAccess(
408ArrayBuilder<BoundExpression> stores,
423private BoundExpression TransformIndexPatternIndexerAccess(BoundImplicitIndexerAccess implicitIndexerAccess, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps, bool isDynamicAssignment)
426var access = GetUnderlyingIndexerOrSliceAccess(
459private bool TransformCompoundAssignmentFieldOrEventAccessReceiver(Symbol fieldOrEvent, ref BoundExpression? receiver, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps)
481BoundExpression rewrittenReceiver = VisitExpression(receiver);
502private BoundDynamicIndexerAccess TransformDynamicIndexerAccess(BoundDynamicIndexerAccess indexerAccess, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps)
504BoundExpression loweredReceiver;
519var loweredArguments = new BoundExpression[arguments.Length];
561private BoundExpression TransformCompoundAssignmentLHS(BoundExpression originalLHS, bool isRegularCompoundAssignment, ArrayBuilder<BoundExpression> stores, ArrayBuilder<LocalSymbol> temps, bool isDynamicAssignment)
640BoundExpression? receiverOpt = fieldAccess.ReceiverOpt;
669var loweredArray = VisitExpression(arrayAccess.Expression);
693var result = VisitExpression(originalLHS);
723BoundExpression? receiverOpt = eventAccess.ReceiverOpt;
751BoundExpression rewrittenVariable = VisitExpression(originalLHS);
765private BoundExpression BoxReceiver(BoundExpression rewrittenReceiver, NamedTypeSymbol memberContainingType)
776private BoundExpression SpillArrayElementAccess(
777BoundExpression loweredExpression,
778ImmutableArray<BoundExpression> loweredIndices,
779ArrayBuilder<BoundExpression> stores,
788var boundTempIndices = new BoundExpression[loweredIndices.Length];
822BoundExpression expression,
870BoundExpression expression)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (81)
48var objectCreation = VisitExpression(node.Operand);
62var rewrittenCollection = RewriteCollectionExpressionConversion(node.Conversion.UnderlyingConversions[0], (BoundCollectionExpression)node.Operand);
75var rewrittenOperand = VisitExpression(node.Operand);
79var result = MakeConversionNode(node, node.Syntax, rewrittenOperand, node.Conversion, node.Checked, node.ExplicitCastInCode, node.ConstantValueOpt, rewrittenType);
92private BoundExpression MakeUtf8Span(BoundExpression node, IReadOnlyList<byte>? bytes)
103BoundExpression result;
105BoundExpression utf8Bytes = bytes is null ?
106BadExpression(node.Syntax, byteArray, ImmutableArray<BoundExpression>.Empty) :
111result = BadExpression(node.Syntax, node.Type, ImmutableArray<BoundExpression>.Empty);
147var builder = ArrayBuilder<BoundExpression>.GetInstance(bytes.Count + 1);
160ImmutableArray.Create<BoundExpression>(_factory.Literal(builder.Count)),
166private BoundExpression VisitUtf8Addition(BoundBinaryOperator node)
172var stack = ArrayBuilder<BoundExpression>.GetInstance();
208BoundExpression result = MakeUtf8Span(node, haveRepresentationError ? null : bytesBuilder);
214private static bool IsFloatingPointExpressionOfUnknownPrecision(BoundExpression rewrittenNode)
262private BoundExpression MakeConversionNode(
265BoundExpression rewrittenOperand,
272var result = MakeConversionNodeCore(oldNodeOpt, syntax, rewrittenOperand, conversion, @checked, explicitCastInCode, constantValueOpt, rewrittenType);
297private BoundExpression MakeConversionNodeCore(
300BoundExpression rewrittenOperand,
390BoundExpression? nullableValue = NullableAlwaysHasValue(rewrittenOperand);
463var operand = MakeConversionNode(
512var rewrittenNode = RewriteDecimalConversion(syntax, rewrittenOperand, rewrittenOperand.Type, underlyingTypeTo, @checked, isImplicit: false, constantValueOpt: constantValueOpt);
570var receiver = (!method.RequiresInstanceReceiver && !oldNodeOpt.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ? _factory.Type(method.ContainingType) : mg.ReceiverOpt;
787private BoundExpression MakeConversionNode(BoundExpression rewrittenOperand, TypeSymbol rewrittenType, bool @checked, bool acceptFailingConversion = false, bool markAsChecked = false)
806BoundExpression rewrittenOperand,
836private BoundExpression MakeConversionNode(
838BoundExpression rewrittenOperand,
906BoundExpression userDefined = RewriteUserDefinedConversion(
946private BoundExpression RewriteTupleConversion(
948BoundExpression rewrittenOperand,
960var fieldAccessorsBuilder = ArrayBuilder<BoundExpression>.GetInstance(numElements);
969var fieldAccess = MakeTupleFieldAccessAndReportUseSiteDiagnostics(savedTuple, syntax, srcElementFields[i]);
970var convertedFieldAccess = MakeConversionNode(syntax, fieldAccess, elementConversions[i], destElementTypes[i].Type, @checked, explicitCastInCode);
974var result = MakeTupleCreationExpression(syntax, rewrittenType, fieldAccessorsBuilder.ToImmutableAndFree());
978internal static bool NullableNeverHasValue(BoundExpression expression)
993internal static BoundExpression? NullableAlwaysHasValue(BoundExpression expression)
1033private BoundExpression RewriteNullableConversion(
1035BoundExpression rewrittenOperand,
1063BoundExpression rewrittenConversion = MakeConversionNode(syntax, rewrittenOperand, conversion.UnderlyingConversions[0], rewrittenType.GetNullableUnderlyingType(), @checked);
1075BoundExpression? value = NullableAlwaysHasValue(rewrittenOperand);
1089private BoundExpression RewriteLiftedConversionInExpressionTree(
1091BoundExpression rewrittenOperand,
1141private BoundExpression RewriteFullyLiftedBuiltInConversion(
1143BoundExpression operand,
1155BoundExpression? optimized = OptimizeLiftedBuiltInConversion(syntax, operand, conversion, @checked, type);
1174BoundExpression condition = MakeNullableHasValue(syntax, boundTemp);
1176BoundExpression consequence = new BoundObjectCreationExpression(
1185BoundExpression alternative = new BoundDefaultExpression(syntax, type);
1186BoundExpression conditionalExpression = RewriteConditionalOperator(
1198sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
1203private BoundExpression? OptimizeLiftedUserDefinedConversion(
1205BoundExpression operand,
1219BoundExpression? nonNullValue = NullableAlwaysHasValue(operand);
1235private BoundExpression? OptimizeLiftedBuiltInConversion(
1237BoundExpression operand,
1256BoundExpression? nonNullValue = NullableAlwaysHasValue(operand);
1275private BoundExpression? DistributeLiftedConversionIntoLiftedOperand(
1277BoundExpression operand,
1337private BoundExpression RewriteUserDefinedConversion(
1339BoundExpression rewrittenOperand,
1369BoundExpression result = BoundCall.Synthesized(
1379private BoundExpression MakeLiftedUserDefinedConversionConsequence(BoundCall call, TypeSymbol resultType)
1391private BoundExpression RewriteLiftedUserDefinedConversion(
1393BoundExpression rewrittenOperand,
1415BoundExpression? optimized = OptimizeLiftedUserDefinedConversion(syntax, rewrittenOperand, conversion, rewrittenType);
1438BoundExpression condition = _factory.MakeNullableHasValue(syntax, boundTemp);
1454BoundExpression consequence = MakeLiftedUserDefinedConversionConsequence(userDefinedCall, rewrittenType);
1457BoundExpression alternative = new BoundDefaultExpression(syntax, rewrittenType);
1460BoundExpression conditionalExpression = RewriteConditionalOperator(
1474sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
1479private BoundExpression RewriteIntPtrConversion(
1481BoundExpression rewrittenOperand,
1526var rewrittenCall = MakeCall(
1695private BoundExpression RewriteDecimalConversion(SyntaxNode syntax, BoundExpression operand, TypeSymbol fromType, TypeSymbol toType, bool @checked, bool isImplicit, ConstantValue? constantValueOpt)
1726private BoundExpression RewriteDecimalConversionCore(SyntaxNode syntax, BoundExpression operand, TypeSymbol fromType, TypeSymbol toType, bool isImplicit, ConstantValue? constantValueOpt)
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (50)
37private BoundExpression? RewriteDeconstruction(BoundTupleExpression left, Conversion conversion, BoundExpression right, bool isUsed)
40var lhsEffects = ArrayBuilder<BoundExpression>.GetInstance();
43BoundExpression? result = RewriteDeconstruction(lhsTargets, conversion, left.Type, right, isUsed);
55private BoundExpression? RewriteDeconstruction(
59BoundExpression right,
79BoundExpression? returnValue = ApplyDeconstructionConversion(lhsTargets, right, conversion, temps, effects, isUsed, inInit: true);
88var last = effects.PopLast();
210private BoundExpression? ApplyDeconstructionConversion(
212BoundExpression right,
220ImmutableArray<BoundExpression> rightParts = GetRightParts(right, conversion, temps, effects, ref inInit);
222ImmutableArray<(BoundValuePlaceholder?, BoundExpression?)> deconstructConversionInfo = conversion.DeconstructConversionInfo;
226var builder = isUsed ? ArrayBuilder<BoundExpression>.GetInstance(leftTargets.Count) : null;
229BoundExpression? resultPart;
241var rightPart = rightParts[i];
246BoundExpression? leftTarget = leftTargets[i].Single;
277private ImmutableArray<BoundExpression> GetRightParts(BoundExpression right, Conversion conversion,
287BoundExpression evaluationResult = EvaluateSideEffectingArgumentToTemp(right,
334private ImmutableArray<BoundExpression> AccessTupleFields(BoundExpression expression, ArrayBuilder<LocalSymbol> temps,
335ArrayBuilder<BoundExpression> effects)
345BoundExpression tuple;
361var builder = ArrayBuilder<BoundExpression>.GetInstance(numElements);
364var fieldAccess = MakeTupleFieldAccessAndReportUseSiteDiagnostics(tuple, expression.Syntax, fields[i]);
370private BoundExpression EvaluateConversionToTemp(BoundExpression expression, BoundValuePlaceholder placeholder, BoundExpression conversion,
371ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> effects)
381private ImmutableArray<BoundExpression> InvokeDeconstructMethod(DeconstructMethodInfo deconstruction, BoundExpression target,
382ArrayBuilder<BoundExpression> effects, ArrayBuilder<LocalSymbol> temps)
387var outLocals = ArrayBuilder<BoundExpression>.GetInstance(outputPlaceholders.Length);
418private BoundExpression EvaluateSideEffectingArgumentToTemp(
419BoundExpression arg,
420ArrayBuilder<BoundExpression> effects,
423var loweredArg = VisitExpression(arg);
443private ArrayBuilder<Binder.DeconstructionVariable> GetAssignmentTargetsAndSideEffects(BoundTupleExpression variables, ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> effects)
447foreach (var variable in variables.Arguments)
463var temp = this.TransformCompoundAssignmentLHS(variable, isRegularCompoundAssignment: false,
475internal ArrayBuilder<BoundExpression> init = null!;
476internal ArrayBuilder<BoundExpression> deconstructions = null!;
477internal ArrayBuilder<BoundExpression> conversions = null!;
478internal ArrayBuilder<BoundExpression> assignments = null!;
483result.init = ArrayBuilder<BoundExpression>.GetInstance();
484result.deconstructions = ArrayBuilder<BoundExpression>.GetInstance();
485result.conversions = ArrayBuilder<BoundExpression>.GetInstance();
486result.assignments = ArrayBuilder<BoundExpression>.GetInstance();
502internal BoundExpression? PopLast()
515internal ImmutableArray<BoundExpression> ToImmutableAndFree()
Lowering\LocalRewriter\LocalRewriter_Event.cs (29)
21BoundExpression? rewrittenReceiverOpt = VisitExpression(node.ReceiverOpt);
22BoundExpression rewrittenArgument = VisitExpression(node.Argument);
54var rewrittenArguments = ImmutableArray.Create<BoundExpression>(rewrittenArgument);
87private BoundExpression RewriteWindowsRuntimeEventAssignmentOperator(SyntaxNode syntax, EventSymbol eventSymbol, EventAssignmentKind kind, BoundExpression? rewrittenReceiverOpt, BoundExpression rewrittenArgument)
104BoundExpression delegateCreationArgument = boundTemp ?? rewrittenReceiverOpt ?? _factory.Type(eventType);
114BoundExpression? clearCall = null;
124rewrittenArguments: ImmutableArray.Create<BoundExpression>(removeDelegate));
128clearCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(removeDelegate), ErrorTypeSymbol.UnknownResultType);
132ImmutableArray<BoundExpression> marshalArguments;
137marshalArguments = ImmutableArray.Create<BoundExpression>(removeDelegate, rewrittenArgument);
152marshalArguments = ImmutableArray.Create<BoundExpression>(addDelegate, removeDelegate, rewrittenArgument);
155BoundExpression marshalCall;
183ArrayBuilder<BoundExpression> sideEffects = ArrayBuilder<BoundExpression>.GetInstance(2); //max size
191private BoundExpression VisitWindowsRuntimeEventFieldAssignmentOperator(SyntaxNode syntax, BoundEventAccess left, BoundExpression rewrittenRight)
199BoundExpression? rewrittenReceiverOpt = VisitExpression(left.ReceiverOpt);
215BoundExpression? rewrittenReceiver = VisitExpression(node.ReceiverOpt);
219private BoundExpression MakeEventAccess(
221BoundExpression? rewrittenReceiver,
248BoundExpression getOrCreateCall;
265getOrCreateCall = new BoundBadExpression(syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(fieldAccess), ErrorTypeSymbol.UnknownResultType);
290private BoundExpression RewriteNoPiaEventAssignmentOperator(BoundEventAssignmentOperator node, BoundExpression rewrittenReceiver, BoundExpression rewrittenArgument)
296BoundExpression? result = null;
310BoundExpression eventInfo = _factory.New(ctor, _factory.Typeof(node.Event.ContainingType, ctor.Parameters[0].Type), _factory.Literal(node.Event.MetadataName));
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (29)
199BoundExpression? initializer = localDecl.InitializerOpt;
240BoundExpression initializerExpr = VisitExpression(fixedInitializer.Expression);
281var pointerValue = ApplyConversionIfNotIdentity(fixedInitializer.ElementPointerConversion, fixedInitializer.ElementPointerPlaceholder, addr);
307BoundExpression initializerExpr = VisitExpression(fixedInitializer.Expression);
329BoundExpression callReceiver;
363var tempAssignment = factory.AssignmentExpression(
375var pointerValue = ApplyConversionIfNotIdentity(fixedInitializer.ElementPointerConversion, fixedInitializer.ElementPointerPlaceholder, addr);
378BoundExpression pinAndGetPtr = factory.Sequence(
380sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
402sideEffects: ImmutableArray.Create<BoundExpression>(nullableTempAssignment),
442BoundExpression initializerExpr = VisitExpression(fixedInitializer.Expression);
463var addr = factory.Convert(
468var convertedStringTemp = ApplyConversionIfNotIdentity(fixedInitializer.ElementPointerConversion, fixedInitializer.ElementPointerPlaceholder, addr);
473BoundExpression notNullCheck = _factory.MakeNullCheck(factory.Syntax, factory.Local(localSymbol), BinaryOperatorKind.NotEqual);
474BoundExpression helperCall;
483helperCall = new BoundBadExpression(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType);
486BoundExpression addition = factory.Binary(BinaryOperatorKind.PointerAndIntAddition, localType, factory.Local(localSymbol), helperCall);
511BoundExpression initializerExpr = VisitExpression(fixedInitializer.Expression);
524BoundExpression arrayTempInit = factory.AssignmentExpression(factory.Local(pinnedTemp), initializerExpr);
527BoundExpression notNullCheck = _factory.MakeNullCheck(factory.Syntax, arrayTempInit, BinaryOperatorKind.NotEqual);
529BoundExpression lengthCall;
544lengthCall = new BoundBadExpression(fixedInitializer.Syntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(factory.Local(pinnedTemp)), ErrorTypeSymbol.UnknownResultType);
550BoundExpression lengthCheck = factory.Binary(BinaryOperatorKind.IntNotEqual, factory.SpecialType(SpecialType.System_Boolean), lengthCall, factory.Literal(0));
553BoundExpression condition = factory.Binary(BinaryOperatorKind.LogicalBoolAnd, factory.SpecialType(SpecialType.System_Boolean), notNullCheck, lengthCheck);
556BoundExpression firstElement = factory.ArrayAccessFirstElement(factory.Local(pinnedTemp));
560BoundExpression firstElementAddress = new BoundAddressOfOperator(factory.Syntax, firstElement, type: new PointerTypeSymbol(arrayElementType));
561BoundExpression convertedFirstElementAddress = ApplyConversionIfNotIdentity(fixedInitializer.ElementPointerConversion, fixedInitializer.ElementPointerPlaceholder, firstElementAddress);
564BoundExpression consequenceAssignment = factory.AssignmentExpression(factory.Local(localSymbol), convertedFirstElementAddress);
567BoundExpression alternativeAssignment = factory.AssignmentExpression(factory.Local(localSymbol), factory.Null(localType));
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (56)
41BoundExpression collectionExpression = GetUnconvertedCollectionExpression(node, out _);
140BoundExpression? elementConversion,
151BoundExpression rewrittenExpression = VisitExpression(convertedCollection.Operand);
162var receiver = ConvertReceiverForInvocation(forEachSyntax, rewrittenExpression, getEnumeratorInfo.Method, convertedCollection.Conversion, enumeratorInfo.CollectionType);
163BoundExpression? firstRewrittenArgument = null;
169var builder = ArrayBuilder<BoundExpression>.GetInstance(getEnumeratorInfo.Arguments.Length);
183BoundExpression enumeratorVarInitValue = SynthesizeCall(getEnumeratorInfo, forEachSyntax, receiver,
192BoundExpression iterationVarAssignValue = ApplyConversionIfNotIdentity(
217BoundExpression rewrittenCondition = SynthesizeCall(
357BoundExpression receiver;
358BoundExpression disposeCall;
434BoundExpression disposableVarInitValue = new BoundAsOperator(forEachSyntax,
445BoundExpression disposeCall = BoundCall.Synthesized(syntax: forEachSyntax, receiverOpt: boundDisposableVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method: disposeMethod);
475private BoundStatement WrapWithAwait(SyntaxNode forEachSyntax, BoundExpression disposeCall, BoundAwaitableInfo disposeAwaitableInfoOpt)
479var awaitExpr = RewriteAwaitExpression(forEachSyntax, disposeCall, disposeAwaitableInfoOpt, awaitExpressionType, debugInfo, used: false);
495private BoundExpression ConvertReceiverForInvocation(CSharpSyntaxNode syntax, BoundExpression receiver, MethodSymbol method, Conversion receiverConversion, TypeSymbol convertedReceiverType)
538private BoundExpression SynthesizeCall(MethodArgumentInfo methodArgumentInfo, CSharpSyntaxNode syntax, BoundExpression? receiver, bool allowExtensionAndOptionalParameters, BoundExpression? firstRewrittenArgument)
548return BoundCall.Synthesized(syntax, receiver, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, methodArgumentInfo.Method, arguments: ImmutableArray<BoundExpression>.Empty);
570BoundExpression collectionExpression = GetUnconvertedCollectionExpression(node, out _);
599BoundExpression collectionExpression,
602BoundExpression? elementConversion,
615BoundExpression rewrittenExpression = VisitExpression(collectionExpression);
649BoundExpression iterationVarInitValue = ApplyConversionIfNotIdentity(
663BoundExpression arrayLength = getLength(this, forEachSyntax, boundArrayVar, arg);
666BoundExpression exitCondition = new BoundBinaryOperator(
707private delegate BoundStatement? GetForEachStatementAsForPreamble(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind);
708private delegate BoundExpression GetForEachStatementAsForItem<TArg>(LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, BoundLocal boundArrayVar, BoundLocal boundPositionVar, TArg arg);
709private delegate BoundExpression GetForEachStatementAsForLength<TArg>(LocalRewriter rewriter, SyntaxNode syntax, BoundLocal boundArrayVar, TArg arg);
746return static (LocalRewriter rewriter, SyntaxNode syntax, ForEachEnumeratorInfo enumeratorInfo, ref BoundExpression rewrittenExpression, out LocalSymbol? preambleLocal, out RefKind collectionTempRefKind) =>
797BoundExpression arrayLength = rewriter._factory.Literal(length);
813BoundExpression iterationVarValue)
829BoundExpression loweredAssignment = VisitExpression(assignment);
876BoundExpression collectionExpression = GetUnconvertedCollectionExpression(node, out _);
896BoundExpression collectionExpression,
898BoundExpression? elementConversion,
910BoundExpression rewrittenExpression = VisitExpression(collectionExpression);
938BoundExpression iterationVarInitValue = ApplyConversionIfNotIdentity(
944indices: ImmutableArray.Create<BoundExpression>(boundPositionVar),
956BoundExpression arrayLength = new BoundArrayLength(
962BoundExpression exitCondition = new BoundBinaryOperator(
1025BoundExpression collectionExpression = GetUnconvertedCollectionExpression(node, out _);
1045BoundExpression collectionExpression,
1047BoundExpression? elementConversion,
1070BoundExpression rewrittenExpression = VisitExpression(collectionExpression);
1096ImmutableArray<BoundExpression> dimensionArgument = ImmutableArray.Create(
1102BoundExpression currentDimensionUpperBound = BoundCall.Synthesized(forEachSyntax, boundArrayVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getUpperBoundMethod, dimensionArgument);
1118BoundExpression iterationVarInitValue = ApplyConversionIfNotIdentity(
1123indices: ImmutableArray.Create((BoundExpression[])boundPositionVar),
1150ImmutableArray<BoundExpression> dimensionArgument = ImmutableArray.Create(
1156BoundExpression currentDimensionLowerBound = BoundCall.Synthesized(forEachSyntax, boundArrayVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getLowerBoundMethod, dimensionArgument);
1166BoundExpression exitCondition = new BoundBinaryOperator(
1225private static BoundExpression GetUnconvertedCollectionExpression(BoundForEachStatement node, out Conversion collectionConversion)
1240private BoundStatement MakeLocalDeclaration(CSharpSyntaxNode syntax, LocalSymbol local, BoundExpression rewrittenInitialValue)
Lowering\LocalRewriter\LocalRewriter_Index.cs (12)
18BoundExpression fromEnd = MakeLiteral(node.Syntax, ConstantValue.Create(true), booleanType);
20BoundExpression operand = VisitExpression(node.Operand);
34ArrayBuilder<BoundExpression> sideeffects = ArrayBuilder<BoundExpression>.GetInstance();
39BoundExpression condition = MakeOptimizedHasValue(operand.Syntax, operand);
42BoundExpression boundOperandGetValueOrDefault = MakeOptimizedGetValueOrDefault(operand.Syntax, operand);
43BoundExpression indexCreation = new BoundObjectCreationExpression(node.Syntax, node.MethodOpt, boundOperandGetValueOrDefault, fromEnd);
46BoundExpression consequence = ConvertToNullable(node.Syntax, node.Type, indexCreation);
49BoundExpression alternative = new BoundDefaultExpression(node.Syntax, node.Type);
52BoundExpression conditionalExpression = RewriteConditionalOperator(
69private BoundExpression ConvertToNullable(SyntaxNode syntax, TypeSymbol targetNullableType, BoundExpression underlyingValue)
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (81)
16private BoundExpression MakeDynamicIndexerAccessReceiver(BoundDynamicIndexerAccess indexerAccess, BoundExpression loweredReceiver)
18BoundExpression result;
41var loweredReceiver = VisitExpression(node.Receiver);
49private BoundExpression MakeDynamicGetIndex(
51BoundExpression loweredReceiver,
52ImmutableArray<BoundExpression> loweredArguments,
76private BoundExpression VisitIndexerAccess(BoundIndexerAccess node, bool isLeftOfAssignment)
84BoundExpression? rewrittenReceiver = VisitExpression(node.ReceiverOpt);
101private BoundExpression MakeIndexerAccess(
103BoundExpression rewrittenReceiver,
105ImmutableArray<BoundExpression> arguments,
111BoundExpression oldNode,
160ImmutableArray<BoundExpression> rewrittenArguments = VisitArgumentsAndCaptureReceiverIfNeeded(
178BoundExpression call = MakePropertyGetAccess(syntax, rewrittenReceiver, indexer, rewrittenArguments, argumentRefKindsOpt, getMethod);
192ImmutableArray<BoundExpression>.Empty,
206var rewrittenReceiver = VisitExpression(node.Expression);
218BoundExpression result;
231BoundExpression makeOffsetInput = DetermineMakePatternIndexOffsetExpressionStrategy(node.Argument, out PatternIndexOffsetLoweringStrategy strategy);
232BoundExpression integerArgument = makePatternIndexOffsetExpression(makeOffsetInput, length, strategy);
247BoundExpression? startMakeOffsetInput, endMakeOffsetInput, rewrittenRangeArg;
252var sideEffectsBuilder = ArrayBuilder<BoundExpression>.GetInstance();
254BoundExpression startExpr;
255BoundExpression rangeSizeExpr;
260BoundExpression endExpr = makePatternIndexOffsetExpression(endMakeOffsetInput, length, endStrategy);
269BoundExpression possiblyRefCapturedReceiver = rewrittenReceiver;
298ImmutableArray.Create((BoundExpression)receiverStore),
304BoundExpression makePatternIndexOffsetExpression(BoundExpression? makeOffsetInput, int length, PatternIndexOffsetLoweringStrategy strategy)
306BoundExpression integerArgument;
338BoundExpression getElementRef(BoundInlineArrayAccess node, BoundExpression rewrittenReceiver, BoundExpression index, MethodSymbol getItemOrSliceHelper, int length)
433private BoundExpression VisitImplicitIndexerAccess(BoundImplicitIndexerAccess node, bool isLeftOfAssignment)
454private BoundExpression VisitIndexPatternIndexerAccess(BoundImplicitIndexerAccess node, bool isLeftOfAssignment)
457var sideeffects = ArrayBuilder<BoundExpression>.GetInstance(2);
459BoundExpression rewrittenIndexerAccess = GetUnderlyingIndexerOrSliceAccess(
471private BoundExpression GetUnderlyingIndexerOrSliceAccess(
476ArrayBuilder<BoundExpression> sideeffects,
488BoundExpression makeOffsetInput = DetermineMakePatternIndexOffsetExpressionStrategy(node.Argument, out PatternIndexOffsetLoweringStrategy strategy);
490var receiver = VisitExpression(node.Receiver);
531BoundExpression integerArgument;
536BoundExpression lengthAccess = VisitExpression(node.LengthOrCountAccess);
565BoundExpression rewrittenIndexerAccess;
576ImmutableArray<BoundExpression> rewrittenArguments = VisitArgumentsAndCaptureReceiverIfNeeded(
622rewrittenIndexerAccess = (BoundExpression)VisitArrayAccess((BoundArrayAccess)node.IndexerOrSliceAccess);
642private BoundExpression MakePatternIndexOffsetExpression(
643BoundExpression? loweredExpr,
644BoundExpression? lengthAccess,
705private BoundExpression DetermineMakePatternIndexOffsetExpressionStrategy(
706BoundExpression unloweredExpr,
755private BoundExpression VisitRangePatternIndexerAccess(BoundImplicitIndexerAccess node)
759var sideEffectsBuilder = ArrayBuilder<BoundExpression>.GetInstance();
761var rewrittenIndexerAccess = VisitRangePatternIndexerAccess(node, localsBuilder, sideEffectsBuilder, cacheAllArgumentsOnly: false);
769private BoundExpression VisitRangePatternIndexerAccess(BoundImplicitIndexerAccess node, ArrayBuilder<LocalSymbol> localsBuilder, ArrayBuilder<BoundExpression> sideEffectsBuilder, bool cacheAllArgumentsOnly)
789var receiver = VisitExpression(node.Receiver);
790var rangeArg = node.Argument;
793BoundExpression? startMakeOffsetInput, endMakeOffsetInput, rewrittenRangeArg;
815var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(2);
851BoundExpression startExpr;
852BoundExpression rangeSizeExpr;
943BoundExpression? lengthAccess = null;
960BoundExpression endExpr = MakePatternIndexOffsetExpression(endMakeOffsetInput, lengthAccess, endStrategy);
987var rewrittenIndexerAccess = VisitExpression(sliceCall);
996private BoundExpression MakeRangeSize(ref BoundExpression startExpr, BoundExpression endExpr, ArrayBuilder<LocalSymbol> localsBuilder, ArrayBuilder<BoundExpression> sideEffectsBuilder)
1000BoundExpression rangeSizeExpr;
1027private void DeconstructRange(BoundExpression rewrittenRangeArg, BoundExpression lengthAccess, ArrayBuilder<LocalSymbol> localsBuilder, ArrayBuilder<BoundExpression> sideEffectsBuilder, out BoundExpression startExpr, out BoundExpression rangeSizeExpr)
1068private void RewriteRangeParts(BoundExpression rangeArg, out BoundRangeExpression? rangeExpr, out BoundExpression? startMakeOffsetInput, out PatternIndexOffsetLoweringStrategy startStrategy, out BoundExpression? endMakeOffsetInput, out PatternIndexOffsetLoweringStrategy endStrategy, out BoundExpression? rewrittenRangeArg)
1091if (rangeExpr.LeftOperandOpt is BoundExpression left)
1101if (rangeExpr.RightOperandOpt is BoundExpression right)
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (13)
19var stores = ArrayBuilder<BoundExpression>.GetInstance();
23BoundExpression transformedLHS = TransformCompoundAssignmentLHS(node.LeftOperand, isRegularCompoundAssignment: false, stores, temps, node.LeftOperand.HasDynamicType());
25var lhsRead = MakeRValue(transformedLHS);
26BoundExpression loweredRight = VisitExpression(node.RightOperand);
32BoundExpression rewriteNullCoalscingAssignmentStandard()
42BoundExpression assignment = MakeAssignmentOperator(syntax, transformedLHS, loweredRight, used: true, isChecked: false, isCompoundAssignment: false);
46BoundExpression conditionalExpression = MakeNullCoalescingOperator(syntax, lhsRead, assignment, leftPlaceholder: leftPlaceholder, leftConversion: leftPlaceholder, BoundNullCoalescingOperatorResultKind.LeftType, node.LeftOperand.Type);
61BoundExpression rewriteNullCoalescingAssignmentForValueType()
70var leftOperand = node.LeftOperand;
110var tmpAssignment = MakeAssignmentOperator(node.Syntax, tmp, loweredRight, used: true, isChecked: false, isCompoundAssignment: false);
116var transformedLhsAssignment =
129var alternative = _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create(tmpAssignment, transformedLhsAssignment), tmp);
132var ternary = _factory.Conditional(lhsReadHasValue, tmp, alternative, tmp.Type);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (19)
15BoundExpression rewrittenLeft = VisitExpression(node.LeftOperand);
16BoundExpression rewrittenRight = VisitExpression(node.RightOperand);
22private BoundExpression MakeNullCoalescingOperator(
24BoundExpression rewrittenLeft,
25BoundExpression rewrittenRight,
27BoundExpression? leftConversion,
105var notNullAccess = NullableAlwaysHasValue(conditionalAccess.WhenNotNull);
108BoundExpression? whenNullOpt = rewrittenRight;
136var unwrappedRight = RemoveIdentityConversions(rewrittenRight);
163BoundExpression nullCheck = _factory.MakeNullCheck(syntax, boundTemp, BinaryOperatorKind.NotEqual);
166BoundExpression convertedLeft = GetConvertedLeftForNullCoalescingOperator(boundTemp, leftPlaceholder, leftConversion, rewrittenResultType);
170BoundExpression conditionalExpression = RewriteConditionalOperator(
185sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
190private bool IsStringConcat(BoundExpression expression)
219private static BoundExpression RemoveIdentityConversions(BoundExpression expression)
235private BoundExpression GetConvertedLeftForNullCoalescingOperator(BoundExpression rewrittenLeft, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, TypeSymbol rewrittenResultType)
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (35)
21var constructorInvocation = _dynamicFactory.MakeDynamicConstructorInvocation(node.Syntax, node.Type, loweredArguments, node.ArgumentNamesOpt, node.ArgumentRefKindsOpt).ToExpression();
41BoundExpression? receiverDiscard = null;
45ImmutableArray<BoundExpression> rewrittenArguments = VisitArgumentsAndCaptureReceiverIfNeeded(
67BoundExpression rewrittenObjectCreation;
90BoundExpression? receiver = null;
107ImmutableArray<BoundExpression>.Empty,
134BoundExpression receiver = withExpr.Receiver;
160BoundExpression rewrittenReceiver = VisitExpression(receiver);
165var sideEffects = ArrayBuilder<BoundExpression>.GetInstance();
171BoundExpression value = _factory.New(anonymousType, getAnonymousTypeValues(withExpr, oldValue, anonymousType, sideEffects, temps));
176BoundExpression expression;
199ImmutableArray<BoundExpression> getAnonymousTypeValues(BoundWithExpression withExpr, BoundExpression oldValue, AnonymousTypeManager.AnonymousTypePublicSymbol anonymousType,
200ArrayBuilder<BoundExpression> sideEffects, ArrayBuilder<LocalSymbol> temps)
203var valueTemps = ArrayBuilder<BoundExpression?>.GetInstance(anonymousType.Properties.Length, fillWithValue: null);
205foreach (BoundExpression initializer in withExpr.InitializerExpression.Initializers)
212var rewrittenRight = VisitExpression(assignment.Right);
222var builder = ArrayBuilder<BoundExpression>.GetInstance(anonymousType.Properties.Length);
225if (valueTemps[property.MemberIndexOpt!.Value] is BoundExpression initializerValue)
255private BoundExpression MakeExpressionWithInitializer(
257BoundExpression rewrittenExpression,
258BoundExpression initializerExpression,
269ArrayBuilder<BoundExpression>? dynamicSiteInitializers = null;
271ArrayBuilder<BoundExpression>? loweredInitializers = ArrayBuilder<BoundExpression>.GetInstance();
276var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(1 + dynamicSiteCount + loweredInitializers.Count);
314var rewrittenNewT = MakeNewT(node.Syntax, (TypeParameterSymbol)node.Type);
323private BoundExpression MakeNewT(SyntaxNode syntax, TypeParameterSymbol typeParameter)
350ImmutableArray<BoundExpression>.Empty,
380BoundExpression newGuid;
389newGuid = new BoundBadExpression(node.Syntax, LookupResultKind.NotCreatable, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType);
399BoundExpression callGetTypeFromCLSID;
407callGetTypeFromCLSID = new BoundBadExpression(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, ErrorTypeSymbol.UnknownResultType);
411BoundExpression rewrittenObjectCreation;
419rewrittenObjectCreation = new BoundBadExpression(node.Syntax, LookupResultKind.OverloadResolutionFailure, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, node.Type);
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (65)
18private static BoundObjectInitializerExpressionBase UpdateInitializers(BoundObjectInitializerExpressionBase initializerExpression, ImmutableArray<BoundExpression> newInitializers)
32ref ArrayBuilder<BoundExpression>? dynamicSiteInitializers,
34ArrayBuilder<BoundExpression> result,
35BoundExpression rewrittenReceiver,
36BoundExpression initializerExpression)
66private ImmutableArray<BoundExpression> MakeObjectOrCollectionInitializersForExpressionTree(BoundExpression initializerExpression)
76var result = ArrayBuilder<BoundExpression>.GetInstance();
88private void AddCollectionInitializers(ArrayBuilder<BoundExpression> result, BoundExpression? rewrittenReceiver, ImmutableArray<BoundExpression> initializers)
92foreach (var initializer in initializers)
97BoundExpression? rewrittenInitializer;
118private BoundExpression MakeDynamicCollectionInitializer(BoundExpression rewrittenReceiver, BoundDynamicCollectionElementInitializer initializer)
140private BoundExpression? MakeCollectionInitializer(BoundExpression? rewrittenReceiver, BoundCollectionElementInitializer initializer)
176ImmutableArray<BoundExpression> rewrittenArguments = VisitArgumentsAndCaptureReceiverIfNeeded(
212private BoundExpression VisitObjectInitializerMember(BoundObjectInitializerMember node, ref BoundExpression rewrittenReceiver, ArrayBuilder<BoundExpression> sideEffects, ref ArrayBuilder<LocalSymbol>? temps)
216return (BoundExpression)base.VisitObjectInitializerMember(node)!;
219var originalReceiver = rewrittenReceiver;
250ref ArrayBuilder<BoundExpression>? dynamicSiteInitializers,
252ArrayBuilder<BoundExpression> result,
253BoundExpression rewrittenReceiver,
254ImmutableArray<BoundExpression> initializers)
258foreach (var initializer in initializers)
270ref ArrayBuilder<BoundExpression>? dynamicSiteInitializers,
272ArrayBuilder<BoundExpression> result,
273BoundExpression rewrittenReceiver,
279BoundExpression left = assignment.Left;
280BoundExpression right = assignment.Right;
291BoundExpression rewrittenAccess;
331dynamicSiteInitializers = ArrayBuilder<BoundExpression>.GetInstance();
336var rewrittenRight = VisitExpression(right);
366var rewrittenRight = VisitExpression(right);
381dynamicSiteInitializers = ArrayBuilder<BoundExpression>.GetInstance();
386var rewrittenRight = VisitExpression(right);
420var rangeArgument = getSubArrayCall.Arguments[1];
438var rewrittenRight = VisitExpression(right);
450var rewrittenIndex = VisitExpression(pointerAccess.Index);
471var rewrittenRight = VisitExpression(right);
505var rewrittenRight = VisitExpression(right);
535void addIndexes(ArrayBuilder<BoundExpression> result, BoundAssignmentOperator assignment)
538var lhs = assignment.Left;
541foreach (var argument in initializerMember.Arguments)
546foreach (var element in initializers.Initializers)
563foreach (var index in arrayAccess.Indices)
580foreach (var initializer in ((BoundObjectInitializerExpression)assignment.Right).Initializers)
587private ImmutableArray<BoundExpression> EvaluateSideEffectingArgumentsToTemps(
588ImmutableArray<BoundExpression> args,
590ArrayBuilder<BoundExpression> sideeffects,
593ArrayBuilder<BoundExpression>? newArgs = null;
597var arg = args[i];
599BoundExpression replacement;
605(LocalRewriter rewriter, ArrayBuilder<BoundExpression> sideeffects, ArrayBuilder<LocalSymbol>? temps) elementArg = (rewriter: this, sideeffects, temps);
608static (BoundExpression element, ref (LocalRewriter rewriter, ArrayBuilder<BoundExpression> sideeffects, ArrayBuilder<LocalSymbol>? temps) elementArg) =>
622newArgs = ArrayBuilder<BoundExpression>.GetInstance(args.Length);
637private BoundExpression EvaluateSideEffects(BoundExpression arg, RefKind refKind, ArrayBuilder<BoundExpression> sideeffects, ref ArrayBuilder<LocalSymbol>? temps)
657private BoundExpression MakeObjectInitializerMemberAccess(
658BoundExpression rewrittenReceiver,
Lowering\LocalRewriter\LocalRewriter_PropertyAccess.cs (10)
20private BoundExpression VisitPropertyAccess(BoundPropertyAccess node, bool isLeftOfAssignment)
22var rewrittenReceiverOpt = VisitExpression(node.ReceiverOpt);
26private BoundExpression MakePropertyAccess(
28BoundExpression? rewrittenReceiverOpt,
68private BoundExpression MakePropertyGetAccess(SyntaxNode syntax, BoundExpression? rewrittenReceiver, PropertySymbol property, BoundPropertyAccess? oldNodeOpt)
70return MakePropertyGetAccess(syntax, rewrittenReceiver, property, ImmutableArray<BoundExpression>.Empty, default, null, oldNodeOpt);
73private BoundExpression MakePropertyGetAccess(
75BoundExpression? rewrittenReceiver,
77ImmutableArray<BoundExpression> rewrittenArguments,
Lowering\LocalRewriter\LocalRewriter_Range.cs (25)
24var left = node.LeftOperandOpt;
30var right = node.RightOperandOpt;
42BoundExpression rangeCreation = MakeRangeExpression(node.MethodOpt, left, right);
52BoundExpression tryOptimizeOperand(BoundExpression operand)
77private BoundExpression LiftRangeExpression(BoundRangeExpression node, BoundExpression? left, BoundExpression? right)
84var sideeffects = ArrayBuilder<BoundExpression>.GetInstance();
88BoundExpression? condition = null;
91var rangeExpr = MakeRangeExpression(node.MethodOpt, left, right);
101BoundExpression consequence = new BoundObjectCreationExpression(node.Syntax, nullableCtor, rangeExpr);
104BoundExpression alternative = new BoundDefaultExpression(node.Syntax, node.Type);
109BoundExpression conditionalExpression = RewriteConditionalOperator(
125BoundExpression? getIndexFromPossibleNullable(BoundExpression? arg)
130BoundExpression tempOperand = CaptureExpressionInTempIfNeeded(arg, sideeffects, locals);
135BoundExpression operandHasValue = MakeOptimizedHasValue(tempOperand.Syntax, tempOperand);
156private BoundExpression MakeRangeExpression(
158BoundExpression? left,
159BoundExpression? right)
185var arg = left ?? right;
195return F.StaticCall(constructionMethod, ImmutableArray<BoundExpression>.Empty);
201BoundExpression newIndexZero(bool fromEnd) =>
205ImmutableArray.Create<BoundExpression>(F.Literal(0), F.Literal(fromEnd)));
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (12)
27var rewrittenCount = VisitExpression(stackAllocNode.Count);
47var stackSize = RewriteStackAllocCountToSize(rewrittenCount, elementType);
53var sideEffects = ArrayBuilder<BoundExpression>.GetInstance();
55var countTemp = CaptureExpressionInTempIfNeeded(rewrittenCount, sideEffects, locals, SynthesizedLocalKind.Spill);
56var stackSize = RewriteStackAllocCountToSize(countTemp, elementType);
60BoundExpression constructorCall;
71childBoundNodes: ImmutableArray<BoundExpression>.Empty,
97private BoundExpression RewriteStackAllocCountToSize(BoundExpression countExpression, TypeSymbol elementType)
117BoundExpression sizeOfExpression = _factory.Sizeof(elementType);
139BoundExpression convertedCount = _factory.Convert(uintType, countExpression, Conversion.ExplicitNumeric);
149BoundExpression product = _factory.Binary(multiplicationKind, uintPtrType, convertedCount, sizeOfExpression);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (53)
37private BoundExpression RewriteStringConcatenation(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type)
57var folded = TryFoldTwoConcatOperands(loweredLeft, loweredRight);
64ArrayBuilder<BoundExpression> leftFlattened = ArrayBuilder<BoundExpression>.GetInstance();
65ArrayBuilder<BoundExpression> rightFlattened = ArrayBuilder<BoundExpression>.GetInstance();
83BoundExpression? result;
149private void FlattenConcatArg(BoundExpression lowered, ArrayBuilder<BoundExpression> flattened)
167private bool TryExtractStringConcatArgs(BoundExpression lowered, out ImmutableArray<BoundExpression> arguments)
225var unwrappedArgsBuilder = ArrayBuilder<BoundExpression>.GetInstance(capacity: wrappedArgs.Length);
230foreach (var wrappedArg in wrappedArgs)
249var wrappedExpr = ConvertConcatExprToString(assignment.Right);
285private BoundExpression? TryFoldTwoConcatOperands(BoundExpression loweredLeft, BoundExpression loweredRight)
320private static bool IsNullOrEmptyStringConstant(BoundExpression operand)
355private BoundExpression RewriteStringConcatenationOneExpr(BoundExpression loweredOperand)
369private BoundExpression RewriteStringConcatenationTwoExprs(SyntaxNode syntax, BoundExpression loweredLeft, BoundExpression loweredRight)
380private BoundExpression RewriteStringConcatenationThreeExprs(SyntaxNode syntax, BoundExpression loweredFirst, BoundExpression loweredSecond, BoundExpression loweredThird)
392private BoundExpression RewriteStringConcatenationFourExprs(SyntaxNode syntax, BoundExpression loweredFirst, BoundExpression loweredSecond, BoundExpression loweredThird, BoundExpression loweredFourth)
405private BoundExpression RewriteStringConcatenationManyExprs(SyntaxNode syntax, ImmutableArray<BoundExpression> loweredArgs)
413var array = _factory.ArrayOrEmpty(_factory.SpecialType(SpecialType.System_String), loweredArgs);
418private bool TryRewriteStringConcatenationWithSpanBasedConcat(SyntaxNode syntax, ArrayBuilder<BoundExpression> args, [NotNullWhen(true)] out BoundExpression? result)
423var preparedArgs = ArrayBuilder<BoundExpression>.GetInstance(capacity: args.Count);
524static BoundExpression rewriteStringConcatenationWithSpanBasedConcat(
530ImmutableArray<BoundExpression> args)
532var preparedArgsBuilder = ArrayBuilder<BoundExpression>.GetInstance(capacity: args.Length);
535foreach (var arg in args)
593private BoundExpression RewriteStringConcatInExpressionLambda(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type)
609private BoundExpression ConvertConcatExprToString(BoundExpression expr)
730ImmutableArray.Create<BoundExpression>(store),
734BoundExpression makeConditionalAccess(BoundExpression receiver)
753static bool isFieldOfMarshalByRef(BoundExpression expr, CSharpCompilation compilation)
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (20)
16private BoundExpression RewriteInterpolatedStringConversion(BoundConversion conversion)
29private InterpolationHandlerResult RewriteToInterpolatedStringHandlerPattern(InterpolatedStringHandlerData data, ImmutableArray<BoundExpression> parts, SyntaxNode syntax)
65var handlerConstructionAssignment = _factory.AssignmentExpression(builderTemp, (BoundExpression)VisitObjectCreationExpression(construction));
69var resultExpressions = ArrayBuilder<BoundExpression>.GetInstance(parts.Length + 1);
71foreach (var part in parts)
76resultExpressions.Add((BoundExpression)VisitCall(call));
100BoundExpression? currentExpression = appendShouldProceedLocal;
165BoundExpression? result = null;
168var part = node.Parts[i];
219private BoundExpression LowerPartsToString(InterpolatedStringHandlerData data, ImmutableArray<BoundExpression> parts, SyntaxNode syntax, TypeSymbol type)
226BoundExpression toStringAndClearCall = toStringAndClear is not null
228: new BoundBadExpression(syntax, LookupResultKind.Empty, symbols: ImmutableArray<Symbol?>.Empty, childBoundNodes: ImmutableArray<BoundExpression>.Empty, type);
234private static void AssertNoImplicitInterpolatedStringHandlerConversions(ImmutableArray<BoundExpression> arguments, bool allowConversionsWithNoContext = false)
238foreach (var arg in arguments)
258private readonly ImmutableArray<BoundExpression> _expressions;
273public InterpolationHandlerResult(ImmutableArray<BoundExpression> expressions, BoundLocal handlerTemp, LocalSymbol? outTemp, LocalRewriter rewriter)
282public BoundExpression WithFinalResult(BoundExpression result)
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (75)
31var initEffects = ArrayBuilder<BoundExpression>.GetInstance();
34BoundExpression newLeft = ReplaceTerminalElementsWithTemps(node.Left, node.Operators, initEffects, temps);
35BoundExpression newRight = ReplaceTerminalElementsWithTemps(node.Right, node.Operators, initEffects, temps);
37var returnValue = RewriteTupleNestedOperators(node.Operators, newLeft, newRight, boolType, temps, node.OperatorKind);
38BoundExpression result = _factory.Sequence(temps.ToImmutableAndFree(), initEffects.ToImmutableAndFree(), returnValue);
42private bool IsLikeTupleExpression(BoundExpression expr, [NotNullWhen(true)] out BoundTupleExpression? tuple)
64var builder = ArrayBuilder<BoundExpression>.GetInstance(tuple.Arguments.Length);
67var element = tuple.Arguments[i];
98private BoundExpression PushDownImplicitTupleConversion(
99BoundExpression expr,
100ArrayBuilder<BoundExpression> initEffects,
112var fieldAccessorsBuilder = ArrayBuilder<BoundExpression>.GetInstance(numElements);
113var savedTuple = DeferSideEffectingArgumentToTempForTupleEquality(LowerConversions(boundConversion.Operand), initEffects, temps);
119var fieldAccess = MakeTupleFieldAccessAndReportUseSiteDiagnostics(savedTuple, syntax, srcElementFields[i]);
138private BoundExpression ReplaceTerminalElementsWithTemps(
139BoundExpression expr,
141ArrayBuilder<BoundExpression> initEffects,
152var builder = ArrayBuilder<BoundExpression>.GetInstance(tuple.Arguments.Length);
155var argument = tuple.Arguments[i];
156var newArgument = ReplaceTerminalElementsWithTemps(argument, multiple.Operators[i], initEffects, temps);
177/// That resulting expression must be passed through <see cref="LowerConversions(BoundExpression)"/> to
180private BoundExpression DeferSideEffectingArgumentToTempForTupleEquality(
181BoundExpression expr,
182ArrayBuilder<BoundExpression> effects,
202var deferredOperand = DeferSideEffectingArgumentToTempForTupleEquality(conv.Operand, effects, temps, conv.ExplicitCastInCode || enclosingConversionWasExplicit);
209var deferredOperand = DeferSideEffectingArgumentToTempForTupleEquality(
245private BoundExpression RewriteTupleOperator(TupleBinaryOperatorInfo @operator,
246BoundExpression left, BoundExpression right, TypeSymbol boolType,
266private BoundExpression RewriteTupleNestedOperators(TupleBinaryOperatorInfo.Multiple operators, BoundExpression left, BoundExpression right,
288var outerEffects = ArrayBuilder<BoundExpression>.GetInstance();
289var innerEffects = ArrayBuilder<BoundExpression>.GetInstance();
291BoundExpression leftHasValue, leftValue;
295BoundExpression rightHasValue, rightValue;
302BoundExpression logicalExpression = RewriteNonNullableNestedTupleOperators(operators, leftValue, rightValue, boolType, temps, operatorKind);
308BoundExpression innerSequence = _factory.Sequence(locals: ImmutableArray<LocalSymbol>.Empty, innerEffects.ToImmutableAndFree(), logicalExpression);
338BoundExpression outerSequence =
353private void MakeNullableParts(BoundExpression expr, ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> innerEffects,
354ArrayBuilder<BoundExpression> outerEffects, bool saveHasValue, out BoundExpression hasValue, out BoundExpression value, out bool isNullable)
376if (NullableAlwaysHasValue(expr) is BoundExpression knownValue)
395BoundExpression makeNullableHasValue(BoundExpression expr)
416private BoundLocal MakeTemp(BoundExpression loweredExpression, ArrayBuilder<LocalSymbol> temps, ArrayBuilder<BoundExpression> effects)
427private BoundExpression MakeValueOrDefaultTemp(
428BoundExpression expr,
430ArrayBuilder<BoundExpression> effects)
442var operand = MakeValueOrDefaultTemp(o, temps, effects);
449var argumentBuilder = ArrayBuilder<BoundExpression>.GetInstance(tupleCardinality);
467BoundExpression valueOrDefaultCall = MakeOptimizedGetValueOrDefault(expr.Syntax, expr);
472BoundExpression MakeBoundConversion(BoundExpression expr, Conversion conversion, TypeWithAnnotations type, BoundConversion enclosing)
484private BoundExpression RewriteNonNullableNestedTupleOperators(TupleBinaryOperatorInfo.Multiple operators,
485BoundExpression left, BoundExpression right, TypeSymbol type,
490BoundExpression? currentResult = null;
493BoundExpression leftElement = GetTuplePart(left, i);
494BoundExpression rightElement = GetTuplePart(right, i);
495BoundExpression nextLogicalOperand = RewriteTupleOperator(nestedOperators[i], leftElement, rightElement, type, temps, operatorKind);
515private BoundExpression GetTuplePart(BoundExpression tuple, int i)
541private BoundExpression RewriteTupleSingleOperator(TupleBinaryOperatorInfo.Single single,
542BoundExpression left, BoundExpression right, TypeSymbol boolType, BinaryOperatorKind operatorKind)
555BoundExpression dynamicResult = _dynamicFactory.MakeDynamicBinaryOperator(single.Kind, left, right, isCompoundAssignment: false, _compilation.DynamicType).ToExpression();
572BoundExpression binary = MakeBinaryOperator(_factory.Syntax, single.Kind, left, right, single.MethodSymbolOpt?.ReturnType ?? boolType, single.MethodSymbolOpt, single.ConstrainedToTypeOpt);
575BoundExpression result;
576BoundExpression convertedBinary = ApplyConversionIfNotIdentity(single.ConversionForBool, single.ConversionForBoolPlaceholder, binary);
606private BoundExpression LowerConversions(BoundExpression expr)
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (9)
27ImmutableArray<BoundExpression> rewrittenArguments = VisitList(node.Arguments);
37private BoundExpression RewriteTupleCreationExpression(BoundTupleExpression node, ImmutableArray<BoundExpression> rewrittenArguments)
43private BoundExpression MakeTupleCreationExpression(SyntaxNode syntax, NamedTypeSymbol type, ImmutableArray<BoundExpression> rewrittenArguments)
54ImmutableArray<BoundExpression> smallestCtorArguments = ImmutableArray.Create(rewrittenArguments,
69Binder.CheckRequiredMembersInObjectInitializer(smallestConstructor, initializers: ImmutableArray<BoundExpression>.Empty, syntax, _diagnostics);
83Binder.CheckRequiredMembersInObjectInitializer(tuple8Ctor, initializers: ImmutableArray<BoundExpression>.Empty, syntax, _diagnostics);
88ImmutableArray<BoundExpression> ctorArguments = ImmutableArray.Create(rewrittenArguments,
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (83)
58BoundExpression loweredOperand = VisitExpression(node.Operand);
62private BoundExpression MakeUnaryOperator(
67BoundExpression loweredOperand,
73private BoundExpression MakeUnaryOperator(
79BoundExpression loweredOperand,
139var newOperand = MakeConversionNode(loweredOperand, upconvertType, false);
178private BoundExpression LowerLiftedUnaryOperator(
183BoundExpression loweredOperand,
189BoundExpression? optimized = OptimizeLiftedUnaryOperator(kind, syntax, method, constrainedToTypeOpt, loweredOperand, type);
207BoundExpression condition = _factory.MakeNullableHasValue(syntax, boundTemp);
210BoundExpression call_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
213BoundExpression consequence = GetLiftedUnaryOperatorConsequence(kind, syntax, method, constrainedToTypeOpt, type, call_GetValueOrDefault);
216BoundExpression alternative = new BoundDefaultExpression(syntax, type);
221BoundExpression conditionalExpression = RewriteConditionalOperator(
237sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
242private BoundExpression? OptimizeLiftedUnaryOperator(
247BoundExpression loweredOperand,
259BoundExpression? neverNull = NullableAlwaysHasValue(loweredOperand);
275var result = LowerLiftedUnaryOperator(operatorKind, syntax, method, constrainedToTypeOpt, conditionalLeft!.WhenNotNull, type);
353private BoundExpression GetLiftedUnaryOperatorConsequence(UnaryOperatorKind kind, SyntaxNode syntax, MethodSymbol? method, TypeSymbol? constrainedToTypeOpt, TypeSymbol type, BoundExpression nonNullOperand)
358BoundExpression unliftedOp = MakeUnaryOperator(
368BoundExpression consequence = new BoundObjectCreationExpression(
432ArrayBuilder<BoundExpression> tempInitializers = ArrayBuilder<BoundExpression>.GetInstance();
438BoundExpression transformedLHS = TransformCompoundAssignmentLHS(node.Operand, isRegularCompoundAssignment: true, tempInitializers, tempSymbols, isDynamic);
447BoundExpression boundTemp = new BoundLocal(
455var newValue = makeIncrementOperator(node, rewrittenValueToIncrement: (isPrefix ? MakeRValue(transformedLHS) : boundTemp));
484static bool isIndirectOrInstanceField(BoundExpression expression)
502BoundExpression rewriteWithNotRefOperand(
506ArrayBuilder<BoundExpression> tempInitializers,
508BoundExpression transformedLHS,
509BoundExpression boundTemp,
510BoundExpression newValue)
516ImmutableArray<BoundExpression> assignments = ImmutableArray.Create<BoundExpression>(
530BoundExpression rewriteWithRefOperand(
534ArrayBuilder<BoundExpression> tempInitializers,
536BoundExpression operand,
537BoundExpression boundTemp,
538BoundExpression newValue)
542var tempValue = isPrefix ? newValue : MakeRValue(operand);
544var tempAssignment = MakeAssignmentOperator(syntax, boundTemp, tempValue, used: false, isChecked: isChecked, isCompoundAssignment: false);
546var operandValue = isPrefix ? boundTemp : newValue;
550ImmutableArray.Create<BoundExpression>(tempAssignment),
556BoundExpression operandAssignment = MakeAssignmentOperator(syntax, operand, tempAssignedAndOperandValue, used: false, isChecked: isChecked, isCompoundAssignment: false);
569BoundExpression makeIncrementOperator(BoundIncrementOperator node, BoundExpression rewrittenValueToIncrement)
576BoundExpression result;
595private BoundExpression ApplyConversionIfNotIdentity(BoundExpression? conversion, BoundValuePlaceholder? placeholder, BoundExpression replacement)
606static bool hasNonIdentityConversion([NotNullWhen(true)] BoundExpression? expression)
622private BoundExpression ApplyConversion(BoundExpression conversion, BoundValuePlaceholder placeholder, BoundExpression replacement)
630private BoundExpression MakeUserDefinedIncrementOperator(BoundIncrementOperator node, BoundExpression rewrittenValueToIncrement)
647BoundExpression rewrittenArgument = ApplyConversionIfNotIdentity(node.OperandConversion, node.OperandPlaceholder, rewrittenValueToIncrement);
675BoundExpression condition = _factory.MakeNullableHasValue(node.Syntax, boundTemp);
678BoundExpression call_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
681BoundExpression userDefinedCall = BoundCall.Synthesized(
689BoundExpression consequence = new BoundObjectCreationExpression(syntax, ctor, userDefinedCall);
692BoundExpression alternative = new BoundDefaultExpression(syntax, type);
697BoundExpression conditionalExpression = RewriteConditionalOperator(
713sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
718private BoundExpression MakeBuiltInIncrementOperator(BoundIncrementOperator node, BoundExpression rewrittenValueToIncrement)
720BoundExpression result;
747BoundExpression boundOne = MakeLiteral(
760BoundExpression binaryOperand = rewrittenValueToIncrement;
786BoundExpression binOp;
824private BoundExpression MakeDecimalIncDecOperator(SyntaxNode syntax, BinaryOperatorKind oper, BoundExpression operand)
831private BoundExpression MakeLiftedDecimalIncDecOperator(SyntaxNode syntax, BinaryOperatorKind oper, BoundExpression operand)
841BoundExpression condition = _factory.MakeNullableHasValue(syntax, operand);
843BoundExpression getValueCall = BoundCall.Synthesized(syntax, operand, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
845BoundExpression methodCall = BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, getValueCall);
847BoundExpression consequence = new BoundObjectCreationExpression(syntax, ctor, methodCall);
849BoundExpression alternative = new BoundDefaultExpression(syntax, operand.Type);
860private BoundExpression MakeRValue(BoundExpression transformedExpression)
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (57)
73BoundExpression loweredOperand,
99var binderConstruction = MakeBinderConstruction(WellKnownMember.Microsoft_CSharp_RuntimeBinder_Binder__Convert, new[]
116BoundExpression loweredOperand,
152BoundExpression loweredLeft,
153BoundExpression loweredRight,
172var loweredArguments = ImmutableArray.Create<BoundExpression>(loweredLeft, loweredRight);
195BoundExpression loweredReceiver,
197ImmutableArray<BoundExpression> loweredArguments,
263BoundExpression loweredReceiver,
264BoundExpression loweredHandler)
270var loweredArguments = ImmutableArray<BoundExpression>.Empty;
296BoundExpression loweredReceiver,
297ImmutableArray<BoundExpression> loweredArguments,
335ImmutableArray<BoundExpression> loweredArguments,
341var loweredReceiver = _factory.Typeof(type, _factory.WellKnownType(WellKnownType.System_Type));
360BoundExpression loweredReceiver,
372var loweredArguments = ImmutableArray<BoundExpression>.Empty;
395BoundExpression loweredReceiver,
397BoundExpression loweredRight,
414var loweredArguments = ImmutableArray<BoundExpression>.Empty;
436BoundExpression loweredReceiver,
437ImmutableArray<BoundExpression> loweredArguments,
462BoundExpression loweredReceiver,
463ImmutableArray<BoundExpression> loweredArguments,
466BoundExpression loweredRight,
500internal LoweredDynamicOperation MakeDynamicIsEventTest(string name, BoundExpression loweredReceiver)
504var binderConstruction = MakeBinderConstruction(WellKnownMember.Microsoft_CSharp_RuntimeBinder_Binder__IsEvent, new[]
516return MakeDynamicOperation(binderConstruction, loweredReceiver, RefKind.None, ImmutableArray<BoundExpression>.Empty, default(ImmutableArray<RefKind>), null, resultType);
524private BoundExpression? MakeBinderConstruction(WellKnownMember factoryMethod, BoundExpression[] args)
542internal RefKind GetReceiverRefKind(BoundExpression loweredReceiver)
558internal BoundExpression MakeCallSiteArgumentInfos(
560ImmutableArray<BoundExpression> loweredArguments,
563BoundExpression? loweredReceiver = null,
566BoundExpression? loweredRight = null)
573var infos = new BoundExpression[(loweredReceiver != null ? 1 : 0) + loweredArguments.Length + (loweredRight != null ? 1 : 0)];
599BoundExpression? binderConstruction,
600BoundExpression? loweredReceiver,
602ImmutableArray<BoundExpression> loweredArguments,
604BoundExpression? loweredRight,
649var nullCallSite = _factory.Null(callSiteField.Type);
651var siteInitialization = _factory.Conditional(
670private ImmutableArray<LocalSymbol> MakeTempsForDiscardArguments(ref ImmutableArray<BoundExpression> loweredArguments)
719BoundExpression? loweredReceiver,
721ImmutableArray<BoundExpression> loweredArguments,
723BoundExpression? loweredRight,
798private BoundExpression GetArgumentInfo(
800BoundExpression boundArgument,
873private static ImmutableArray<BoundExpression> GetCallSiteArguments(BoundExpression callSiteFieldAccess, BoundExpression? receiver, ImmutableArray<BoundExpression> arguments, BoundExpression? right)
875var result = new BoundExpression[1 + (receiver != null ? 1 : 0) + arguments.Length + (right != null ? 1 : 0)];
896private TypeSymbol[] MakeCallSiteDelegateSignature(TypeSymbol callSiteType, BoundExpression? receiver, ImmutableArray<BoundExpression> arguments, BoundExpression? right, TypeSymbol resultType)
Lowering\MethodToClassRewriter.cs (53)
41protected abstract BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass);
54private readonly Dictionary<BoundValuePlaceholderBase, BoundExpression> _placeholderMap;
65this._placeholderMap = new Dictionary<BoundValuePlaceholderBase, BoundExpression>();
137(BoundExpression?)this.Visit(node.ExceptionSourceOpt),
140(BoundExpression?)this.Visit(node.ExceptionFilterOpt),
167var newSideEffects = VisitList<BoundExpression>(node.SideEffects);
168var newValue = (BoundExpression)this.Visit(node.Value);
178var condition = (BoundExpression?)this.Visit(node.Condition);
187BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
195BoundExpression condition = (BoundExpression)this.Visit(node.Condition);
204var expression = (BoundExpression?)this.Visit(node.ExpressionOpt);
225var rewrittenReceiver = (BoundExpression?)Visit(node.ReceiverOpt);
232var rewrittenReceiver = (BoundExpression?)this.Visit(node.ReceiverOpt);
233var rewrittenArguments = (ImmutableArray<BoundExpression>)this.VisitList(node.Arguments);
276(BoundExpression)Visit(node.Left),
277(BoundExpression)Visit(node.Right),
284(BoundExpression)Visit(node.Operand),
301(BoundExpression)Visit(node.Operand),
319(BoundExpression)Visit(node.Left),
320(BoundExpression)Visit(node.Right),
466var getAwaiter = (BoundExpression?)this.Visit(node.GetAwaiter);
482BoundExpression originalLeft = node.Left;
491BoundExpression originalRight = node.Right;
510BoundExpression rewrittenLeft = (BoundExpression)this.Visit(leftLocal);
511BoundExpression rewrittenRight = (BoundExpression)this.Visit(originalRight);
537ImmutableArray.Create<BoundExpression>(tempAssignment),
554var receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt);
586BoundExpression originalArgument = node.Argument;
587BoundExpression rewrittenArgument = (BoundExpression)this.Visit(originalArgument);
608var receiver = (BoundExpression)this.Visit(node.Receiver);
609var whenNotNull = (BoundExpression)this.Visit(node.WhenNotNull);
610var whenNullOpt = (BoundExpression?)this.Visit(node.WhenNullOpt);
697ImmutableArray<BoundExpression> arguments = (ImmutableArray<BoundExpression>)this.VisitList(node.Arguments);
719BoundExpression operand = (BoundExpression)this.Visit(node.Operand);
725private static bool BaseReferenceInReceiverWasRewritten([NotNullWhen(true)] BoundExpression? originalReceiver, [NotNullWhen(true)] BoundExpression? rewrittenReceiver)
Lowering\SpillSequenceSpiller.cs (76)
39public readonly BoundExpression Value;
44public BoundSpillSequenceBuilder(SyntaxNode syntax, BoundExpression value = null)
82internal BoundSpillSequenceBuilder Update(BoundExpression value)
158internal void AddExpressions(ImmutableArray<BoundExpression> expressions)
160foreach (var expression in expressions)
244private BoundExpression VisitExpression(ref BoundSpillSequenceBuilder builder, BoundExpression expression)
246var e = (BoundExpression)this.Visit(expression);
265private static BoundExpression UpdateExpression(BoundSpillSequenceBuilder builder, BoundExpression expression)
302private BoundExpression Spill(
304BoundExpression expression,
370var left = Spill(builder, assignment.Left, RefKind.Ref);
371var right = Spill(builder, assignment.Right, RefKind.Ref);
419var receiver = Spill(builder, field.ReceiverOpt, fieldSymbol.ContainingType.IsValueType ? refKind : RefKind.None);
520BoundExpression spillInlineArrayHelperWithTwoArguments(BoundSpillSequenceBuilder builder, BoundCall call)
583private ImmutableArray<BoundExpression> VisitExpressionList(
585ImmutableArray<BoundExpression> args,
629var result = ArrayBuilder<BoundExpression>.GetInstance(newList.Length);
635var replacement = Spill(builder, newList[i], refKind, sideEffectsOnly);
666var expression = VisitExpression(ref builder, node.Expression);
673BoundExpression expression = VisitExpression(ref builder, node.ExpressionOpt);
680BoundExpression expr = VisitExpression(ref builder, node.Expression);
689var condition = VisitExpression(ref builder, node.Condition);
696var expression = VisitExpression(ref builder, node.ExpressionOpt);
703var expression = VisitExpression(ref builder, node.Expression);
709BoundExpression exceptionSourceOpt = (BoundExpression)this.Visit(node.ExceptionSourceOpt);
715var exceptionFilterOpt = VisitExpression(ref builder, node.ExceptionFilterOpt);
745var expr = VisitExpression(ref builder, node.Expression);
758var value = VisitExpression(ref builder, node.Value);
765var expr = VisitExpression(ref builder, node.Operand);
779var expression = VisitExpression(ref builder, node.Expression);
809ImmutableArray<BoundExpression> bounds;
836BoundExpression count = VisitExpression(ref builder, node.Count);
844var expression = VisitExpression(ref builder, node.Expression);
851var operand = VisitExpression(ref builder, node.Operand);
860var right = VisitExpression(ref builder, node.Right);
862BoundExpression left = node.Left;
891var expression = VisitExpression(ref leftBuilder, arrayAccess.Expression);
917BoundExpression fieldWithSpilledReceiver(BoundFieldAccess field, ref BoundSpillSequenceBuilder leftBuilder, bool isAssignmentTarget)
923BoundExpression receiver;
938var expression = VisitExpression(ref leftBuilder, arrayAccess.Expression);
983var right = VisitExpression(ref builder, node.Right);
984BoundExpression left;
1021BoundExpression receiver = null;
1071private static RefKind ReceiverSpillRefKind(BoundExpression receiver)
1087BoundExpression invokedExpression;
1107var condition = VisitExpression(ref conditionBuilder, node.Condition);
1110var consequence = VisitExpression(ref consequenceBuilder, node.Consequence);
1113var alternative = VisitExpression(ref alternativeBuilder, node.Alternative);
1183var operand = VisitExpression(ref builder, node.Operand);
1192var expression = VisitExpression(ref builder, node.Expression);
1208var argument = VisitExpression(ref builder, node.Argument);
1215var receiver = VisitExpression(ref builder, node.ReceiverOpt);
1222var operand = VisitExpression(ref builder, node.Operand);
1229var operand = VisitExpression(ref builder, node.Operand);
1238var right = VisitExpression(ref builder, node.RightOperand);
1239BoundExpression left;
1268var receiver = VisitExpression(ref receiverBuilder, node.Receiver);
1271var whenNotNull = VisitExpression(ref whenNotNullBuilder, node.WhenNotNull);
1274var whenNullOpt = VisitExpression(ref whenNullBuilder, node.WhenNullOpt);
1285BoundExpression condition;
1310var isNotClass = _F.IsNotNullReference(_F.Default(receiver.Type));
1354private readonly BoundExpression _receiver;
1362private ConditionalReceiverReplacer(BoundExpression receiver, int receiverId, int recursionDepth)
1369public static BoundStatement Replace(BoundNode node, BoundExpression receiver, int receiverID, int recursionDepth)
1423var index = VisitExpression(ref builder, node.Index);
1424BoundExpression expression;
1444var operand = VisitExpression(ref builder, node.Operand);
1451var value = VisitExpression(ref valueBuilder, node.Value);
1477BoundExpression operand = VisitExpression(ref builder, node.Expression);
1507BoundExpression operand = VisitExpression(ref builder, node.Operand);
1514BoundExpression operand = VisitExpression(ref builder, node.Operand);
1521BoundExpression expression = VisitExpression(ref builder, node.Expression);
Lowering\StateMachineRewriter\CapturedSymbol.cs (12)
26public abstract BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg);
39public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg)
41var frame = makeFrame(this.HoistedField.ContainingType, arg);
57public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg)
59var frame = makeFrame(this.HoistedField.ContainingType, arg);
67private readonly BoundExpression _replacement;
70public CapturedToExpressionSymbolReplacement(BoundExpression replacement, ImmutableArray<StateMachineFieldSymbol> hoistedFields, bool isReusable)
77public override BoundExpression Replacement<TArg>(SyntaxNode node, Func<NamedTypeSymbol, TArg, BoundExpression> makeFrame, TArg arg)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (20)
149BoundExpression thisProxyReplacement = thisProxy.Replacement(F.Syntax, static (frameType, F) => F.This(), F);
204protected override BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass)
344var variableCleanup = ArrayBuilder<BoundExpression>.GetInstance();
434private void AddVariableCleanup(ArrayBuilder<BoundExpression> cleanup, FieldSymbol field)
448var variableCleanup = ArrayBuilder<BoundExpression>.GetInstance();
508private BoundExpression HoistRefInitialization(SynthesizedLocal local, BoundAssignmentOperator node)
522var right = (BoundExpression)Visit(node.Right);
524var sideEffects = ArrayBuilder<BoundExpression>.GetInstance();
551var replacement = HoistExpression(right, awaitSyntaxOpt, syntaxOffset, local.RefKind, sideEffects, hoistedFields, ref needsSacrificialEvaluation);
574private BoundExpression HoistExpression(
575BoundExpression expr,
579ArrayBuilder<BoundExpression> sideEffects,
588BoundExpression expression = HoistExpression(array.Expression, awaitSyntaxOpt, syntaxOffset, RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation);
589var indices = ArrayBuilder<BoundExpression>.GetInstance();
590foreach (var index in array.Indices)
616var receiver = HoistExpression(field.ReceiverOpt, awaitSyntaxOpt, syntaxOffset,
823BoundExpression expression = (BoundExpression)this.Visit(node.Expression);
947var fetchThis = proxy.Replacement(F.Syntax, static (frameType, F) => F.This(), F);
Lowering\StateMachineRewriter\StateMachineRewriter.cs (10)
318var leftExpression = proxy.Replacement(
332var leftExpression = proxy.Replacement(
379protected BoundExpression MakeCurrentThreadId()
402protected SynthesizedImplementationMethod GenerateIteratorGetEnumerator(MethodSymbol getEnumeratorMethod, ref BoundExpression managedThreadId, StateMachineState initialState)
472var leftExpression = proxy.Replacement(
477var rightExpression = copySrc[method.ThisParameter].Replacement(F.Syntax, static (stateMachineType, F) => F.This(), F);
491BoundExpression resultParameter = proxy.Replacement(
497BoundExpression parameterProxy = copySrc[parameter].Replacement(F.Syntax, static (stateMachineType, F) => F.This(), F);
519protected virtual BoundStatement InitializeParameterField(MethodSymbol getEnumeratorMethod, ParameterSymbol parameter, BoundExpression resultParameter, BoundExpression parameterProxy)
Lowering\SyntheticBoundNodeFactory.cs (182)
220public BoundExpression This(LocalSymbol thisTempOpt)
222return (thisTempOpt != null) ? Local(thisTempOpt) : (BoundExpression)This();
233return new BoundBadExpression(Syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, type, hasErrors: true);
241public BoundFieldAccess Field(BoundExpression? receiver, FieldSymbol f)
251public BoundExpression Property(WellKnownMember member)
256public BoundExpression Property(BoundExpression? receiverOpt, WellKnownMember member)
265public BoundExpression Property(BoundExpression? receiverOpt, PropertySymbol property)
280public BoundExpression Indexer(BoundExpression? receiverOpt, PropertySymbol property, BoundExpression arg0)
408public BoundExpressionStatement Assignment(BoundExpression left, BoundExpression right, bool isRef = false)
413public BoundExpressionStatement ExpressionStatement(BoundExpression expr)
421public BoundExpression AssignmentExpression(BoundExpression left, BoundExpression right, bool isRef = false)
429public BoundExpression AssignmentExpression(SyntaxNode syntax, BoundExpression left, BoundExpression right, bool isRef = false, bool hasErrors = false, bool wasCompilerGenerated = false)
543public BoundReturnStatement Return(BoundExpression? expression = null)
629public BoundBinaryOperator Binary(BinaryOperatorKind kind, TypeSymbol type, BoundExpression left, BoundExpression right)
634public BoundAsOperator As(BoundExpression operand, TypeSymbol type)
639public BoundIsOperator Is(BoundExpression operand, TypeSymbol type)
648public BoundBinaryOperator LogicalAnd(BoundExpression left, BoundExpression right)
655public BoundBinaryOperator LogicalOr(BoundExpression left, BoundExpression right)
662public BoundBinaryOperator IntEqual(BoundExpression left, BoundExpression right)
667public BoundBinaryOperator ObjectEqual(BoundExpression left, BoundExpression right)
672public BoundExpression IsNotNullReference(BoundExpression value)
678public BoundBinaryOperator ObjectNotEqual(BoundExpression left, BoundExpression right)
683public BoundBinaryOperator IntNotEqual(BoundExpression left, BoundExpression right)
688public BoundBinaryOperator IntLessThan(BoundExpression left, BoundExpression right)
693public BoundBinaryOperator IntGreaterThanOrEqual(BoundExpression left, BoundExpression right)
698public BoundBinaryOperator IntSubtract(BoundExpression left, BoundExpression right)
703public BoundBinaryOperator IntMultiply(BoundExpression left, BoundExpression right)
731public BoundObjectCreationExpression New(NamedTypeSymbol type, params BoundExpression[] args)
737public BoundObjectCreationExpression New(MethodSymbol ctor, params BoundExpression[] args)
740public BoundObjectCreationExpression New(NamedTypeSymbol type, ImmutableArray<BoundExpression> args)
746public BoundObjectCreationExpression New(MethodSymbol ctor, ImmutableArray<BoundExpression> args)
749public BoundObjectCreationExpression New(MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKinds)
764public BoundObjectCreationExpression New(WellKnownMember wm, ImmutableArray<BoundExpression> args)
770public BoundExpression MakeIsNotANumberTest(BoundExpression input)
785public BoundExpression StaticCall(TypeSymbol receiver, MethodSymbol method, params BoundExpression[] args)
795public BoundExpression StaticCall(MethodSymbol method, ImmutableArray<BoundExpression> args)
798public BoundExpression StaticCall(WellKnownMember method, params BoundExpression[] args)
806public BoundExpression StaticCall(WellKnownMember method, ImmutableArray<TypeSymbol> typeArgs, params BoundExpression[] args)
817public BoundExpression StaticCall(SpecialMember method, params BoundExpression[] args)
824public BoundCall Call(BoundExpression? receiver, MethodSymbol method)
826return Call(receiver, method, ImmutableArray<BoundExpression>.Empty);
829public BoundCall Call(BoundExpression? receiver, MethodSymbol method, BoundExpression arg0, bool useStrictArgumentRefKinds = false)
834public BoundCall Call(BoundExpression? receiver, MethodSymbol method, BoundExpression arg0, BoundExpression arg1, bool useStrictArgumentRefKinds = false)
839public BoundCall Call(BoundExpression? receiver, MethodSymbol method, params BoundExpression[] args)
841return Call(receiver, method, ImmutableArray.Create<BoundExpression>(args));
844public BoundCall Call(BoundExpression? receiver, WellKnownMember method, BoundExpression arg0)
847public BoundCall Call(BoundExpression? receiver, MethodSymbol method, ImmutableArray<BoundExpression> args, bool useStrictArgumentRefKinds = false)
884public BoundCall Call(BoundExpression? receiver, MethodSymbol method, ImmutableArray<RefKind> refKinds, ImmutableArray<BoundExpression> args)
894public BoundExpression Conditional(BoundExpression condition, BoundExpression consequence, BoundExpression alternative, TypeSymbol type, bool isRef = false)
899public BoundComplexConditionalReceiver ComplexConditionalReceiver(BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver)
906public BoundExpression Coalesce(BoundExpression left, BoundExpression right)
914public BoundStatement If(BoundExpression condition, BoundStatement thenClause, BoundStatement? elseClauseOpt = null)
919public BoundStatement ConditionalGoto(BoundExpression condition, LabelSymbol label, bool jumpIfTrue)
924public BoundStatement If(BoundExpression condition, ImmutableArray<LocalSymbol> locals, BoundStatement thenClause, BoundStatement? elseClauseOpt = null)
975public BoundThrowStatement Throw(BoundExpression e)
985public BoundExpression MakeSequence(LocalSymbol temp, params BoundExpression[] parts)
990public BoundExpression MakeSequence(params BoundExpression[] parts)
995public BoundExpression MakeSequence(ImmutableArray<LocalSymbol> locals, params BoundExpression[] parts)
997var builder = ArrayBuilder<BoundExpression>.GetInstance();
1000var part = parts[i];
1006var lastExpression = parts[parts.Length - 1];
1017public BoundSequence Sequence(BoundExpression[] sideEffects, BoundExpression result, TypeSymbol? type = null)
1024public BoundExpression Sequence(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression result)
1033public BoundSpillSequence SpillSequence(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression result)
1063public BoundStatement Switch(BoundExpression ex, ImmutableArray<SyntheticSwitchSection> sections)
1158public BoundArrayLength ArrayLength(BoundExpression array)
1164public BoundArrayAccess ArrayAccessFirstElement(BoundExpression array)
1168ImmutableArray<BoundExpression> firstElementIndices = ArrayBuilder<BoundExpression>.GetInstance(rank, Literal(0)).ToImmutableAndFree();
1172public BoundArrayAccess ArrayAccess(BoundExpression array, params BoundExpression[] indices)
1177public BoundArrayAccess ArrayAccess(BoundExpression array, ImmutableArray<BoundExpression> indices)
1212public BoundExpression ThrowExpression(BoundExpression thrown, TypeSymbol type)
1217public BoundExpression Null(TypeSymbol type)
1223public BoundExpression NullRef(TypeWithAnnotations type)
1229public static BoundExpression Null(TypeSymbol type, SyntaxNode syntax)
1232BoundExpression nullLiteral = new BoundLiteral(syntax, ConstantValue.Null, type) { WasCompilerGenerated = true };
1243public BoundExpression Typeof(WellKnownType type, TypeSymbol systemType)
1248public BoundExpression Typeof(TypeSymbol type, TypeSymbol systemType)
1274public BoundExpression Typeof(TypeWithAnnotations type, TypeSymbol systemType)
1279public ImmutableArray<BoundExpression> TypeOfs(ImmutableArray<TypeWithAnnotations> typeArguments, TypeSymbol systemType)
1284public BoundExpression TypeofDynamicOperationContextType()
1290public BoundExpression Sizeof(TypeSymbol type)
1295internal BoundExpression ConstructorInfo(MethodSymbol ctor)
1313public BoundExpression MethodDefIndex(MethodSymbol method)
1322public BoundExpression LocalId(LocalSymbol symbol)
1332public BoundExpression ParameterId(ParameterSymbol symbol)
1342public BoundExpression StateMachineInstanceId()
1354public BoundExpression ModuleVersionId()
1359public BoundExpression ModuleVersionIdString()
1364public BoundExpression InstrumentationPayloadRoot(int analysisKind, TypeSymbol payloadType)
1369public BoundExpression ThrowIfModuleCancellationRequested()
1372public BoundExpression ModuleCancellationToken()
1375public BoundExpression MaximumMethodDefIndex()
1386public BoundExpression SourceDocumentIndex(Cci.DebugSourceDocument document)
1395public BoundExpression MethodInfo(MethodSymbol method, TypeSymbol systemReflectionMethodInfo)
1420public BoundExpression FieldInfo(FieldSymbol field)
1462public BoundExpression Convert(TypeSymbol type, BoundExpression arg, bool allowBoxingByRefLikeTypeParametersToObject = false)
1492public BoundExpression Convert(TypeSymbol type, BoundExpression arg, Conversion conversion, bool isChecked = false)
1519public BoundExpression ArrayOrEmpty(TypeSymbol elementType, BoundExpression[] elements)
1531public BoundExpression ArrayOrEmpty(TypeSymbol elementType, ImmutableArray<BoundExpression> elements)
1546public BoundExpression Array(TypeSymbol elementType, ImmutableArray<BoundExpression> elements)
1550ImmutableArray.Create<BoundExpression>(Literal(elements.Length)),
1555public BoundExpression Array(TypeSymbol elementType, BoundExpression length)
1559ImmutableArray.Create<BoundExpression>(length),
1565internal BoundExpression Default(TypeSymbol type)
1570internal static BoundExpression Default(TypeSymbol type, SyntaxNode syntax)
1599BoundExpression source,
1610internal BoundExpression NullOrDefault(TypeSymbol typeSymbol)
1615internal static BoundExpression NullOrDefault(TypeSymbol typeSymbol, SyntaxNode syntax)
1620internal BoundExpression Not(BoundExpression expression)
1631BoundExpression argument,
1726internal ImmutableArray<BoundExpression> MakeTempsForDiscardArguments(ImmutableArray<BoundExpression> arguments, ArrayBuilder<LocalSymbol> builder)
1741internal BoundExpression MakeNullCheck(SyntaxNode syntax, BoundExpression rewrittenExpr, BinaryOperatorKind operatorKind)
1793internal BoundExpression MakeNullableHasValue(SyntaxNode syntax, BoundExpression expression)
1803internal BoundExpression RewriteNullableNullEquality(
1806BoundExpression loweredLeft,
1807BoundExpression loweredRight,
1825BoundExpression nullable = loweredRight.IsLiteralNull() ? loweredLeft : loweredRight;
1834BoundExpression nonNullValue = LocalRewriter.NullableAlwaysHasValue(nullable);
1845sideEffects: ImmutableArray.Create<BoundExpression>(nonNullValue),
1855BoundExpression whenNotNull = RewriteNullableNullEquality(
1867BoundExpression call = MakeNullableHasValue(syntax, nullable);
1868BoundExpression result = kind == BinaryOperatorKind.NullableNullNotEqual ?
Operations\CSharpOperationFactory.cs (41)
307ConstantValue? constantValue = (boundNode as BoundExpression)?.ConstantValueOpt;
322BoundExpression boundExpr => boundExpr.GetPublicTypeSymbol(),
461private static TypeParameterSymbol? GetConstrainedToType(Symbol targetMember, BoundExpression? receiverOpt)
528return CreateFromArray<BoundExpression, IOperation>(declaredTypeOpt.BoundDimensionsOpt);
534ImmutableArray<BoundExpression> dimensions;
543dimensions = ImmutableArray<BoundExpression>.Empty;
545return CreateFromArray<BoundExpression, IOperation>(dimensions);
750ImmutableArray<IOperation> arguments = CreateFromArray<BoundExpression, IOperation>(boundDynamicObjectCreationExpression.Arguments);
779ImmutableArray<IOperation> arguments = CreateFromArray<BoundExpression, IOperation>(boundDynamicInvocation.Arguments);
788internal IOperation CreateBoundDynamicIndexerAccessExpressionReceiver(BoundExpression indexer)
803internal ImmutableArray<IOperation> CreateBoundDynamicIndexerAccessArguments(BoundExpression indexer)
808return CreateFromArray<BoundExpression, IOperation>(boundDynamicAccess.Arguments);
812return CreateFromArray<BoundExpression, IOperation>(boundObjectInitializerMember.Arguments);
833ImmutableArray<IOperation> initializers = CreateFromArray<BoundExpression, IOperation>(BoundObjectCreationExpression.GetChildInitializers(boundObjectInitializerExpression));
842ImmutableArray<IOperation> initializers = CreateFromArray<BoundExpression, IOperation>(BoundObjectCreationExpression.GetChildInitializers(boundCollectionInitializerExpression));
950BoundExpression? receiver,
977ImmutableArray<IOperation> arguments = CreateFromArray<BoundExpression, IOperation>(boundCollectionElementInitializer.Arguments);
1019BoundExpression boundOperand = boundConversion.Operand;
1099BoundExpression nestedOperand = nestedConversion.Operand;
1206ImmutableArray<IOperation> dimensionSizes = CreateFromArray<BoundExpression, IOperation>(boundArrayCreation.Bounds);
1217ImmutableArray<IOperation> elementValues = CreateFromArray<BoundExpression, IOperation>(boundArrayInitialization.Initializers);
1262Create(Binder.GetUnderlyingCollectionExpressionElement(expr, (BoundExpression)element, throwOnErrors: false));
1296ConstantValue? constantValue = ((BoundExpression)boundDefaultExpression).ConstantValueOpt;
1409var children = CreateFromArray<BoundExpression, IOperation>(boundBadExpression.ChildBoundNodes);
1627ImmutableArray<IOperation> indices = CreateFromArray<BoundExpression, IOperation>(boundArrayAccess.Indices);
1978boundForEachStatement.Expression is not BoundConversion { Conversion.IsIdentity: true, ExplicitCastInCode: false, Operand: BoundExpression operand } ?
2250ImmutableArray<IOperation> elements = CreateFromArray<BoundExpression, IOperation>(boundTupleExpression.Arguments);
2271internal ImmutableArray<IInterpolatedStringContentOperation> CreateBoundInterpolatedStringContentOperation(ImmutableArray<BoundExpression> parts, ImmutableArray<(bool IsLiteral, bool HasAlignment, bool HasFormat)>? positionInfo)
2278foreach (var part in parts)
2304var part = parts[i];
2307BoundExpression value;
2308BoundExpression? alignment;
2309BoundExpression? format;
2377static (BoundExpression Value, BoundExpression? Alignment, BoundExpression? Format) getCallInfo(ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, (bool IsLiteral, bool HasAlignment, bool HasFormat) currentPosition)
2379BoundExpression value = arguments[0];
2389BoundExpression? alignment = alignmentIndex == -1 ? null : arguments[alignmentIndex];
2391BoundExpression? format = formatIndex == -1 ? null : arguments[formatIndex];
2435IOperation createContent(BoundExpression current)
Operations\CSharpOperationFactory_Methods.cs (11)
36internal IArgumentOperation CreateArgumentOperation(ArgumentKind kind, IParameterSymbol? parameter, BoundExpression expression)
87ImmutableArray<IOperation> ignoredDimensions = CreateFromArray<BoundExpression, IOperation>(boundLocalDeclaration.ArgumentsOpt);
114private bool IsCallVirtual(MethodSymbol? targetMethod, BoundExpression? receiver)
266ImmutableArray<BoundExpression> boundArguments,
290ImmutableArray<BoundExpression> arguments,
339private static ArgumentKind GetArgumentKind(BoundExpression argument, ref BitVector defaultArguments, int i)
364ImmutableArray<BoundExpression> arguments)
373BoundExpression argument = arguments[a];
387internal static ImmutableArray<BoundNode> CreateInvalidChildrenFromArgumentsExpression(BoundNode? receiverOpt, ImmutableArray<BoundExpression> arguments, BoundExpression? additionalNodeOpt = null)
408ImmutableArray<BoundExpression> arguments,