122 types derived from BoundExpression
Microsoft.CodeAnalysis.CSharp (122)
BoundTree\BoundExpressionWithNullability.cs (1)
9internal sealed partial class BoundExpressionWithNullability : BoundExpression
BoundTree\Expression.cs (1)
42internal sealed partial class BoundDeconstructionAssignmentOperator : BoundExpression
BoundTree\VariablePendingInference.cs (1)
25internal partial class VariablePendingInference : BoundExpression
Generated\BoundNodes.xml.Generated.cs (118)
441internal abstract partial class BoundValuePlaceholderBase : BoundExpression 918internal sealed partial class BoundDup : BoundExpression 949internal sealed partial class BoundPassByCopy : BoundExpression 977internal sealed partial class BoundBadExpression : BoundExpression 1066internal sealed partial class BoundTypeExpression : BoundExpression 1101internal sealed partial class BoundTypeOrValueExpression : BoundExpression 1139internal sealed partial class BoundNamespaceExpression : BoundExpression 1180internal sealed partial class BoundUnaryOperator : BoundExpression 1222internal sealed partial class BoundIncrementOperator : BoundExpression 1270internal sealed partial class BoundAddressOfOperator : BoundExpression 1302internal sealed partial class BoundUnconvertedAddressOfOperator : BoundExpression 1331internal sealed partial class BoundFunctionPointerLoad : BoundExpression 1374internal sealed partial class BoundPointerIndirectionOperator : BoundExpression 1406internal sealed partial class BoundPointerElementAccess : BoundExpression 1443internal sealed partial class BoundFunctionPointerInvocation : BoundExpression 1480internal sealed partial class BoundRefTypeOperator : BoundExpression 1512internal sealed partial class BoundMakeRefOperator : BoundExpression 1542internal sealed partial class BoundRefValueOperator : BoundExpression 1574internal sealed partial class BoundFromEndIndexExpression : BoundExpression 1606internal sealed partial class BoundRangeExpression : BoundExpression 1639internal abstract partial class BoundBinaryOperatorBase : BoundExpression 1692internal sealed partial class BoundTupleBinaryOperator : BoundExpression 1775internal sealed partial class BoundCompoundAssignmentOperator : BoundExpression 1822internal sealed partial class BoundAssignmentOperator : BoundExpression 1856internal sealed partial class BoundDeconstructionAssignmentOperator : BoundExpression 1891internal sealed partial class BoundNullCoalescingOperator : BoundExpression 1932internal sealed partial class BoundNullCoalescingAssignmentOperator : BoundExpression 1963internal sealed partial class BoundUnconvertedConditionalOperator : BoundExpression 2002internal sealed partial class BoundConditionalOperator : BoundExpression 2046internal sealed partial class BoundArrayAccess : BoundExpression 2079internal sealed partial class BoundRefArrayAccess : BoundExpression 2108internal sealed partial class BoundArrayLength : BoundExpression 2171internal sealed partial class BoundAwaitExpression : BoundExpression 2206internal abstract partial class BoundTypeOf : BoundExpression 2291internal sealed partial class BoundMethodDefIndex : BoundExpression 2331internal sealed partial class BoundLocalId : BoundExpression 2374internal sealed partial class BoundParameterId : BoundExpression 2417internal sealed partial class BoundStateMachineInstanceId : BoundExpression 2452internal sealed partial class BoundMaximumMethodDefIndex : BoundExpression 2487internal sealed partial class BoundInstrumentationPayloadRoot : BoundExpression 2525internal sealed partial class BoundThrowIfModuleCancellationRequested : BoundExpression 2560internal sealed partial class ModuleCancellationTokenExpression : BoundExpression 2595internal sealed partial class BoundModuleVersionId : BoundExpression 2630internal sealed partial class BoundModuleVersionIdString : BoundExpression 2665internal sealed partial class BoundSourceDocumentIndex : BoundExpression 2705internal sealed partial class BoundMethodInfo : BoundExpression 2748internal sealed partial class BoundFieldInfo : BoundExpression 2791internal sealed partial class BoundDefaultLiteral : BoundExpression 2814internal sealed partial class BoundDefaultExpression : BoundExpression 2845internal sealed partial class BoundIsOperator : BoundExpression 2880internal sealed partial class BoundAsOperator : BoundExpression 2917internal sealed partial class BoundSizeOfOperator : BoundExpression 2949internal sealed partial class BoundConversion : BoundExpression 2993internal sealed partial class BoundReadOnlySpanFromArray : BoundExpression 3026internal sealed partial class BoundArgList : BoundExpression 3061internal sealed partial class BoundArgListOperator : BoundExpression 3092internal sealed partial class BoundFixedLocalCollectionInitializer : BoundExpression 4298internal sealed partial class BoundLiteral : BoundExpression 4329internal sealed partial class BoundUtf8String : BoundExpression 4369internal sealed partial class BoundThisReference : BoundExpression 4404internal sealed partial class BoundPreviousSubmissionReference : BoundExpression 4439internal sealed partial class BoundHostObjectMemberReference : BoundExpression 4474internal sealed partial class BoundBaseReference : BoundExpression 4503internal sealed partial class BoundLocal : BoundExpression 4552internal sealed partial class BoundPseudoVariable : BoundExpression 4597internal sealed partial class BoundRangeVariable : BoundExpression 4630internal sealed partial class BoundParameter : BoundExpression 4770internal sealed partial class BoundLabel : BoundExpression 4877internal abstract partial class BoundSwitchExpression : BoundExpression 5721internal abstract partial class BoundMethodOrPropertyGroup : BoundExpression 5735internal sealed partial class BoundSequencePointExpression : BoundExpression 5763internal sealed partial class BoundSequence : BoundExpression 5799internal sealed partial class BoundSpillSequence : BoundExpression 5835internal sealed partial class BoundDynamicMemberAccess : BoundExpression 5874internal abstract partial class BoundDynamicInvocableBase : BoundExpression 5927internal sealed partial class BoundConditionalAccess : BoundExpression 5960internal sealed partial class BoundLoweredConditionalAccess : BoundExpression 6001internal sealed partial class BoundConditionalReceiver : BoundExpression 6039internal sealed partial class BoundComplexConditionalReceiver : BoundExpression 6141internal sealed partial class BoundCall : BoundExpression 6196internal sealed partial class BoundEventAssignmentOperator : BoundExpression 6235internal sealed partial class BoundAttribute : BoundExpression 6280internal sealed partial class BoundUnconvertedObjectCreationExpression : BoundExpression 6318internal abstract partial class BoundObjectCreationExpressionBase : BoundExpression 6390internal abstract partial class BoundCollectionExpressionBase : BoundExpression 6544internal abstract partial class BoundTupleExpression : BoundExpression 6694internal abstract partial class BoundObjectInitializerExpressionBase : BoundExpression 6741internal sealed partial class BoundObjectInitializerMember : BoundExpression 6790internal sealed partial class BoundDynamicObjectInitializerMember : BoundExpression 6863internal sealed partial class BoundCollectionElementInitializer : BoundExpression 6940internal sealed partial class BoundImplicitReceiver : BoundExpression 6975internal sealed partial class BoundAnonymousObjectCreationExpression : BoundExpression 7011internal sealed partial class BoundAnonymousPropertyDeclaration : BoundExpression 7081internal sealed partial class BoundDelegateCreationExpression : BoundExpression 7117internal sealed partial class BoundArrayCreation : BoundExpression 7149internal sealed partial class BoundArrayInitialization : BoundExpression 7180internal abstract partial class BoundStackAllocArrayCreationBase : BoundExpression 7255internal sealed partial class BoundFieldAccess : BoundExpression 7295internal sealed partial class BoundHoistedFieldAccess : BoundExpression 7335internal sealed partial class BoundPropertyAccess : BoundExpression 7373internal sealed partial class BoundEventAccess : BoundExpression 7409internal sealed partial class BoundIndexerAccess : BoundExpression 7460internal sealed partial class BoundImplicitIndexerAccess : BoundExpression 7509internal sealed partial class BoundInlineArrayAccess : BoundExpression 7550internal sealed partial class BoundDynamicIndexerAccess : BoundExpression 7590internal sealed partial class BoundLambda : BoundExpression 7630internal sealed partial class UnboundLambda : BoundExpression 7674internal sealed partial class BoundQueryClause : BoundExpression 7741internal sealed partial class BoundNameOfOperator : BoundExpression 7774internal abstract partial class BoundInterpolatedStringBase : BoundExpression 7910internal sealed partial class BoundStringInsert : BoundExpression 7945internal sealed partial class BoundIsPatternExpression : BoundExpression 8525internal sealed partial class BoundDiscardExpression : BoundExpression 8560internal sealed partial class BoundThrowExpression : BoundExpression 8588internal abstract partial class VariablePendingInference : BoundExpression 8657internal sealed partial class OutDeconstructVarPendingInference : BoundExpression 8758internal sealed partial class BoundExpressionWithNullability : BoundExpression 8789internal sealed partial class BoundWithExpression : BoundExpression
Lowering\SpillSequenceSpiller.cs (1)
37private sealed class BoundSpillSequenceBuilder : BoundExpression
5663 references to BoundExpression
Microsoft.CodeAnalysis.CSharp (5663)
Binder\Binder.cs (4)
492internal virtual BoundExpression? ConditionalReceiverExpression 857internal BoundExpression WrapWithVariablesIfAny(CSharpSyntaxNode scopeDesignator, BoundExpression expression) 862: new BoundSequence(scopeDesignator, locals, ImmutableArray<BoundExpression>.Empty, expression, getType()) { WasCompilerGenerated = true };
Binder\Binder.QueryTranslationState.cs (1)
31public BoundExpression fromExpression;
Binder\Binder.QueryUnboundLambdaState.cs (2)
73protected override BoundExpression GetLambdaExpressionBody(BoundBlock body) 78protected override BoundBlock CreateBlockFromLambdaExpressionBody(Binder lambdaBodyBinder, BoundExpression expression, BindingDiagnosticBag diagnostics)
Binder\Binder.ValueChecks.cs (101)
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) 415var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(accessorForDefaultArguments.ParameterCount); 504private BoundExpression CheckValue(BoundExpression expr, BindValueKind valueKind, BindingDiagnosticBag diagnostics) 636var receiver = methodGroup.ReceiverOpt; 654receiver == null ? ImmutableArray<BoundExpression>.Empty : ImmutableArray.Create(receiver), 672internal static bool IsTypeOrValueExpression(BoundExpression expression) 697internal bool CheckValueKind(SyntaxNode node, BoundExpression expr, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 823var receiver = ((BoundPointerElementAccess)expr).Expression; 977bool checkArrayAccessValueKind(SyntaxNode node, BindValueKind valueKind, ImmutableArray<BoundExpression> indices, BindingDiagnosticBag diagnostics) 1012private static bool CheckNotNamespaceOrType(BoundExpression expr, BindingDiagnosticBag diagnostics) 1297private bool CheckParameterRefEscape(SyntaxNode node, BoundExpression parameter, ParameterSymbol parameterSymbol, uint escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1566BoundExpression receiver = boundEvent.ReceiverOpt; 1628private bool CheckIsValidReceiverForVariable(SyntaxNode node, BoundExpression receiver, BindValueKind kind, BindingDiagnosticBag diagnostics) 1647private static bool RequiresVariableReceiver(BoundExpression receiver, Symbol symbol) 1699private bool CheckPropertyValueKind(SyntaxNode node, BoundExpression expr, BindValueKind valueKind, bool checkingReceiver, BindingDiagnosticBag diagnostics) 1706BoundExpression receiver; 1880static bool isAllowedDespiteReadonly(BoundExpression receiver) 1891bool isAllowedInitOnlySet(BoundExpression receiver) 1922private bool IsBadBaseAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol member, BindingDiagnosticBag diagnostics, 1941BoundExpression expression, 1957var arguments = ArrayBuilder<BoundExpression>.GetInstance(); 1982BoundExpression? receiver, 1985ImmutableArray<BoundExpression> argsOpt, 2071BoundExpression? receiver, 2074ImmutableArray<BoundExpression> argsOpt, 2136BoundExpression? receiver, 2139ImmutableArray<BoundExpression> argsOpt, 2229BoundExpression? receiver, 2232ImmutableArray<BoundExpression> argsOpt, 2302BoundExpression? receiver, 2305ImmutableArray<BoundExpression> argsOpt, 2340var argument = argsOpt[argIndex]; 2387static bool isMixableArgument(BoundExpression argument) 2400static EscapeArgument getReceiver(in MethodInfo methodInfo, BoundExpression receiver) 2426static EscapeArgument getReceiverCore(MethodSymbol? method, BoundExpression receiver) 2452ImmutableArray<BoundExpression> argsOpt, 2459var argument = argsOpt[argIndex]; 2479BoundExpression? receiver, 2482ImmutableArray<BoundExpression> argsOpt, 2549BoundExpression? receiver, 2552ImmutableArray<BoundExpression> argsOpt, 2604BoundExpression? receiver, 2607ImmutableArray<BoundExpression> argsOpt, 2680BoundExpression? receiver, 2683ImmutableArray<BoundExpression> argsOpt, 2762private bool ShouldInferDeclarationExpressionValEscape(BoundExpression argument, [NotNullWhen(true)] out SourceLocalSymbol? localSymbol) 2794BoundExpression? receiverOpt, 2797ImmutableArray<BoundExpression> argsOpt, 2894BoundExpression? receiverOpt, 2897ImmutableArray<BoundExpression> argsOpt, 2967foreach (var argument in argsOpt) 2979ImmutableArray<BoundExpression> argsOpt, 3317internal void ValidateEscape(BoundExpression expr, uint escapeTo, bool isByRef, BindingDiagnosticBag diagnostics) 3340internal uint GetRefEscape(BoundExpression expr, uint scopeOfTheContainingExpression) 3560ImmutableArray<BoundExpression> arguments; 3648internal bool CheckRefEscape(SyntaxNode node, BoundExpression expr, uint escapeFrom, uint escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics) 3881ImmutableArray<BoundExpression> arguments; 4020foreach (var element in expr.Arguments) 4043internal uint GetValEscape(BoundExpression expr, uint scopeOfTheContainingExpression) 4249ImmutableArray<BoundExpression> arguments; 4362ImmutableArray<BoundExpression> arguments; 4587private uint GetTupleValEscape(ImmutableArray<BoundExpression> elements, uint scopeOfTheContainingExpression) 4590foreach (var element in elements) 4607foreach (var expr in initExpr.Initializers) 4616private uint GetValEscapeOfObjectMemberInitializer(BoundExpression expr, uint scopeOfTheContainingExpression) 4711private uint GetValEscape(ImmutableArray<BoundExpression> expressions, uint scopeOfTheContainingExpression) 4714foreach (var expression in expressions) 4727internal bool CheckValEscape(SyntaxNode node, BoundExpression expr, uint escapeFrom, uint escapeTo, bool checkingReceiver, BindingDiagnosticBag diagnostics) 4812BoundExpression underlyingReceiver = ((BoundCapturedReceiverPlaceholder)expr).Receiver; 4982ImmutableArray<BoundExpression> arguments; 5136ImmutableArray<BoundExpression> arguments; 5273var clauseValue = ((BoundQueryClause)expr).Value; 5277var variableValue = ((BoundRangeVariable)expr).Value; 5297var accessedExpression = ((BoundPointerElementAccess)expr).Expression; 5301var operandExpression = ((BoundPointerIndirectionOperator)expr).Operand; 5316var result = arm.Value; 5457private SignatureOnlyMethodSymbol GetInlineArrayAccessEquivalentSignatureMethod(BoundInlineArrayAccess elementAccess, out ImmutableArray<BoundExpression> arguments, out ImmutableArray<RefKind> refKinds) 5519private SignatureOnlyMethodSymbol GetInlineArrayConversionEquivalentSignatureMethod(BoundConversion conversion, out ImmutableArray<BoundExpression> arguments, out ImmutableArray<RefKind> refKinds) 5525private SignatureOnlyMethodSymbol GetInlineArrayConversionEquivalentSignatureMethod(BoundExpression inlineArray, TypeSymbol resultType, out ImmutableArray<BoundExpression> arguments, out ImmutableArray<RefKind> refKinds) 5559private bool CheckTupleValEscape(ImmutableArray<BoundExpression> elements, uint escapeFrom, uint escapeTo, BindingDiagnosticBag diagnostics) 5561foreach (var element in elements) 5576foreach (var expr in initExpr.Initializers) 5590private bool CheckValEscape(ImmutableArray<BoundExpression> expressions, uint escapeFrom, uint escapeTo, BindingDiagnosticBag diagnostics) 5592foreach (var expression in expressions) 5603private bool CheckInterpolatedStringHandlerConversionEscape(BoundExpression expression, uint escapeFrom, uint escapeTo, BindingDiagnosticBag diagnostics) 5624var arguments = ArrayBuilder<BoundExpression>.GetInstance(); 5641private void GetInterpolatedStringHandlerArgumentsForEscape(BoundExpression expression, ArrayBuilder<BoundExpression> arguments) 5663foreach (var part in interpolatedString.Parts) 5717BoundExpression expression, 5902var receiver = fieldAccess.ReceiverOpt;
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_AnonymousTypes.cs (4)
21private BoundExpression BindAnonymousObjectCreation(AnonymousObjectCreationExpressionSyntax node, BindingDiagnosticBag diagnostics) 31BoundExpression[] boundExpressions = new BoundExpression[fieldCount]; 211private TypeSymbol GetAnonymousTypeFieldType(BoundExpression expression, CSharpSyntaxNode errorSyntax, BindingDiagnosticBag diagnostics, ref bool hasError)
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) 1528private BoundExpression BindDefaultExpression(DefaultExpressionSyntax node, BindingDiagnosticBag diagnostics) 1541private BoundExpression BindIdentifier( 1574BoundExpression expression; 1608var receiver = SynthesizeMethodGroupReceiver(node, members); 1837private BoundExpression SynthesizeMethodGroupReceiver(CSharpSyntaxNode syntax, ArrayBuilder<Symbol> members) 1947private BoundExpression BindNonMethod(SimpleNameSyntax node, Symbol symbol, BindingDiagnosticBag diagnostics, LookupResultKind resultKind, bool indexed, bool isError) 2164BoundExpression receiver = SynthesizeReceiver(node, symbol, diagnostics); 2170BoundExpression receiver = SynthesizeReceiver(node, symbol, diagnostics); 2176BoundExpression receiver = SynthesizeReceiver(node, symbol, diagnostics); 2237protected virtual BoundExpression BindRangeVariable(SimpleNameSyntax node, RangeVariableSymbol qv, BindingDiagnosticBag diagnostics) 2242private BoundExpression SynthesizeReceiver(SyntaxNode node, Symbol member, BindingDiagnosticBag diagnostics) 2318private BoundExpression TryBindInteractiveReceiver(SyntaxNode syntax, NamedTypeSymbol memberDeclaringType) 2360public BoundExpression BindNamespaceOrTypeOrExpression(ExpressionSyntax node, BindingDiagnosticBag diagnostics) 2386public BoundExpression BindLabel(ExpressionSyntax node, BindingDiagnosticBag diagnostics) 2414public BoundExpression BindNamespaceOrType(ExpressionSyntax node, BindingDiagnosticBag diagnostics) 2420public BoundExpression BindNamespaceAlias(IdentifierNameSyntax node, BindingDiagnosticBag diagnostics) 2426private static BoundExpression CreateBoundNamespaceOrTypeExpression(ExpressionSyntax node, Symbol symbol) 2534private BoundExpression BindCast(CastExpressionSyntax node, BindingDiagnosticBag diagnostics) 2536BoundExpression operand = this.BindValue(node.Expression, diagnostics, BindValueKind.RValue); 2552private BoundExpression BindFromEndIndexExpression(PrefixUnaryExpressionSyntax node, BindingDiagnosticBag diagnostics) 2561BoundExpression boundOperand = BindValue(node.Operand, diagnostics, BindValueKind.RValue); 2589BoundExpression boundConversion = CreateConversion(boundOperand, conversion, intType, diagnostics); 2595private BoundExpression BindRangeExpression(RangeExpressionSyntax node, BindingDiagnosticBag diagnostics) 2641BoundExpression left = BindRangeExpressionOperand(node.LeftOperand, diagnostics); 2642BoundExpression right = BindRangeExpressionOperand(node.RightOperand, diagnostics); 2662private BoundExpression BindRangeExpressionOperand(ExpressionSyntax operand, BindingDiagnosticBag diagnostics) 2669BoundExpression boundOperand = BindValue(operand, diagnostics, BindValueKind.RValue); 2698private BoundExpression BindCastCore(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, bool wasCompilerGenerated, BindingDiagnosticBag diagnostics) 2720BoundExpression operand, 2845ImmutableArray<BoundExpression> tupleArguments, 2857var argument = tupleArguments[i]; 2877private BoundExpression BindExplicitNullableCastFromNonNullable(ExpressionSyntax node, BoundExpression operand, TypeWithAnnotations targetTypeWithAnnotations, BindingDiagnosticBag diagnostics) 2895var underlyingExpr = BindCastCore(node, operand, underlyingTargetTypeWithAnnotations, wasCompilerGenerated: false, diagnostics: bag); 2911var result = BindCastCore(node, operand, targetTypeWithAnnotations, wasCompilerGenerated: operand.WasCompilerGenerated, diagnostics: bag2); 3053BoundExpression boundArgument = BindArgumentValue(diagnostics, argumentSyntax, allowArglist, refKind); 3067var arg = result.Argument(0); 3084private BoundExpression BindArgumentValue(BindingDiagnosticBag diagnostics, ArgumentSyntax argumentSyntax, bool allowArglist, RefKind refKind) 3104private BoundExpression BindOutDeclarationArgument(DeclarationExpressionSyntax declarationExpression, BindingDiagnosticBag diagnostics) 3141private BoundExpression BindOutVariableDeclarationArgument( 3204BoundExpression receiver = SynthesizeReceiver(designation, expressionVariableField, diagnostics); 3281BoundExpression boundArgumentExpression, 3349private BoundExpression BindArgumentExpression(BindingDiagnosticBag diagnostics, ExpressionSyntax argumentExpression, RefKind refKind, bool allowArglist) 3358BoundExpression argument; 3377BoundExpression? receiver, 3385ArrayBuilder<BoundExpression>? paramsArgsBuilder = null; 3393BoundExpression argument = arguments[arg]; 3499BoundExpression coerceArgument( 3501BoundExpression? receiver, 3503ArrayBuilder<BoundExpression>? argumentsForInterpolationConversion, 3504BoundExpression argument, 3511BoundExpression coercedArgument = argument; 3556static ArrayBuilder<BoundExpression> collectParamsArgs( 3559ArrayBuilder<BoundExpression> arguments, 3564var paramsArgsBuilder = ArrayBuilder<BoundExpression>.GetInstance(); 3590BoundExpression? receiver, 3594ArrayBuilder<BoundExpression> paramsArgsBuilder, 3620ImmutableArray<BoundExpression> collectionArgs = paramsArgsBuilder.ToImmutableAndFree(); 3623BoundExpression collection = CreateParamsCollection(node, parameters[paramsIndex], collectionArgs, diagnostics); 3663void reportUnsafeIfNeeded(MemberResolutionResult<TMember> methodResult, BindingDiagnosticBag diagnostics, BoundExpression argument, TypeWithAnnotations parameterTypeWithAnnotations) 3680BoundExpression bindInterpolatedStringHandlerInMemberCall( 3681BoundExpression unconvertedString, 3683ArrayBuilder<BoundExpression>? arguments, 3687BoundExpression? receiver, 3885var interpolatedString = BindUnconvertedInterpolatedExpressionToHandlerType( 3906private BoundExpression BindArrayCreationExpression(ArrayCreationExpressionSyntax node, BindingDiagnosticBag diagnostics) 3990ArrayBuilder<BoundExpression> sizes = ArrayBuilder<BoundExpression>.GetInstance(); 3995var size = BindArrayDimension(arg, diagnostics, ref hasErrors); 4016var size = BindRValueWithoutTargetType(arg, diagnostics); 4025ImmutableArray<BoundExpression> arraySizes = sizes.ToImmutableAndFree(); 4032private BoundExpression BindArrayDimension(ExpressionSyntax dimension, BindingDiagnosticBag diagnostics, ref bool hasErrors) 4037var size = BindValue(dimension, diagnostics, BindValueKind.RValue); 4057private BoundExpression BindImplicitArrayCreationExpression(ImplicitArrayCreationExpressionSyntax node, BindingDiagnosticBag diagnostics) 4065ImmutableArray<BoundExpression> boundInitializerExpressions = BindArrayInitializerExpressions(initializer, diagnostics, dimension: 1, rank: rank); 4086sizes: ImmutableArray<BoundExpression>.Empty, boundInitExprOpt: boundInitializerExpressions); 4089private BoundExpression BindImplicitStackAllocArrayCreationExpression(ImplicitStackAllocArrayCreationExpressionSyntax node, BindingDiagnosticBag diagnostics) 4092ImmutableArray<BoundExpression> boundInitializerExpressions = BindArrayInitializerExpressions(initializer, diagnostics, dimension: 1, rank: 1); 4124private ImmutableArray<BoundExpression> BindArrayInitializerExpressions(InitializerExpressionSyntax initializer, BindingDiagnosticBag diagnostics, int dimension, int rank) 4126var exprBuilder = ArrayBuilder<BoundExpression>.GetInstance(); 4141private void BindArrayInitializerExpressions(InitializerExpressionSyntax initializer, ArrayBuilder<BoundExpression> exprBuilder, BindingDiagnosticBag diagnostics, int dimension, int rank) 4153var boundExpression = BindValue(expression, diagnostics, BindValueKind.RValue); 4170var boundExpression = BindValue(expression, diagnostics, BindValueKind.RValue); 4212ImmutableArray<BoundExpression> boundInitExpr, 4218ArrayBuilder<BoundExpression> initializers = ArrayBuilder<BoundExpression>.GetInstance(); 4228BoundExpression boundExpression = boundInitExpr[boundInitExprIndex]; 4231BoundExpression convertedExpression = GenerateConversionForAssignment(elemType, boundExpression, diagnostics); 4240BoundExpression init = null; 4293ImmutableArray<BoundExpression> boundInitExprOpt = default(ImmutableArray<BoundExpression>)) 4360ImmutableArray<BoundExpression> sizes, 4361ImmutableArray<BoundExpression> boundInitExprOpt = default(ImmutableArray<BoundExpression>), 4388var size = sizes[i]; 4413BoundExpression[] sizeArray = new BoundExpression[rank]; 4439private BoundExpression BindStackAllocArrayCreationExpression( 4452ImmutableArray<BoundExpression>.Empty, 4475var builder = ArrayBuilder<BoundExpression>.GetInstance(); 4496BoundExpression count = null; 4600private BoundExpression BindStackAllocWithInitializer( 4606BoundExpression sizeOpt, 4609ImmutableArray<BoundExpression> boundInitExprOpt = default) 4652private static int? GetIntegerConstantForArraySize(BoundExpression expression) 4673private static bool IsNegativeConstantForArraySize(BoundExpression expression) 4719internal BoundExpression BindConstructorInitializer( 4731var result = (argumentListBinder ?? this).BindConstructorInitializerCore(initializerArgumentListOpt, constructor, diagnostics); 4743private BoundExpression BindConstructorInitializerCore( 4904private BoundExpression BindConstructorInitializerCoreContinued( 4937BoundExpression receiver = ThisReference(nonNullSyntax, initializerType, wasCompilerGenerated: true); 5076private static (ParameterSymbol, SyntaxNode) TryGetPrimaryConstructorParameterUsedAsValue(SynthesizedPrimaryConstructor primaryConstructor, BoundExpression boundExpression) 5111private BoundExpression BindImplicitObjectCreationExpression(ImplicitObjectCreationExpressionSyntax node, BindingDiagnosticBag diagnostics) 5128protected BoundExpression BindObjectCreationExpression(ObjectCreationExpressionSyntax node, BindingDiagnosticBag diagnostics) 5130BoundExpression result = bindObjectCreationExpression(node, diagnostics); 5137BoundExpression bindObjectCreationExpression(ObjectCreationExpressionSyntax node, BindingDiagnosticBag diagnostics) 5190private BoundExpression BindCollectionExpression(CollectionExpressionSyntax syntax, BindingDiagnosticBag diagnostics, int nestingLevel = 0) 5197return new BoundBadExpression(syntax, LookupResultKind.Empty, ImmutableArray<Symbol?>.Empty, ImmutableArray<BoundExpression>.Empty, CreateErrorType()); 5222var expression = @this.BindRValueWithoutTargetType(syntax.Expression, diagnostics); 5249var convertedExpression = @this.ConvertForEachCollection(expressionPlaceholder, conversion, collectionType, diagnostics); 5251BoundExpression? lengthOrCount; 5278private BoundExpression BindDelegateCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics) 5282var result = BindDelegateCreationExpression(node, type, analyzedArguments, node.Initializer, wasTargetTyped: false, diagnostics); 5287private BoundExpression BindDelegateCreationExpression(SyntaxNode node, NamedTypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped, BindingDiagnosticBag diagnostics) 5321BoundExpression argument = analyzedArguments.Arguments.Count >= 1 ? BindToNaturalType(analyzedArguments.Arguments[0], diagnostics) : null; 5456private BoundExpression BindClassCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, string typeName, BindingDiagnosticBag diagnostics, TypeSymbol initializerType = null) 5490private BoundExpression MakeConstructorInvocation( 5492ArrayBuilder<BoundExpression> arguments, 5511var creation = BindClassCreationExpression(node, type.Name, node, type, analyzedArguments, diagnostics); 5521internal BoundExpression BindObjectCreationForErrorRecovery(BoundUnconvertedObjectCreationExpression node, BindingDiagnosticBag diagnostics) 5524var result = MakeBadExpressionForObjectCreation(node.Syntax, CreateErrorType(), arguments, node.InitializerOpt, typeSyntax: node.Syntax, diagnostics); 5529private BoundExpression MakeBadExpressionForObjectCreation(ObjectCreationExpressionSyntax node, TypeSymbol type, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false) 5535private BoundExpression MakeBadExpressionForObjectCreation(SyntaxNode node, TypeSymbol type, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax? initializerOpt, SyntaxNode? typeSyntax, BindingDiagnosticBag diagnostics, bool wasCompilerGenerated = false) 5537var children = ArrayBuilder<BoundExpression>.GetInstance(); 5585private BoundExpression BindInitializerExpressionOrValue( 5637var initializers = ArrayBuilder<BoundExpression>.GetInstance(initializerSyntax.Expressions.Count); 5643BoundExpression boundMemberInitializer = BindInitializerMemberAssignment( 5658private BoundExpression BindInitializerMemberAssignment( 5680BoundExpression boundLeft = objectInitializerMemberBinder.BindObjectInitializerMember(initializer, implicitReceiver, diagnostics); 5691BoundExpression boundRight = BindInitializerExpressionOrValue( 5714var boundNode = objectInitializerMemberBinder.BindObjectInitializerMemberMissingAssignment(identifierName, implicitReceiver, diagnostics); 5736var boundExpression = BindValue(memberInitializer, diagnostics, BindValueKind.RValue); 5742private BoundExpression BindObjectInitializerMember( 5758private BoundExpression BindObjectInitializerMemberMissingAssignment( 5768private BoundExpression BindObjectInitializerMemberCommon( 5775BoundExpression boundMember; 5857ImmutableArray<BoundExpression> arguments = ImmutableArray<BoundExpression>.Empty; 5909foreach (var argument in arguments) 6008private BoundExpression BadObjectInitializerMemberAccess( 6009BoundExpression boundMember, 6050private static void ReportDuplicateObjectMemberInitializers(BoundExpression boundMemberInitializer, HashSet<string> memberNameMap, BindingDiagnosticBag diagnostics) 6092ImmutableArray<BoundExpression> initializers, 6111foreach (var initializer in initializers) 6202var initializerBuilder = ArrayBuilder<BoundExpression>.GetInstance(); 6227BoundExpression boundElementInitializer = BindCollectionInitializerElement(elementInitializer, initializerType, 6272private BoundExpression BindCollectionInitializerElement( 6302var boundElementInitializer = BindInitializerExpressionOrValue(elementInitializer, initializerType, BindValueKind.RValue, implicitReceiver.Syntax, diagnostics); 6304BoundExpression result = BindCollectionInitializerElementAddMethod( 6317private BoundExpression BindComplexElementInitializerExpression( 6328var exprBuilder = ArrayBuilder<BoundExpression>.GetInstance(); 6349private BoundExpression BindUnexpectedComplexElementInitializer(InitializerExpressionSyntax node, BindingDiagnosticBag diagnostics) 6356private BoundExpression BindCollectionInitializerElementAddMethod( 6358ImmutableArray<BoundExpression> boundElementInitializerExpressions, 6389var result = bindCollectionInitializerElementAddMethod(elementInitializer, boundElementInitializerExpressions, collectionInitializerAddMethodBinder, diagnostics, implicitReceiver); 6408BoundExpression bindCollectionInitializerElementAddMethod( 6410ImmutableArray<BoundExpression> boundElementInitializerExpressions, 6436var addMethodInvocation = collectionInitializerAddMethodBinder.MakeInvocationExpression( 6532var addMethodInvocation = BindCollectionInitializerElementAddMethod( 6534ImmutableArray.Create((BoundExpression)addElementPlaceholder), 6610protected BoundExpression BindClassCreationExpression( 6628BoundExpression result = null; 6792private BoundExpression CreateBadClassCreationExpression( 6842var childNodes = ArrayBuilder<BoundExpression>.GetInstance(); 6865private BoundExpression BindInterfaceCreationExpression(ObjectCreationExpressionSyntax node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics) 6869var result = BindInterfaceCreationExpression(node, type, diagnostics, node.Type, analyzedArguments, node.Initializer, wasTargetTyped: false); 6874private BoundExpression BindInterfaceCreationExpression(SyntaxNode node, NamedTypeSymbol type, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped) 6900private BoundExpression BindComImportCoClassCreationExpression(SyntaxNode node, NamedTypeSymbol interfaceType, NamedTypeSymbol coClassType, BindingDiagnosticBag diagnostics, SyntaxNode typeNode, AnalyzedArguments analyzedArguments, InitializerExpressionSyntax initializerOpt, bool wasTargetTyped) 6938var classCreation = BindClassCreationExpression( 6981private BoundExpression BindNoPiaObjectCreationExpression( 7023private BoundExpression BindTypeParameterCreationExpression(ObjectCreationExpressionSyntax node, TypeParameterSymbol typeParameter, BindingDiagnosticBag diagnostics) 7027var result = BindTypeParameterCreationExpression(node, typeParameter, analyzedArguments, node.Initializer, node.Type, wasTargetTyped: false, diagnostics); 7044private BoundExpression BindTypeParameterCreationExpression( 7355private BoundExpression BindCheckedExpression(CheckedExpressionSyntax node, BindingDiagnosticBag diagnostics) 7364private BoundExpression BindMemberAccess( 7373BoundExpression boundLeft; 7417private BoundExpression BindLeftOfPotentialColorColorMemberAccess(ExpressionSyntax left, BindingDiagnosticBag diagnostics) 7430private BoundExpression BindLeftIdentifierOfPotentialColorColorMemberAccess(IdentifierNameSyntax left, BindingDiagnosticBag diagnostics) 7445var boundValue = BindIdentifier(left, invoked: false, indexed: false, diagnostics: valueDiagnostics); 7475var boundType = BindNamespaceOrType(left, typeDiagnostics); 7527private BoundExpression BindDynamicMemberAccess( 7529BoundExpression boundLeft, 7586/// <see cref="MakeQueryInvocation(CSharpSyntaxNode, BoundExpression, string, TypeSyntax, TypeWithAnnotations, BindingDiagnosticBag, string)"/>. 7598private BoundExpression BindMemberAccessWithBoundLeft( 7600BoundExpression boundLeft, 7683BoundExpression result; 7748BoundExpression tryBindMemberAccessWithBoundNamespaceLeft( 7751BoundExpression boundLeft, 7820BoundExpression tryBindMemberAccessWithBoundTypeLeft( 7822BoundExpression boundLeft, 7872private void WarnOnAccessOfOffDefault(SyntaxNode node, BoundExpression boundLeft, BindingDiagnosticBag diagnostics) 7886private BoundExpression MakeMemberAccessValue(BoundExpression expr, BindingDiagnosticBag diagnostics) 7920private BoundExpression BindInstanceMemberAccess( 7923BoundExpression boundLeft, 7967BoundExpression colorColorValueReceiver = GetValueExpressionIfTypeOrValueReceiver(boundLeft); 8032BoundExpression boundLeft, 8108private BoundExpression BindMemberAccessBadResult(BoundMethodGroup node) 8118private BoundExpression BindMemberAccessBadResult( 8121BoundExpression boundLeft, 8160boundLeft == null ? ImmutableArray<BoundExpression>.Empty : ImmutableArray.Create(BindToTypeForErrorRecovery(boundLeft)), 8190private static void CombineExtensionMethodArguments(BoundExpression receiver, AnalyzedArguments originalArguments, AnalyzedArguments extensionMethodArguments) 8217private BoundExpression BindMemberOfType( 8223BoundExpression left, 8236BoundExpression result; 8301boundDimensionsOpt: ImmutableArray<BoundExpression>.Empty, 8340BoundExpression left, 8460BoundExpression left, 8510protected BoundExpression BindFieldAccess( 8512BoundExpression receiver, 8615BoundExpression expr = new BoundFieldAccess(node, receiver, fieldSymbol, constantValueOpt, resultKind, fieldType, hasErrors: (hasErrors || hasError)); 8670private BoundExpression BindPropertyAccess( 8672BoundExpression? receiver, 8691private void CheckReceiverAndRuntimeSupportForSymbolAccess(SyntaxNode node, BoundExpression receiverOpt, Symbol symbol, BindingDiagnosticBag diagnostics) 8750private BoundExpression BindEventAccess( 8752BoundExpression receiver, 8773private static bool? IsInstanceReceiver(BoundExpression receiver) 8798BoundExpression receiver, 8966private BoundExpression BindElementAccess(ElementAccessExpressionSyntax node, BindingDiagnosticBag diagnostics) 8968BoundExpression receiver = BindExpression(node.Expression, diagnostics: diagnostics, invoked: false, indexed: true); 8972private BoundExpression BindElementAccess(ExpressionSyntax node, BoundExpression receiver, BracketedArgumentListSyntax argumentList, bool allowInlineArrayElementAccess, BindingDiagnosticBag diagnostics) 8997private BoundExpression BindElementOrIndexerAccess(ExpressionSyntax node, BoundExpression expr, AnalyzedArguments analyzedArguments, bool allowInlineArrayElementAccess, BindingDiagnosticBag diagnostics) 9044BoundExpression result = BindElementAccessCore(node, expr, analyzedArguments, diagnosticsForBindElementAccessCore); 9063BoundExpression tryImplicitConversionToInlineArrayIndex(ExpressionSyntax node, BoundExpression index, BindingDiagnosticBag diagnostics, out WellKnownType indexOrRangeWellknownType) 9066BoundExpression convertedIndex = TryImplicitConversionToArrayIndex(index, SpecialType.System_Int32, node, diagnostics); 9089BoundExpression bindInlineArrayElementAccess(ExpressionSyntax node, BoundExpression expr, int length, AnalyzedArguments analyzedArguments, BoundExpression convertedIndex, WellKnownType indexOrRangeWellknownType, FieldSymbol elementField, BindingDiagnosticBag diagnostics) 9164if (rangeExpr.LeftOperandOpt is BoundExpression left) 9169if (rangeExpr.RightOperandOpt is BoundExpression right) 9214void checkInlineArrayBoundsForSystemIndex(BoundExpression convertedIndex, int length, bool excludeEnd, BindingDiagnosticBag diagnostics) 9226internal static int? InferConstantIndexFromSystemIndex(CSharpCompilation compilation, BoundExpression convertedIndex, int length, out SyntaxNode location) 9259private BoundExpression BadIndexerExpression(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, DiagnosticInfo errorOpt, BindingDiagnosticBag diagnostics) 9270private BoundExpression BindElementAccessCore( 9272BoundExpression expr, 9305private BoundExpression BindArrayAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics) 9340BoundExpression[] convertedArguments = new BoundExpression[arguments.Arguments.Count]; 9344BoundExpression argument = arguments.Arguments[i]; 9346BoundExpression index = ConvertToArrayIndex(argument, diagnostics, allowIndexAndRange: rank == 1, out indexOrRangeWellknownType); 9380indexerOrSliceAccess: new BoundArrayAccess(node, receiverPlaceholder, ImmutableArray<BoundExpression>.CastUp(argumentPlaceholders), resultType) { WasCompilerGenerated = true }, 9388private BoundExpression ConvertToArrayIndex(BoundExpression index, BindingDiagnosticBag diagnostics, bool allowIndexAndRange, out WellKnownType indexOrRangeWellknownType) 9404var result = 9455private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, WellKnownType wellKnownType, SyntaxNode node, BindingDiagnosticBag diagnostics) 9466var result = TryImplicitConversionToArrayIndex(expr, type, node, attemptDiagnostics); 9476private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, SpecialType specialType, SyntaxNode node, BindingDiagnosticBag diagnostics) 9482var result = TryImplicitConversionToArrayIndex(expr, type, node, attemptDiagnostics); 9493private BoundExpression TryImplicitConversionToArrayIndex(BoundExpression expr, TypeSymbol targetType, SyntaxNode node, BindingDiagnosticBag diagnostics) 9511BoundExpression result = CreateConversion(expr.Syntax, expr, conversion, isCast: false, conversionGroupOpt: null, destination: targetType, diagnostics); // UNDONE: was cast? 9517private BoundExpression BindPointerElementAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics) 9539ArrayBuilder<BoundExpression> arguments = analyzedArguments.Arguments; 9556BoundExpression index = arguments[0]; 9578private BoundExpression BindIndexerAccess(SyntaxNode node, BoundExpression expr, AnalyzedArguments analyzedArguments, BindingDiagnosticBag diagnostics) 9592BoundExpression indexerAccessExpression; 9648private BoundExpression BindIndexedPropertyAccess(BoundPropertyGroup propertyGroup, bool mustHaveAllOptionalParameters, BindingDiagnosticBag diagnostics) 9651var receiver = propertyGroup.ReceiverOpt; 9665ImmutableArray<BoundExpression>.Empty, 9672var result = BindIndexedPropertyAccess(syntax, receiver, properties, arguments, diagnostics); 9678private BoundExpression BindIndexedPropertyAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<PropertySymbol> propertyGroup, AnalyzedArguments arguments, BindingDiagnosticBag diagnostics) 9685var result = BindIndexerOrIndexedPropertyAccess(syntax, receiver, properties, arguments, diagnostics); 9691private BoundExpression BindDynamicIndexer( 9693BoundExpression receiver, 9735private BoundExpression BindIndexerOrIndexedPropertyAccess( 9737BoundExpression receiver, 9775private BoundExpression BindIndexerOrIndexedPropertyAccessContinued( 9777BoundExpression receiver, 9783BoundExpression propertyAccess; 9822ImmutableArray<BoundExpression> arguments = BuildArgumentsForErrorRecovery(analyzedArguments, candidates); 9884BoundExpression receiver, 9918out var lengthOrCountAccess, out var indexerOrSliceAccess, out var argumentPlaceholders, diagnostics)) 9971[NotNullWhen(true)] out BoundExpression? lengthOrCountAccess, 9972[NotNullWhen(true)] out BoundExpression? indexerOrSliceAccess, 10004[NotNullWhen(true)] out BoundExpression? indexerOrSliceAccess, 10106void makeCall(SyntaxNode syntax, BoundExpression receiver, MethodSymbol method, 10107out BoundExpression indexerOrSliceAccess, out ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders) 10141out BoundExpression lengthOrCountAccess, 10520var receiver = node.ReceiverOpt!; 10686var receiver = node.ReceiverOpt!; 10943BoundExpression receiver = BindConditionalAccessReceiver(node, diagnostics); 10946var access = conditionalAccessBinder.BindValue(node.WhenNotNull, diagnostics, BindValueKind.RValue); 11038private BoundConditionalAccess GenerateBadConditionalAccessNodeError(ConditionalAccessExpressionSyntax node, BoundExpression receiver, BoundExpression access, BindingDiagnosticBag diagnostics) 11047private BoundExpression BindMemberBindingExpression(MemberBindingExpressionSyntax node, bool invoked, bool indexed, BindingDiagnosticBag diagnostics) 11049BoundExpression receiver = GetReceiverForConditionalBinding(node, diagnostics); 11051var memberAccess = BindMemberAccessWithBoundLeft(node, receiver, node.Name, node.OperatorToken, invoked, indexed, diagnostics); 11055private BoundExpression BindElementBindingExpression(ElementBindingExpressionSyntax node, BindingDiagnosticBag diagnostics) 11057BoundExpression receiver = GetReceiverForConditionalBinding(node, diagnostics); 11059var memberAccess = BindElementAccess(node, receiver, node.ArgumentList, allowInlineArrayElementAccess: true, diagnostics); 11078private BoundExpression GetReceiverForConditionalBinding(ExpressionSyntax binding, BindingDiagnosticBag diagnostics) 11083BoundExpression receiver = this.ConditionalReceiverExpression; 11103private BoundExpression BindConditionalAccessReceiver(ConditionalAccessExpressionSyntax node, BindingDiagnosticBag diagnostics) 11106var receiver = BindRValueWithoutTargetType(receiverSyntax, diagnostics);
Binder\Binder_Flags.cs (3)
48private readonly BoundExpression _receiverExpression; 50internal BinderWithConditionalReceiver(Binder next, BoundExpression receiverExpression) 58internal override BoundExpression ConditionalReceiverExpression
Binder\Binder_Initializers.cs (1)
257var expression = InitializerRewriter.GetTrailingScriptExpression(statement);
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(op1.Type, op2, diagnostics, isRef ? ConversionForAssignmentFlags.RefAssignment : ConversionForAssignmentFlags.None); 1530BoundExpression op1, 1531BoundExpression op2, 1599static object getName(BoundExpression expr) 1622internal static PropertySymbol GetPropertySymbol(BoundExpression expr, out BoundExpression receiver, out SyntaxNode propertySyntax) 1699internal static Symbol? GetIndexerOrImplicitIndexerSymbol(BoundExpression? e) 1759private static bool AccessingAutoPropertyFromConstructor(BoundExpression? receiver, PropertySymbol propertySymbol, Symbol fromMember, AccessorKind accessorKind) 1801private TypeSymbol GetAccessThroughType(BoundExpression receiver) 1820private BoundExpression BindPossibleArrayInitializer( 1833BoundExpression result; 1838ImmutableArray<BoundExpression>.Empty); 1917internal BoundExpression GenerateConversionForAssignment(TypeSymbol targetType, BoundExpression expression, BindingDiagnosticBag diagnostics, ConversionForAssignmentFlags flags = ConversionForAssignmentFlags.None) 1920internal BoundExpression GenerateConversionForAssignment(TypeSymbol targetType, BoundExpression expression, BindingDiagnosticBag diagnostics, out Conversion conversion, ConversionForAssignmentFlags flags = ConversionForAssignmentFlags.None) 2300BoundExpression operand, 2419void tryConversion(BoundExpression expr, ref bool reportedError, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2504ImmutableArray<BoundExpression> tupleArguments, 2518var argument = tupleArguments[i]; 2536var stack = ArrayBuilder<(Binder, IfStatementSyntax IfStatementSyntax, BoundExpression Condition, BoundStatement Consequence)>.GetInstance(); 2541var condition = binder.BindBooleanExpression(node.Condition, diagnostics); 2575BoundExpression condition; 2600internal BoundExpression BindBooleanExpression(ExpressionSyntax node, BindingDiagnosticBag diagnostics) 2636var expr = BindValue(node, diagnostics, BindValueKind.RValue); 2715BoundExpression resultOperand = CreateConversion( 2988BoundExpression arg = null; 3123internal BoundExpression CreateReturnConversion( 3126BoundExpression argument, 3238BoundExpression boundFilter = null; 3328BoundExpression exceptionSource = null; 3346private BoundExpression BindCatchFilter(CatchFilterClauseSyntax filter, BindingDiagnosticBag diagnostics) 3350BoundExpression boundFilter = this.BindBooleanExpression(filter.FilterExpression, diagnostics); 3413private static bool IsValidStatementExpression(SyntaxNode syntax, BoundExpression expression) 3443internal BoundBlock CreateBlockFromExpression(CSharpSyntaxNode node, ImmutableArray<LocalSymbol> locals, RefKind refKind, BoundExpression expression, ExpressionSyntax expressionSyntax, BindingDiagnosticBag diagnostics) 3532private static bool IsValidExpressionBody(SyntaxNode expressionSyntax, BoundExpression expression) 3573BoundExpression expression = bodyBinder.BindValue(expressionSyntax, diagnostics, requiredValueKind); 3589BoundExpression expression = bodyBinder.BindValue(expressionSyntax, diagnostics, requiredValueKind); 3593public BoundBlock CreateBlockFromExpression(ExpressionSyntax body, BoundExpression expression, BindingDiagnosticBag diagnostics) 3703BoundExpression initializerInvocation = GetBinder(initializer).BindConstructorInitializer(initializer.ArgumentList, (MethodSymbol)this.ContainingMember(), diagnostics); 3769BoundExpression initializerInvocation = GetBinder(initializer).BindConstructorInitializer(initializer.ArgumentList, (MethodSymbol)this.ContainingMember(), diagnostics); 3780BoundExpression? initializerInvocation; 3801internal static BoundExpression? BindImplicitConstructorInitializer( 3951BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true }; 3957arguments: ImmutableArray<BoundExpression>.Empty, 3996BoundExpression receiver = new BoundThisReference(syntax, constructor.ContainingType) { WasCompilerGenerated = true }; 3997BoundExpression argument = new BoundParameter(syntax, constructor.Parameters[0]); 4094internal PatternLookupResult PerformPatternMethodLookup(BoundExpression receiver, string methodName, 4104var boundAccess = BindInstanceMemberAccess( 4129var patternMethodCall = BindMethodGroupInvocation(
Binder\Binder_Symbols.cs (3)
1401BoundExpression receiver, 1419BoundExpression colorColorValueReceiver = GetValueExpressionIfTypeOrValueReceiver(receiver); 1488private bool IsPossiblyCapturingPrimaryConstructorParameterReference(BoundExpression colorColorValueReceiver, out ParameterSymbol parameterSymbol)
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\Binder_WithExpression.cs (3)
11/// This portion of the binder converts a <see cref="WithExpressionSyntax"/> into a <see cref="BoundExpression"/>. 15private BoundExpression BindWithExpression(WithExpressionSyntax syntax, BindingDiagnosticBag diagnostics) 19var receiver = BindRValueWithoutTargetType(syntax.Expression, diagnostics);
Binder\BuckStopsHereBinder.cs (2)
142internal override BoundExpression? ConditionalReceiverExpression 192internal override BoundExpression BindSwitchExpressionCore(SwitchExpressionSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics)
Binder\DecisionDagBuilder.cs (10)
84BoundExpression switchGoverningExpression, 100BoundExpression switchExpressionInput, 116BoundExpression inputExpression, 129BoundExpression inputExpression, 143BoundExpression switchGoverningExpression, 168BoundExpression switchExpressionInput, 188BoundExpression? whenClause, 404BoundExpression? variableAccess = declaration.VariableAccess; 1991public readonly BoundExpression? WhenClause; 1998BoundExpression? WhenClause,
Binder\ForEachEnumeratorInfo.cs (3)
47public readonly BoundExpression? CurrentConversion; // current to element type 64BoundExpression? currentConversion, 114public BoundExpression? CurrentConversion;
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\ForLoopBinder.cs (1)
91BoundExpression condition = null;
Binder\LockBinder.cs (1)
39BoundExpression expr = BindTargetExpression(diagnostics, originalBinder);
Binder\LockOrUsingBinder.cs (5)
56BoundExpression expression = BindTargetExpression(diagnostics: null, // Diagnostics reported by BindUsingStatementParts. 78protected BoundExpression BindTargetExpression(BindingDiagnosticBag diagnostics, Binder originalBinder, TypeSymbol targetTypeOpt = null) 84BoundExpression boundExpression = originalBinder.BindValue(TargetExpressionSyntax, expressionDiagnostics, Binder.BindValueKind.RValueOrMethodGroup); 112public readonly BoundExpression Expression; 115public ExpressionAndDiagnostics(BoundExpression expression, ReadOnlyBindingDiagnostic<AssemblySymbol> diagnostics)
Binder\MethodArgumentInfo.cs (3)
18public readonly ImmutableArray<BoundExpression> Arguments; 24ImmutableArray<BoundExpression> arguments, 37return new MethodArgumentInfo(method, arguments: ImmutableArray<BoundExpression>.Empty, defaultArguments: default, expanded: false);
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, uint 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\BestTypeInferrer.cs (4)
52ImmutableArray<BoundExpression> exprs, 70foreach (BoundExpression expr in exprs) 117BoundExpression expr1, 118BoundExpression expr2,
Binder\Semantics\Conversions\Conversion.cs (6)
96internal DeconstructionUncommonData(DeconstructMethodInfo deconstructMethodInfoOpt, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo) 104internal readonly ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> DeconstructConversionInfo; 180internal Conversion(ConversionKind kind, DeconstructMethodInfo deconstructMethodInfo, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo) 538internal ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> DeconstructConversionInfo 1253internal DeconstructMethodInfo(BoundExpression invocation, BoundDeconstructValuePlaceholder inputPlaceholder, 1260internal readonly BoundExpression Invocation;
Binder\Semantics\Conversions\Conversions.cs (2)
129protected override Conversion GetInterpolatedStringConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 223_ => ClassifyImplicitConversionFromExpression((BoundExpression)element, elementType, ref useSiteInfo),
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\Conversions\TypeConversions.cs (1)
54protected override Conversion GetInterpolatedStringConversion(BoundExpression source, TypeSymbol destination, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Conversions\UserDefinedExplicitConversions.cs (6)
21BoundExpression sourceExpression, 86BoundExpression sourceExpression, 129BoundExpression sourceExpression, 142BoundExpression sourceExpression, 367BoundExpression sourceExpression, 475private Conversion EncompassingExplicitConversion(BoundExpression expr, TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Conversions\UserDefinedImplicitConversions.cs (5)
26BoundExpression sourceExpression, 143BoundExpression sourceExpression, 282BoundExpression sourceExpression, 570private bool IsEncompassedBy(BoundExpression aExpr, TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 589private Conversion EncompassingImplicitConversion(BoundExpression aExpr, TypeSymbol a, TypeSymbol b, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo)
Binder\Semantics\Operators\BinaryOperatorEasyOut.cs (4)
286private void BinaryOperatorEasyOut(BinaryOperatorKind kind, BoundExpression left, BoundExpression right, BinaryOperatorOverloadResolutionResult result) 323private static bool PossiblyUnusualConstantOperation(BoundExpression left, BoundExpression right)
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\UnaryOperatorEasyOut.cs (1)
97private void UnaryOperatorEasyOut(UnaryOperatorKind kind, BoundExpression operand, UnaryOperatorOverloadResolutionResult result)
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\AnalyzedArguments.cs (4)
15public readonly ArrayBuilder<BoundExpression> Arguments; 23this.Arguments = new ArrayBuilder<BoundExpression>(32); 37public BoundExpression Argument(int i) 148ImmutableArray<BoundExpression> arguments,
Binder\Semantics\OverloadResolution\MethodGroup.cs (6)
18internal BoundExpression Receiver { get; private set; } 32BoundExpression receiverOpt, 42BoundExpression receiverOpt, 61BoundExpression receiverOpt, 75private void PopulateHelper(BoundExpression receiverOpt, LookupResultKind resultKind, DiagnosticInfo error) 103public BoundExpression InstanceOpt
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 2073ArrayBuilder<BoundExpression> arguments, 2112ArrayBuilder<BoundExpression> arguments, 2594ArrayBuilder<BoundExpression> arguments, 2658private static void GetParameterCounts<TMember>(MemberResolutionResult<TMember> m, ArrayBuilder<BoundExpression> arguments, out int declaredParameterCount, out int parametersUsedIncludingExpansionAndOptional) where TMember : Symbol 2810private BetterResult BetterConversionFromExpression(BoundExpression node, TypeSymbol t1, TypeSymbol t2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 2825BoundExpression node, 2880private BetterResult BetterConversionFromExpression(BoundExpression node, TypeSymbol t1, Conversion conv1, TypeSymbol t2, Conversion conv2, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo, out bool okToDowngradeToNeither) 3085elementBetterResult = BetterConversionFromExpression((BoundExpression)element, elementType1, conversionToE1, elementType2, conversionToE2, ref useSiteInfo, okToDowngradeToNeither: out _); 3205private bool ExpressionMatchExactly(BoundExpression node, TypeSymbol t, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 3363if (!(node is BoundExpression)) 4400BoundExpression argument = arguments.Argument(argumentPosition); 4539BoundExpression 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)
Binder\SwitchBinder.cs (9)
24private BoundExpression _switchGoverningExpression; 38protected BoundExpression SwitchGoverningExpression 64var boundSwitchExpression = BindSwitchGoverningExpression(switchGoverningDiagnostics); 212var boundLabelExpression = sectionBinder.BindTypeOrRValue(caseLabel.Value, tempDiagnosticBag); 240protected BoundExpression ConvertCaseExpression(CSharpSyntaxNode node, BoundExpression caseExpression, out ConstantValue constantValueOpt, BindingDiagnosticBag diagnostics, bool isGotoCaseExpr = false) 359private BoundExpression BindSwitchGoverningExpression(BindingDiagnosticBag diagnostics) 379var switchGoverningExpression = binder.BindRValueWithoutTargetType(node, diagnostics); 475BoundExpression gotoCaseExpressionOpt = null;
Binder\SwitchBinder_Patterns.cs (1)
39BoundExpression boundSwitchGoverningExpression = SwitchGoverningExpression;
Binder\SwitchExpressionArmBinder.cs (2)
43BoundExpression? whenClause = node.WhenClause != null 46BoundExpression armResult = armBinder.BindValue(node.Expression, diagnostics, BindValueKind.RValue);
Binder\SwitchExpressionBinder.cs (7)
26internal override BoundExpression BindSwitchExpressionCore(SwitchExpressionSyntax node, Binder originalBinder, BindingDiagnosticBag diagnostics) 31var boundInputExpression = BindSwitchGoverningExpression(diagnostics); 56BoundExpression boundInputExpression, 175private ImmutableArray<BoundSwitchExpressionArm> BindSwitchExpressionArms(SwitchExpressionSyntax node, Binder originalBinder, BoundExpression inputExpression, BindingDiagnosticBag diagnostics) 190internal TypeSymbol GetInputType(BoundExpression? inputExpression = null) 197private BoundExpression BindSwitchGoverningExpression(BindingDiagnosticBag diagnostics) 199var switchGoverningExpression = BindRValueWithoutTargetType(SwitchExpressionSyntax.GoverningExpression, diagnostics);
Binder\UsingStatementBinder.cs (3)
110BoundExpression? expressionOpt = null; 195BoundExpression? receiver = fromExpression 206var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(disposeMethod.ParameterCount);
Binder\WhileBinder.cs (2)
32var condition = originalBinder.BindBooleanExpression(node.Condition, diagnostics); 42var condition = originalBinder.BindBooleanExpression(node.Condition, diagnostics);
BoundTree\BoundArrayInitialization.cs (1)
11public BoundArrayInitialization Update(ImmutableArray<BoundExpression> initializers)
BoundTree\BoundDagEvaluation.cs (1)
51static Symbol? getSymbolFromIndexerAccess(BoundExpression indexerAccess)
BoundTree\BoundDecisionDag.cs (1)
144public BoundDecisionDag SimplifyDecisionDagIfConstantInput(BoundExpression input)
BoundTree\BoundDiscardExpression.cs (1)
12public BoundExpression SetInferredTypeWithAnnotations(TypeWithAnnotations type)
BoundTree\BoundExpression.cs (16)
34internal BoundExpression WithSuppression(bool suppress = true) 44var result = (BoundExpression)MemberwiseClone(); 49internal BoundExpression WithWasConverted() 59var result = (BoundExpression)MemberwiseClone(); 67internal new BoundExpression WithHasErrors() 69return (BoundExpression)base.WithHasErrors(); 478public BoundConversion UpdateOperand(BoundExpression operand) 538ImmutableArray<BoundExpression> newArguments, 669public BoundExpression ValueExpression { get; } 671public BoundExpression TypeExpression { get; } 674public BoundTypeOrValueData(Symbol valueSymbol, BoundExpression valueExpression, ReadOnlyBindingDiagnostic<AssemblySymbol> valueDiagnostics, BoundExpression typeExpression, ReadOnlyBindingDiagnostic<AssemblySymbol> typeDiagnostics) 727internal void VisitAllElements<T>(Action<BoundExpression, T> action, T args) 729foreach (var argument in this.Arguments)
BoundTree\BoundExpressionExtensions.cs (15)
20public static RefKind GetRefKind(this BoundExpression node) 81public static bool IsLiteralNull(this BoundExpression node) 86public static bool IsLiteralDefault(this BoundExpression node) 91public static bool IsImplicitObjectCreation(this BoundExpression node) 96public static bool IsLiteralDefaultOrImplicitObjectCreation(this BoundExpression node) 107public static bool IsDefaultValue(this BoundExpression node) 123public static bool HasExpressionType(this BoundExpression node) 129public static bool HasDynamicType(this BoundExpression node) 135public static NamedTypeSymbol? GetInferredDelegateType(this BoundExpression expr, ref CompoundUseSiteInfo<AssemblySymbol> useSiteInfo) 144public static TypeSymbol? GetTypeOrFunctionType(this BoundExpression expr) 153public static FunctionTypeSymbol? GetFunctionType(this BoundExpression expr) 168public static void GetExpressionSymbols(this BoundExpression node, ArrayBuilder<Symbol> symbols, BoundNode parent, Binder binder) 240public static Conversion GetConversion(this BoundExpression boundNode) 253internal static bool IsExpressionOfComImportType([NotNullWhen(true)] this BoundExpression? expressionOpt) 268internal static bool IsDiscardExpression(this BoundExpression expr)
BoundTree\BoundExpressionWithNullability.cs (1)
11public BoundExpressionWithNullability(SyntaxNode syntax, BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type)
BoundTree\BoundImplicitIndexerAccess.cs (1)
12internal BoundImplicitIndexerAccess WithLengthOrCountAccess(BoundExpression lengthOrCountAccess)
BoundTree\BoundMethodGroup.cs (2)
16BoundExpression receiverOpt, 57public BoundExpression? InstanceOpt
BoundTree\BoundNewT.cs (2)
13public override ImmutableArray<BoundExpression> Arguments => ImmutableArray<BoundExpression>.Empty;
BoundTree\BoundNode.cs (5)
110var expression = this as BoundExpression; 157Debug.Assert(original is BoundExpression || !original.IsSuppressed); 368ImmutableArray<BoundNode>.CastUp(collection.Elements.CastArray<BoundExpression>()) == collection.Elements); 443public static Conversion GetConversion(BoundExpression? conversion, BoundValuePlaceholder? placeholder)
BoundTree\BoundNode_Source.cs (6)
128var expression = seqPoint.Expression; 151var value = returnStatement.ExpressionOpt; 214var receiver = call.ReceiverOpt; 224foreach (var argument in call.Arguments) 269var receiver = fieldAccess.ReceiverOpt; 337foreach (var effect in sequence.SideEffects)
BoundTree\BoundNodeExtensions.cs (5)
44BoundExpression expression = ((BoundExpressionStatement)statement).Expression; 61BoundExpression? receiverOpt = call!.ReceiverOpt; 73public static bool ContainsAwaitExpression(this ImmutableArray<BoundExpression> expressions) 76foreach (var expression in expressions) 249public static InterpolatedStringHandlerData GetInterpolatedStringHandlerData(this BoundExpression e, bool throwOnMissing = true)
BoundTree\BoundNoPiaObjectCreationExpression.cs (2)
13public override ImmutableArray<BoundExpression> Arguments => ImmutableArray<BoundExpression>.Empty;
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\BoundObjectCreationExpressionBase.cs (1)
13public abstract ImmutableArray<BoundExpression> Arguments { get; }
BoundTree\BoundPatternBinding.cs (2)
14public readonly BoundExpression VariableAccess; 16public BoundPatternBinding(BoundExpression variableAccess, BoundDagTemp tempContainingValue)
BoundTree\BoundSpillSequence.cs (4)
18ImmutableArray<BoundExpression> sideEffects, 19BoundExpression value, 26private static ImmutableArray<BoundStatement> MakeStatements(ImmutableArray<BoundExpression> expressions) 28return expressions.SelectAsArray<BoundExpression, BoundStatement>(
BoundTree\BoundTreeRewriter.cs (8)
81if (node is BoundExpression or BoundPattern) 111BoundExpression child = node.Left; 136var left = (BoundExpression?)this.Visit(child); 142var right = (BoundExpression?)this.Visit(binary.Right); 185BoundExpression condition = (BoundExpression)this.Visit(ifStatement.Condition);
BoundTree\BoundTreeVisitors.cs (1)
202Debug.Assert(node is BoundExpression or BoundPattern);
BoundTree\BoundTreeWalker.cs (5)
30BoundExpression? unoptimizedForm = queryClause.UnoptimizedForm; 73if (node is BoundExpression or BoundPattern) 88Debug.Assert(node is BoundExpression or BoundPattern); 112var rightOperands = ArrayBuilder<BoundExpression>.GetInstance(); 119BoundExpression? current = binary.Left;
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\Expression.cs (6)
12internal static ImmutableArray<BoundExpression> GetChildInitializers(BoundExpression? objectOrCollectionInitializer) 26return ImmutableArray<BoundExpression>.Empty; 76protected override ImmutableArray<BoundNode?> Children => StaticCast<BoundNode?>.From(this.ConstructorArguments.AddRange(StaticCast<BoundExpression>.From(this.NamedArguments))); 131internal static ImmutableArray<BoundExpression> GetChildInitializers(BoundArrayInitialization? arrayInitializer) 133return arrayInitializer?.Initializers ?? ImmutableArray<BoundExpression>.Empty;
BoundTree\InterpolatedStringHandlerData.cs (3)
14public readonly BoundExpression Construction; 31BoundExpression construction, 50public InterpolatedStringHandlerData(BoundExpression construction)
BoundTree\NullabilityRewriter.cs (14)
32var stack = ArrayBuilder<(BoundIfStatement, BoundExpression, BoundStatement)>.GetInstance(); 37var rewrittenCondition = (BoundExpression)Visit(node.Condition); 88var leftChild = (BoundExpression)Visit(stack.Peek().Left); 95var right = (BoundExpression)Visit(currentBinary.Right); 210BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 211BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 212BoundExpression lengthOrCountAccess = node.LengthOrCountAccess; 213BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerOrSliceAccess);
BoundTree\PseudoVariableExpressions.cs (2)
13internal abstract BoundExpression GetValue(BoundPseudoVariable variable, DiagnosticBag diagnostics); 14internal abstract BoundExpression GetAddress(BoundPseudoVariable variable);
BoundTree\TupleBinaryOperatorInfo.cs (2)
52internal readonly BoundExpression? ConversionForBool; // If a conversion to bool exists, then no operator needed. If an operator is needed, this holds the conversion for input to that operator. 63BoundExpression? conversionForBool,
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)
BoundTree\VariablePendingInference.cs (3)
27internal BoundExpression SetInferredTypeWithAnnotations(TypeWithAnnotations type, BindingDiagnosticBag? diagnosticsOpt) 34internal BoundExpression SetInferredTypeWithAnnotations(TypeWithAnnotations type, Binder? binderOpt, BindingDiagnosticBag? diagnosticsOpt) 114internal BoundExpression FailInference(Binder binder, BindingDiagnosticBag? diagnosticsOpt)
CodeGen\EmitAddress.cs (9)
26private LocalDefinition EmitAddress(BoundExpression expression, AddressKind addressKind) 103BoundExpression operand = ((BoundPointerIndirectionOperator)expression).Operand; 330private LocalDefinition EmitAddressOfTempClone(BoundExpression expression) 353private static LocalSymbol DigForValueLocal(BoundSequence topSequence, BoundExpression value) 373var receiver = fieldAccess.ReceiverOpt; 385private void EmitArrayIndices(ImmutableArray<BoundExpression> indices) 389BoundExpression index = indices[i]; 468private bool HasHome(BoundExpression expression, AddressKind addressKind) 504private LocalDefinition EmitReceiverRef(BoundExpression receiver, AddressKind addressKind)
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\EmitConversion.cs (4)
54var operand = conversion.Operand; 70BoundExpression operand = expression.Operand; 311private void EmitDelegateCreation(BoundExpression node, BoundExpression receiver, bool isExtensionMethod, MethodSymbol method, TypeSymbol delegateType, bool used)
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\EmitOperators.cs (9)
92BoundExpression child = expression.Left; 361var comparand = binOp.Right; 454private void EmitIsNotNullOrZero(BoundExpression comparand, ConstantValue nullOrZero) 468private void EmitIsNullOrZero(BoundExpression comparand, ConstantValue nullOrZero) 482private void EmitBinaryCondOperatorHelper(ILOpCode opCode, BoundExpression left, BoundExpression right, bool sense) 492private void EmitCondExpr(BoundExpression condition, bool sense) 527private bool TryEmitComparison(BoundExpression condition, bool sense) 571private static void RemoveNegation(ref BoundExpression condition, ref bool sense)
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\CSharpCompilation.cs (1)
2187BoundExpression? result;
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) 4598var receiver = node.ReceiverOpt; 4785BoundExpression receiver = call.Arguments[0]; 4794private 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)
Compilation\MemberSemanticModel.NodeMapBuilder.cs (1)
196var stack = ArrayBuilder<BoundExpression>.GetInstance();
Compilation\SpeculativeSemanticModelWithMemberModel.cs (1)
565internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
Compilation\SyntaxTreeSemanticModel.cs (2)
233BoundExpression bound = binder.BindExpression((ExpressionSyntax)node, BindingDiagnosticBag.Discarded); 738internal override BoundExpression GetSpeculativelyBoundExpression(int position, ExpressionSyntax expression, SpeculativeBindingOption bindingOption, out Binder binder, out ImmutableArray<Symbol> crefSymbols)
Compiler\AnonymousTypeMethodBodySynthesizer.cs (7)
39BoundExpression call = Binder.GenerateBaseParameterlessConstructorInitializer(this, diagnostics); 125BoundExpression retExpression = F.Binary(BinaryOperatorKind.ObjectNotEqual, 194BoundExpression retExpression = F.Literal(initHash); 244BoundExpression retExpression = null; 249BoundExpression[] arguments = new BoundExpression[fieldCount]; 278BoundExpression format = F.Literal(formatString.ToStringAndFree());
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,
Compiler\MethodBodySynthesizer.Lowered.cs (12)
352public static BoundExpression GenerateHashCombine( 353BoundExpression currentHashValue, 357BoundExpression valueToHash, 380BoundExpression valueToHash, 398public static BoundExpression GenerateFieldEquals( 399BoundExpression? initialExpression, 400BoundExpression otherReceiver, 420BoundExpression? retExpression = initialExpression; 430BoundExpression nextEquals = F.Call( 457var argBuilder = ArrayBuilder<BoundExpression>.GetInstance(); 465BoundExpression invocation = F.Call(methodToInvoke.IsStatic ? null : (useBaseReference ? (BoundExpression)F.Base(baseType: methodToInvoke.ContainingType) : F.This()),
Compiler\MethodCompiler.cs (2)
2341var initializerInvocation = Binder.BindImplicitConstructorInitializer(method, diagnostics, compilation); 2357private static void ReportCtorInitializerCycles(MethodSymbol method, BoundExpression initializerInvocation, TypeCompilationState compilationState, BindingDiagnosticBag diagnostics)
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\AlwaysAssignedWalker.cs (1)
72protected override void WriteArgument(BoundExpression arg, RefKind refKind, MethodSymbol method)
FlowAnalysis\ControlFlowPass.cs (1)
125if (!(node is BoundExpression))
FlowAnalysis\DataFlowsOutWalker.cs (2)
91protected override void NoteWrite(Symbol variable, BoundExpression value, bool read, bool isRef) 201protected override void AssignImpl(BoundNode node, BoundExpression value, bool isRef, bool written, bool read)
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\LocalDataFlowPass.cs (5)
204protected abstract bool TryGetReceiverAndMember(BoundExpression expr, out BoundExpression? receiver, [NotNullWhen(true)] out Symbol? member); 211protected virtual int MakeSlot(BoundExpression node) 227if (TryGetReceiverAndMember(node, out BoundExpression? receiver, out Symbol? member)) 239protected int MakeMemberSlot(BoundExpression? receiverOpt, Symbol member)
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&lt;LocalState&gt;,bool, Location, ArrayBuilder&lt;VisitResult&gt;)"/>. 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) 7220ImmutableArray<BoundExpression> arguments, 7254private ImmutableArray<FlowAnalysisAnnotations> GetParametersAnnotations(ImmutableArray<BoundExpression> arguments, ImmutableArray<ParameterSymbol> parametersOpt, ImmutableArray<int> argsToParamsOpt, bool expanded) 7282private VisitResult VisitArgumentEvaluate(BoundExpression argument, RefKind refKind, FlowAnalysisAnnotations annotations) 7288private bool VisitArgumentEvaluateNeedsCloningState(BoundExpression argument) 7294private VisitResult VisitArgumentEvaluateEpilogue(BoundExpression argument, RefKind refKind, FlowAnalysisAnnotations annotations) 7347BoundExpression argumentNoConversion, 7434private bool CheckDisallowedNullAssignment(TypeWithState state, FlowAnalysisAnnotations annotations, SyntaxNode node, BoundExpression? boundValueOpt = null) 7485BoundExpression argument, 7601void trackNullableStateForAssignment(BoundExpression parameterValue, TypeWithAnnotations lValueType, int targetSlot, TypeWithState parameterWithState, bool isSuppressed, FlowAnalysisAnnotations parameterAnnotations) 7691private void LearnFromPostConditions(BoundExpression argument, FlowAnalysisAnnotations parameterAnnotations) 7737private (ImmutableArray<BoundExpression> arguments, ImmutableArray<Conversion> conversions) RemoveArgumentConversions( 7738ImmutableArray<BoundExpression> arguments, 7745var argumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(n); 7751var argument = arguments[i]; 7755var before = argument; 7820ImmutableArray<BoundExpression> arguments, 7883internal override TypeWithAnnotations GetTypeWithAnnotations(BoundExpression expr) 7894private static NullableAnnotation GetNullableAnnotation(BoundExpression expr) 7929private ImmutableArray<BoundExpression> GetArgumentsForMethodTypeInference(ImmutableArray<VisitResult> argumentResults, ImmutableArray<BoundExpression> arguments) 7937var builder = ArrayBuilder<BoundExpression>.GetInstance(n); 7945BoundExpression getArgumentForMethodTypeInference(BoundExpression argument, VisitResult visitResult) 7969if (collection.Elements[i] is BoundExpression elementExpression) 8044private static (BoundExpression expression, Conversion conversion) RemoveConversion(BoundExpression expr, bool includeExplicitConversions) 8082private Conversion GenerateConversionForConditionalOperator(BoundExpression sourceExpression, TypeSymbol? sourceType, TypeSymbol destinationType, bool reportMismatch, bool isChecked) 8093private Conversion GenerateConversion(Conversions conversions, BoundExpression? sourceExpression, TypeSymbol? sourceType, TypeSymbol destinationType, bool fromExplicitCast, bool extensionMethodThisArgument, bool isChecked) 8122private bool UseExpressionForConversion([NotNullWhen(true)] BoundExpression? value) 8275(BoundExpression operand, Conversion conversion) = RemoveConversion(node, includeExplicitConversions: true); 8310private TypeWithState VisitOptionalImplicitConversion(BoundExpression expr, TypeWithAnnotations targetTypeOpt, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind) 8323BoundExpression expr, 8330(BoundExpression operand, Conversion conversion) = RemoveConversion(expr, includeExplicitConversions: false); 8337BoundExpression expr, 8340BoundExpression operand, 8373Func<TypeWithAnnotations, TypeWithState> visitConversionAsContinuation(BoundExpression expr, bool useLegacyWarnings, bool trackMembers, AssignmentKind assignmentKind, BoundExpression operand, Conversion conversion, TypeWithState operandType) 8465ImmutableArray<BoundExpression> values, 8496void trackState(BoundExpression value, FieldSymbol field, TypeWithState valueType) 8510private void TrackNullableStateOfNullableValue(int containingSlot, TypeSymbol containingType, BoundExpression? value, TypeWithState valueType, int valueSlot) 8525BoundExpression convertedNode, 8748private static BoundConversion? GetConversionIfApplicable(BoundExpression? conversionOpt, BoundExpression convertedNode) 8779BoundExpression conversionOperand, 9331BoundExpression conversionOperand, 9475private void SnapshotWalkerThroughConversionGroup(BoundExpression conversionExpression, BoundExpression convertedNode) 9494private void TrackAnalyzedNullabilityThroughConversionGroup(TypeWithState resultType, BoundConversion? conversionOpt, BoundExpression convertedNode) 9551BoundExpression node, 9617case BoundExpression arg when arg.Type is { TypeKind: TypeKind.Delegate }: 9729Action<NamedTypeSymbol>? visitDelegateArgument(NamedTypeSymbol delegateType, BoundExpression arg, bool isTargetTyped) 9743Action<NamedTypeSymbol>? analyzeDelegateConversion(NamedTypeSymbol delegateType, BoundExpression arg, bool isTargetTyped) 9763Action<NamedTypeSymbol> analyzeDelegateConversionAsContinuation(BoundExpression arg) 9773var receiverOpt = node.ReceiverOpt; 9787private bool TryGetMethodGroupReceiverNullability([NotNullWhen(true)] BoundExpression? receiverOpt, out TypeWithState type) 9802private void SetMethodGroupReceiverNullability(BoundExpression receiver, TypeWithState type) 9804_methodGroupReceiverMapOpt ??= PooledDictionary<BoundExpression, TypeWithState>.GetInstance(); 9810var receiverOpt = group.ReceiverOpt; 9820var arguments = ArrayBuilder<BoundExpression>.GetInstance(); 9917private void VisitThisOrBaseReference(BoundExpression node) 9938var left = node.Left; 9939var right = node.Right; 10010private void AdjustSetValue(BoundExpression left, ref TypeWithState rightState) 10025private FlowAnalysisAnnotations GetLValueAnnotations(BoundExpression expr) 10086private static bool UseLegacyWarnings(BoundExpression expr) 10134private void VisitDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt = null) 10148private void VisitDeconstructMethodArguments(ArrayBuilder<DeconstructionVariable> variables, Conversion conversion, BoundExpression right, TypeWithState? rightResultOpt) 10183ArrayBuilder<BoundExpression> placeholderArgs = ArrayBuilder<BoundExpression>.GetInstance(n + 1); 10219var nestedRight = CreatePlaceholderIfNecessary(invocation.Arguments[i + offset], parameter.TypeWithAnnotations); 10246private void VisitTupleDeconstructionArguments(ArrayBuilder<DeconstructionVariable> variables, ImmutableArray<(BoundValuePlaceholder? placeholder, BoundExpression? conversion)> deconstructConversionInfo, BoundExpression right, TypeWithState? rightResultOpt) 10257var rightPart = rightParts[i]; 10332internal readonly BoundExpression Expression; 10336internal DeconstructionVariable(BoundExpression expression, TypeWithAnnotations type) 10343internal DeconstructionVariable(BoundExpression expression, ArrayBuilder<DeconstructionVariable> nestedVariables) 10355foreach (var argument in arguments) 10361DeconstructionVariable getDeconstructionAssignmentVariable(BoundExpression expr) 10379private ImmutableArray<BoundExpression> GetDeconstructionRightParts(BoundExpression expr, TypeWithState? rightResultOpt) 10409return fields.SelectAsArray((f, e) => (BoundExpression)new BoundFieldAccess(e.Syntax, e, f, constantValueOpt: null), expr); 10579var initializer = node.Expression; 10601private void ReportArgumentWarnings(BoundExpression argument, TypeWithState argumentType, ParameterSymbol parameter) 10612private void ReportNullabilityMismatchInRefArgument(BoundExpression argument, TypeSymbol argumentType, ParameterSymbol parameter, TypeSymbol parameterType) 10690var receiverOpt = node.ReceiverOpt; 10758private Symbol VisitMemberAccess(BoundExpression node, BoundExpression? receiverOpt, Symbol member) 10861BoundExpression collectionExpression, 10863BoundExpression expr, 11183foreach (var child in node.ChildBoundNodes) 11194VisitRvalue(child as BoundExpression); 11355protected override void AfterLeftChildOfBinaryLogicalOperatorHasBeenVisited(BoundExpression node, BoundExpression right, bool isAnd, bool isBool, ref LocalState leftTrue, ref LocalState leftFalse) 11362BoundExpression? left = null; 11414private TypeWithState InferResultNullabilityOfBinaryLogicalOperator(BoundExpression node, TypeWithState leftType, TypeWithState rightType) 11508var operand = node.Operand; 11652var receiver = node.Receiver; 11664var expr = node.Expression; 11668var receiverOpt = (expr as BoundMethodGroup)?.ReceiverOpt; 11684var receiverOpt = node.ReceiverOpt; 11769private void SetUnknownResultNullability(BoundExpression expression) 11776var receiver = node.Receiver; 11788private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, bool checkNullableValueType = false) 11793private bool CheckPossibleNullReceiver(BoundExpression? receiverOpt, TypeWithState resultType, bool checkNullableValueType) 11837private void CheckExtensionMethodThisNullability(BoundExpression expr, Conversion conversion, ParameterSymbol parameter, TypeWithState result) 11904protected override void VisitInterpolatedStringHandlerConstructor(BoundExpression? constructor) 11973private void VisitThrow(BoundExpression? expr) 11992BoundExpression 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\NullableWalker.PlaceholderLocal.cs (1)
62internal override ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue) => ReadOnlyBindingDiagnostic<AssemblySymbol>.Empty;
FlowAnalysis\NullableWalker_Patterns.cs (11)
25BoundExpression expression, 377BoundExpression expression, 405var originalInputMap = PooledDictionary<int, BoundExpression>.GetInstance(); 674var variableAccess = binding.VariableAccess; 846static TypeWithAnnotations getIndexerOutputType(TypeSymbol inputType, BoundExpression e, bool isSlice) 915var expressions = ArrayBuilder<BoundExpression>.GetInstance(numSwitchArms); 916var placeholderBuilder = ArrayBuilder<BoundExpression>.GetInstance(numSwitchArms); 931(BoundExpression expression, Conversion conversion) = RemoveConversion(arm.Value, includeExplicitConversions: false); 990ArrayBuilder<BoundExpression> expressions, 1035ArrayBuilder<BoundExpression> expressions) 1048private int GetSlotForSwitchInputValue(BoundExpression node)
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)
291protected BoundEqualsValue(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 303public BoundExpression Value { get; } 308public BoundFieldEqualsValue(SyntaxNode syntax, FieldSymbol field, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 324public BoundFieldEqualsValue Update(FieldSymbol field, ImmutableArray<LocalSymbol> locals, BoundExpression value) 338public BoundPropertyEqualsValue(SyntaxNode syntax, PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 354public BoundPropertyEqualsValue Update(PropertySymbol property, ImmutableArray<LocalSymbol> locals, BoundExpression value) 368public BoundParameterEqualsValue(SyntaxNode syntax, ParameterSymbol parameter, ImmutableArray<LocalSymbol> locals, BoundExpression value, bool hasErrors = false) 384public BoundParameterEqualsValue Update(ParameterSymbol parameter, ImmutableArray<LocalSymbol> locals, BoundExpression value) 499public BoundCapturedReceiverPlaceholder(SyntaxNode syntax, BoundExpression receiver, uint localScopeDepth, TypeSymbol? type, bool hasErrors = false) 509public BoundExpression Receiver { get; } 515public BoundCapturedReceiverPlaceholder Update(BoundExpression receiver, uint localScopeDepth, TypeSymbol? type) 951public BoundPassByCopy(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false) 960public BoundExpression Expression { get; } 965public BoundPassByCopy Update(BoundExpression expression, TypeSymbol? type) 979public BoundBadExpression(SyntaxNode syntax, LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type, bool hasErrors = false) 993public ImmutableArray<BoundExpression> ChildBoundNodes { get; } 998public BoundBadExpression Update(LookupResultKind resultKind, ImmutableArray<Symbol?> symbols, ImmutableArray<BoundExpression> childBoundNodes, TypeSymbol? type) 1068public BoundTypeExpression(SyntaxNode syntax, AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type, bool hasErrors = false) 1082public ImmutableArray<BoundExpression> BoundDimensionsOpt { get; } 1089public BoundTypeExpression Update(AliasSymbol? aliasOpt, BoundTypeExpression? boundContainingTypeOpt, ImmutableArray<BoundExpression> boundDimensionsOpt, TypeWithAnnotations typeWithAnnotations, TypeSymbol type) 1182public BoundUnaryOperator(SyntaxNode syntax, UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type, bool hasErrors = false) 1200public BoundExpression Operand { get; } 1210public BoundUnaryOperator Update(UnaryOperatorKind operatorKind, BoundExpression operand, ConstantValue? constantValueOpt, MethodSymbol? methodOpt, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type) 1224public 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) 1245public BoundExpression Operand { get; } 1249public BoundExpression? OperandConversion { get; } 1251public BoundExpression? ResultConversion { get; } 1258public 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) 1272public BoundAddressOfOperator(SyntaxNode syntax, BoundExpression operand, bool isManaged, TypeSymbol type, bool hasErrors = false) 1284public BoundExpression Operand { get; } 1290public BoundAddressOfOperator Update(BoundExpression operand, bool isManaged, TypeSymbol type) 1376public BoundPointerIndirectionOperator(SyntaxNode syntax, BoundExpression operand, bool refersToLocation, TypeSymbol type, bool hasErrors = false) 1388public BoundExpression Operand { get; } 1394public BoundPointerIndirectionOperator Update(BoundExpression operand, bool refersToLocation, TypeSymbol type) 1408public BoundPointerElementAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression index, bool @checked, bool refersToLocation, TypeSymbol type, bool hasErrors = false) 1423public BoundExpression Expression { get; } 1424public BoundExpression Index { get; } 1431public BoundPointerElementAccess Update(BoundExpression expression, BoundExpression index, bool @checked, bool refersToLocation, TypeSymbol type) 1445public BoundFunctionPointerInvocation(SyntaxNode syntax, BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 1460public BoundExpression InvokedExpression { get; } 1461public ImmutableArray<BoundExpression> Arguments { get; } 1468public BoundFunctionPointerInvocation Update(BoundExpression invokedExpression, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, LookupResultKind resultKind, TypeSymbol type) 1482public BoundRefTypeOperator(SyntaxNode syntax, BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type, bool hasErrors = false) 1494public BoundExpression Operand { get; } 1500public BoundRefTypeOperator Update(BoundExpression operand, MethodSymbol? getTypeFromHandle, TypeSymbol type) 1514public BoundMakeRefOperator(SyntaxNode syntax, BoundExpression operand, TypeSymbol type, bool hasErrors = false) 1525public BoundExpression Operand { get; } 1530public BoundMakeRefOperator Update(BoundExpression operand, TypeSymbol type) 1544public BoundRefValueOperator(SyntaxNode syntax, NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type, bool hasErrors = false) 1557public BoundExpression Operand { get; } 1562public BoundRefValueOperator Update(NullableAnnotation nullableAnnotation, BoundExpression operand, TypeSymbol type) 1576public BoundFromEndIndexExpression(SyntaxNode syntax, BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false) 1588public BoundExpression Operand { get; } 1594public BoundFromEndIndexExpression Update(BoundExpression operand, MethodSymbol? methodOpt, TypeSymbol type) 1608public BoundRangeExpression(SyntaxNode syntax, BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type, bool hasErrors = false) 1620public BoundExpression? LeftOperandOpt { get; } 1621public BoundExpression? RightOperandOpt { get; } 1627public BoundRangeExpression Update(BoundExpression? leftOperandOpt, BoundExpression? rightOperandOpt, MethodSymbol? methodOpt, TypeSymbol type) 1641protected BoundBinaryOperatorBase(BoundKind kind, SyntaxNode syntax, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1654public BoundExpression Left { get; } 1655public BoundExpression Right { get; } 1660public BoundBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1680public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type) 1694public BoundTupleBinaryOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type, bool hasErrors = false) 1710public BoundExpression Left { get; } 1711public BoundExpression Right { get; } 1718public BoundTupleBinaryOperator Update(BoundExpression left, BoundExpression right, BinaryOperatorKind operatorKind, TupleBinaryOperatorInfo.Multiple operators, TypeSymbol type) 1732public 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) 1763public BoundUserDefinedConditionalLogicalOperator Update(BinaryOperatorKind operatorKind, MethodSymbol logicalOperator, MethodSymbol trueOperator, MethodSymbol falseOperator, TypeSymbol? constrainedToTypeOpt, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, BoundExpression left, BoundExpression right, TypeSymbol type) 1777public 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) 1798public BoundExpression Left { get; } 1799public BoundExpression Right { get; } 1801public BoundExpression? LeftConversion { get; } 1803public BoundExpression? FinalConversion { get; } 1810public BoundCompoundAssignmentOperator Update(BinaryOperatorSignature @operator, BoundExpression left, BoundExpression right, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundValuePlaceholder? finalPlaceholder, BoundExpression? finalConversion, LookupResultKind resultKind, ImmutableArray<MethodSymbol> originalUserDefinedOperatorsOpt, TypeSymbol type) 1824public BoundAssignmentOperator(SyntaxNode syntax, BoundExpression left, BoundExpression right, bool isRef, TypeSymbol type, bool hasErrors = false) 1837public BoundExpression Left { get; } 1838public BoundExpression Right { get; } 1844public BoundAssignmentOperator Update(BoundExpression left, BoundExpression right, bool isRef, TypeSymbol type) 1893public BoundNullCoalescingOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, bool @checked, TypeSymbol type, bool hasErrors = false) 1910public BoundExpression LeftOperand { get; } 1911public BoundExpression RightOperand { get; } 1913public BoundExpression? LeftConversion { get; } 1920public BoundNullCoalescingOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, BoundValuePlaceholder? leftPlaceholder, BoundExpression? leftConversion, BoundNullCoalescingOperatorResultKind operatorResultKind, bool @checked, TypeSymbol type) 1934public BoundNullCoalescingAssignmentOperator(SyntaxNode syntax, BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type, bool hasErrors = false) 1945public BoundExpression LeftOperand { get; } 1946public BoundExpression RightOperand { get; } 1951public BoundNullCoalescingAssignmentOperator Update(BoundExpression leftOperand, BoundExpression rightOperand, TypeSymbol? type) 1965public BoundUnconvertedConditionalOperator(SyntaxNode syntax, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, ErrorCode noCommonTypeError, bool hasErrors = false) 1981public BoundExpression Condition { get; } 1982public BoundExpression Consequence { get; } 1983public BoundExpression Alternative { get; } 1990public BoundUnconvertedConditionalOperator Update(BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, ErrorCode noCommonTypeError) 2004public BoundConditionalOperator(SyntaxNode syntax, bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 2024public BoundExpression Condition { get; } 2025public BoundExpression Consequence { get; } 2026public BoundExpression Alternative { get; } 2034public BoundConditionalOperator Update(bool isRef, BoundExpression condition, BoundExpression consequence, BoundExpression alternative, ConstantValue? constantValueOpt, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, TypeSymbol type) 2048public BoundArrayAccess(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> indices, TypeSymbol type, bool hasErrors = false) 2061public BoundExpression Expression { get; } 2062public ImmutableArray<BoundExpression> Indices { get; } 2067public BoundArrayAccess Update(BoundExpression expression, ImmutableArray<BoundExpression> indices, TypeSymbol type) 2110public BoundArrayLength(SyntaxNode syntax, BoundExpression expression, TypeSymbol type, bool hasErrors = false) 2121public BoundExpression Expression { get; } 2126public BoundArrayLength Update(BoundExpression expression, TypeSymbol type) 2140public BoundAwaitableInfo(SyntaxNode syntax, BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, bool hasErrors = false) 2152public BoundExpression? GetAwaiter { get; } 2159public BoundAwaitableInfo Update(BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult) 2173public BoundAwaitExpression(SyntaxNode syntax, BoundExpression expression, BoundAwaitableInfo awaitableInfo, BoundAwaitExpressionDebugInfo debugInfo, TypeSymbol type, bool hasErrors = false) 2187public BoundExpression Expression { get; } 2194public BoundAwaitExpression Update(BoundExpression expression, BoundAwaitableInfo awaitableInfo, BoundAwaitExpressionDebugInfo debugInfo, TypeSymbol type) 2847public BoundIsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type, bool hasErrors = false) 2861public BoundExpression Operand { get; } 2868public BoundIsOperator Update(BoundExpression operand, BoundTypeExpression targetType, ConversionKind conversionKind, TypeSymbol type) 2882public BoundAsOperator(SyntaxNode syntax, BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type, bool hasErrors = false) 2897public BoundExpression Operand { get; } 2900public BoundExpression? OperandConversion { get; } 2905public BoundAsOperator Update(BoundExpression operand, BoundTypeExpression targetType, BoundValuePlaceholder? operandPlaceholder, BoundExpression? operandConversion, TypeSymbol type) 2951public 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) 2969public BoundExpression Operand { get; } 2981public BoundConversion Update(BoundExpression operand, Conversion conversion, bool isBaseConversion, bool @checked, bool explicitCastInCode, ConstantValue? constantValueOpt, ConversionGroup? conversionGroupOpt, ImmutableArray<MethodSymbol> originalUserDefinedConversionsOpt, TypeSymbol type) 2995public BoundReadOnlySpanFromArray(SyntaxNode syntax, BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type, bool hasErrors = false) 3008public BoundExpression Operand { get; } 3014public BoundReadOnlySpanFromArray Update(BoundExpression operand, MethodSymbol conversionMethod, TypeSymbol type) 3063public BoundArgListOperator(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, TypeSymbol? type, bool hasErrors = false) 3074public ImmutableArray<BoundExpression> Arguments { get; } 3080public BoundArgListOperator Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt, TypeSymbol? type) 3094public BoundFixedLocalCollectionInitializer(SyntaxNode syntax, TypeSymbol elementPointerType, BoundValuePlaceholder? elementPointerPlaceholder, BoundExpression? elementPointerConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type, bool hasErrors = false) 3112public BoundExpression? ElementPointerConversion { get; } 3113public BoundExpression Expression { get; } 3119public BoundFixedLocalCollectionInitializer Update(TypeSymbol elementPointerType, BoundValuePlaceholder? elementPointerPlaceholder, BoundExpression? elementPointerConversion, BoundExpression expression, MethodSymbol? getPinnableOpt, TypeSymbol type) 3400public BoundLocalDeclaration(SyntaxNode syntax, LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType, bool hasErrors = false) 3415public BoundExpression? InitializerOpt { get; } 3416public ImmutableArray<BoundExpression> ArgumentsOpt { get; } 3422public BoundLocalDeclaration Update(LocalSymbol localSymbol, BoundTypeExpression? declaredTypeOpt, BoundExpression? initializerOpt, ImmutableArray<BoundExpression> argumentsOpt, bool inferredType) 3569public BoundReturnStatement(SyntaxNode syntax, RefKind refKind, BoundExpression? expressionOpt, bool @checked, bool hasErrors = false) 3578public BoundExpression? ExpressionOpt { get; } 3584public BoundReturnStatement Update(RefKind refKind, BoundExpression? expressionOpt, bool @checked) 3598public BoundYieldReturnStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false) 3607public BoundExpression Expression { get; } 3612public BoundYieldReturnStatement Update(BoundExpression expression) 3643public BoundThrowStatement(SyntaxNode syntax, BoundExpression? expressionOpt, bool hasErrors = false) 3649public BoundExpression? ExpressionOpt { get; } 3654public BoundThrowStatement Update(BoundExpression? expressionOpt) 3668public BoundExpressionStatement(SyntaxNode syntax, BoundExpression expression, bool hasErrors = false) 3677public BoundExpression Expression { get; } 3682public BoundExpressionStatement Update(BoundExpression expression) 3770public BoundSwitchStatement(SyntaxNode syntax, BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<LocalFunctionSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel, bool hasErrors = false) 3790public BoundExpression Expression { get; } 3801public BoundSwitchStatement Update(BoundExpression expression, ImmutableArray<LocalSymbol> innerLocals, ImmutableArray<LocalFunctionSymbol> innerLocalFunctions, ImmutableArray<BoundSwitchSection> switchSections, BoundDecisionDag reachabilityDecisionDag, BoundSwitchLabel? defaultLabel, GeneratedLabelSymbol breakLabel) 3815public BoundSwitchDispatch(SyntaxNode syntax, BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt, bool hasErrors = false) 3829public BoundExpression Expression { get; } 3837public BoundSwitchDispatch Update(BoundExpression expression, ImmutableArray<(ConstantValue value, LabelSymbol label)> cases, LabelSymbol defaultLabel, LengthBasedStringSwitchData? lengthBasedStringSwitchDataOpt) 3851public BoundIfStatement(SyntaxNode syntax, BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt, bool hasErrors = false) 3863public BoundExpression Condition { get; } 3870public BoundIfStatement Update(BoundExpression condition, BoundStatement consequence, BoundStatement? alternativeOpt) 3912protected BoundConditionalLoopStatement(BoundKind kind, SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3928public BoundExpression Condition { get; } 3934public BoundDoStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3950public BoundDoStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 3964public BoundWhileStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 3980public BoundWhileStatement Update(ImmutableArray<LocalSymbol> locals, BoundExpression condition, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 3994public BoundForStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel, bool hasErrors = false) 4015public BoundExpression? Condition { get; } 4022public BoundForStatement Update(ImmutableArray<LocalSymbol> outerLocals, BoundStatement? initializer, ImmutableArray<LocalSymbol> innerLocals, BoundExpression? condition, BoundStatement? increment, BoundStatement body, GeneratedLabelSymbol breakLabel, GeneratedLabelSymbol continueLabel) 4036public 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) 4061public BoundExpression? ElementConversion { get; } 4064public BoundExpression? IterationErrorExpressionOpt { get; } 4065public BoundExpression Expression { get; } 4073public 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) 4118public BoundUsingStatement(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt, bool hasErrors = false) 4135public BoundExpression? ExpressionOpt { get; } 4143public BoundUsingStatement Update(ImmutableArray<LocalSymbol> locals, BoundMultipleLocalDeclarations? declarationsOpt, BoundExpression? expressionOpt, BoundStatement body, BoundAwaitableInfo? awaitOpt, MethodArgumentInfo? patternDisposeInfoOpt) 4191public BoundLockStatement(SyntaxNode syntax, BoundExpression argument, BoundStatement body, bool hasErrors = false) 4202public BoundExpression Argument { get; } 4208public BoundLockStatement Update(BoundExpression argument, BoundStatement body) 4259public BoundCatchBlock(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll, bool hasErrors = false) 4276public BoundExpression? ExceptionSourceOpt { get; } 4279public BoundExpression? ExceptionFilterOpt { get; } 4286public BoundCatchBlock Update(ImmutableArray<LocalSymbol> locals, BoundExpression? exceptionSourceOpt, TypeSymbol? exceptionTypeOpt, BoundStatementList? exceptionFilterPrologueOpt, BoundExpression? exceptionFilterOpt, BoundBlock body, bool isSynthesizedAsyncCatchAll) 4599public BoundRangeVariable(SyntaxNode syntax, RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type, bool hasErrors = false) 4613public BoundExpression Value { get; } 4618public BoundRangeVariable Update(RangeVariableSymbol rangeVariableSymbol, BoundExpression value, TypeSymbol type) 4709public BoundGotoStatement(SyntaxNode syntax, LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt, bool hasErrors = false) 4721public BoundExpression? CaseExpressionOpt { get; } 4727public BoundGotoStatement Update(LabelSymbol label, BoundExpression? caseExpressionOpt, BoundLabel? labelExpressionOpt) 4846public BoundConditionalGoto(SyntaxNode syntax, BoundExpression condition, bool jumpIfTrue, LabelSymbol label, bool hasErrors = false) 4858public BoundExpression Condition { get; } 4865public BoundConditionalGoto Update(BoundExpression condition, bool jumpIfTrue, LabelSymbol label) 4879protected BoundSwitchExpression(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4894public BoundExpression Expression { get; } 4903public BoundSwitchExpressionArm(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label, bool hasErrors = false) 4921public BoundExpression? WhenClause { get; } 4922public BoundExpression Value { get; } 4928public BoundSwitchExpressionArm Update(ImmutableArray<LocalSymbol> locals, BoundPattern pattern, BoundExpression? whenClause, BoundExpression value, LabelSymbol label) 4942public BoundUnconvertedSwitchExpression(SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type, bool hasErrors = false) 4956public BoundUnconvertedSwitchExpression Update(BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol? type) 4970public BoundConvertedSwitchExpression(SyntaxNode syntax, TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type, bool hasErrors = false) 4990public BoundConvertedSwitchExpression Update(TypeSymbol? naturalTypeOpt, bool wasTargetTyped, BoundExpression expression, ImmutableArray<BoundSwitchExpressionArm> switchArms, BoundDecisionDag reachabilityDecisionDag, LabelSymbol? defaultLabel, bool reportedNotExhaustive, TypeSymbol type) 5111public BoundWhenDecisionDagNode(SyntaxNode syntax, ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse, bool hasErrors = false) 5125public BoundExpression? WhenExpression { get; } 5132public BoundWhenDecisionDagNode Update(ImmutableArray<BoundPatternBinding> bindings, BoundExpression? whenExpression, BoundDecisionDagNode whenTrue, BoundDecisionDagNode? whenFalse) 5533public BoundDagIndexerEvaluation(SyntaxNode syntax, TypeSymbol indexerType, BoundDagTemp lengthTemp, int index, BoundExpression indexerAccess, BoundListPatternReceiverPlaceholder receiverPlaceholder, BoundListPatternIndexPlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false) 5559public BoundExpression IndexerAccess { get; } 5566public BoundDagIndexerEvaluation Update(TypeSymbol indexerType, BoundDagTemp lengthTemp, int index, BoundExpression indexerAccess, BoundListPatternReceiverPlaceholder receiverPlaceholder, BoundListPatternIndexPlaceholder argumentPlaceholder, BoundDagTemp input) 5580public BoundDagSliceEvaluation(SyntaxNode syntax, TypeSymbol sliceType, BoundDagTemp lengthTemp, int startIndex, int endIndex, BoundExpression indexerAccess, BoundSlicePatternReceiverPlaceholder receiverPlaceholder, BoundSlicePatternRangePlaceholder argumentPlaceholder, BoundDagTemp input, bool hasErrors = false) 5608public BoundExpression IndexerAccess { get; } 5615public BoundDagSliceEvaluation Update(TypeSymbol sliceType, BoundDagTemp lengthTemp, int startIndex, int endIndex, BoundExpression indexerAccess, BoundSlicePatternReceiverPlaceholder receiverPlaceholder, BoundSlicePatternRangePlaceholder argumentPlaceholder, BoundDagTemp input) 5690public BoundSwitchLabel(SyntaxNode syntax, LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause, bool hasErrors = false) 5704public BoundExpression? WhenClause { get; } 5709public BoundSwitchLabel Update(LabelSymbol label, BoundPattern pattern, BoundExpression? whenClause) 5723protected BoundMethodOrPropertyGroup(BoundKind kind, SyntaxNode syntax, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 5731public BoundExpression? ReceiverOpt { get; } 5737public BoundSequencePointExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false) 5746public BoundExpression Expression { get; } 5751public BoundSequencePointExpression Update(BoundExpression expression, TypeSymbol? type) 5765public BoundSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false) 5781public ImmutableArray<BoundExpression> SideEffects { get; } 5782public BoundExpression Value { get; } 5787public BoundSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundExpression> sideEffects, BoundExpression value, TypeSymbol type) 5801public BoundSpillSequence(SyntaxNode syntax, ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type, bool hasErrors = false) 5818public BoundExpression Value { get; } 5823public BoundSpillSequence Update(ImmutableArray<LocalSymbol> locals, ImmutableArray<BoundStatement> sideEffects, BoundExpression value, TypeSymbol type) 5837public BoundDynamicMemberAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type, bool hasErrors = false) 5853public BoundExpression Receiver { get; } 5862public BoundDynamicMemberAccess Update(BoundExpression receiver, ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, bool invoked, bool indexed, TypeSymbol type) 5876protected BoundDynamicInvocableBase(BoundKind kind, SyntaxNode syntax, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol? type, bool hasErrors = false) 5887public BoundExpression Expression { get; } 5888public ImmutableArray<BoundExpression> Arguments { get; } 5893public BoundDynamicInvocation(SyntaxNode syntax, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false) 5915public BoundDynamicInvocation Update(ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type) 5929public BoundConditionalAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type, bool hasErrors = false) 5942public BoundExpression Receiver { get; } 5943public BoundExpression AccessExpression { get; } 5948public BoundConditionalAccess Update(BoundExpression receiver, BoundExpression accessExpression, TypeSymbol type) 5962public BoundLoweredConditionalAccess(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, bool forceCopyOfNullableValueType, TypeSymbol type, bool hasErrors = false) 5979public BoundExpression Receiver { get; } 5981public BoundExpression WhenNotNull { get; } 5982public BoundExpression? WhenNullOpt { get; } 5989public BoundLoweredConditionalAccess Update(BoundExpression receiver, MethodSymbol? hasValueMethodOpt, BoundExpression whenNotNull, BoundExpression? whenNullOpt, int id, bool forceCopyOfNullableValueType, TypeSymbol type) 6041public BoundComplexConditionalReceiver(SyntaxNode syntax, BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type, bool hasErrors = false) 6054public BoundExpression ValueTypeReceiver { get; } 6055public BoundExpression ReferenceTypeReceiver { get; } 6060public BoundComplexConditionalReceiver Update(BoundExpression valueTypeReceiver, BoundExpression referenceTypeReceiver, TypeSymbol type) 6074public 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) 6101public BoundMethodGroup Update(ImmutableArray<TypeWithAnnotations> typeArgumentsOpt, string name, ImmutableArray<MethodSymbol> methods, Symbol? lookupSymbolOpt, DiagnosticInfo? lookupError, BoundMethodGroupFlags? flags, FunctionTypeSymbol? functionType, BoundExpression? receiverOpt, LookupResultKind resultKind) 6115public BoundPropertyGroup(SyntaxNode syntax, ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind, bool hasErrors = false) 6129public BoundPropertyGroup Update(ImmutableArray<PropertySymbol> properties, BoundExpression? receiverOpt, LookupResultKind resultKind) 6143public 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) 6167public BoundExpression? ReceiverOpt { get; } 6170public ImmutableArray<BoundExpression> Arguments { get; } 6184public 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) 6198public BoundEventAssignmentOperator(SyntaxNode syntax, EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type, bool hasErrors = false) 6217public BoundExpression? ReceiverOpt { get; } 6218public BoundExpression Argument { get; } 6223public BoundEventAssignmentOperator Update(EventSymbol @event, bool isAddition, bool isDynamic, BoundExpression? receiverOpt, BoundExpression argument, TypeSymbol type) 6237public 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) 6257public ImmutableArray<BoundExpression> ConstructorArguments { get; } 6268public BoundAttribute Update(MethodSymbol? constructor, ImmutableArray<BoundExpression> constructorArguments, ImmutableArray<string?> constructorArgumentNamesOpt, ImmutableArray<int> constructorArgumentsToParamsOpt, bool constructorExpanded, BitVector constructorDefaultArguments, ImmutableArray<BoundAssignmentOperator> namedArguments, LookupResultKind resultKind, TypeSymbol type) 6282public BoundUnconvertedObjectCreationExpression(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder, bool hasErrors = false) 6297public ImmutableArray<BoundExpression> Arguments { get; } 6306public BoundUnconvertedObjectCreationExpression Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<(string Name, Location Location)?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, InitializerExpressionSyntax? initializerOpt, Binder binder) 6341public 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) 6365public override ImmutableArray<BoundExpression> Arguments { get; } 6378public 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) 6433public 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) 6454public BoundExpression? CollectionCreation { get; } 6457public BoundExpression? CollectionBuilderInvocationConversion { get; } 6464public BoundCollectionExpression Update(CollectionExpressionTypeKind collectionTypeKind, BoundObjectOrCollectionValuePlaceholder? placeholder, BoundExpression? collectionCreation, MethodSymbol? collectionBuilderMethod, BoundValuePlaceholder? collectionBuilderInvocationPlaceholder, BoundExpression? collectionBuilderInvocationConversion, bool wasTargetTyped, BoundUnconvertedCollectionExpression unconvertedCollectionExpression, ImmutableArray<BoundNode> elements, TypeSymbol type) 6506public BoundCollectionExpressionSpreadElement(SyntaxNode syntax, BoundExpression expression, BoundCollectionExpressionSpreadExpressionPlaceholder? expressionPlaceholder, BoundExpression? conversion, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundExpression? lengthOrCount, BoundValuePlaceholder? elementPlaceholder, BoundStatement? iteratorBody, bool hasErrors = false) 6521public BoundExpression Expression { get; } 6523public BoundExpression? Conversion { get; } 6525public BoundExpression? LengthOrCount { get; } 6532public BoundCollectionExpressionSpreadElement Update(BoundExpression expression, BoundCollectionExpressionSpreadExpressionPlaceholder? expressionPlaceholder, BoundExpression? conversion, ForEachEnumeratorInfo? enumeratorInfoOpt, BoundExpression? lengthOrCount, BoundValuePlaceholder? elementPlaceholder, BoundStatement? iteratorBody) 6546protected BoundTupleExpression(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false) 6557public ImmutableArray<BoundExpression> Arguments { get; } 6564public BoundTupleLiteral(SyntaxNode syntax, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false) 6577public BoundTupleLiteral Update(ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type) 6591public BoundConvertedTupleLiteral(SyntaxNode syntax, BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type, bool hasErrors = false) 6607public BoundConvertedTupleLiteral Update(BoundTupleLiteral? sourceTuple, bool wasTargetTyped, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<bool> inferredNamesOpt, TypeSymbol? type) 6621public 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) 6640public override ImmutableArray<BoundExpression> Arguments { get; } 6650public BoundDynamicObjectCreationExpression Update(string name, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, BoundObjectInitializerExpressionBase? initializerExpressionOpt, ImmutableArray<MethodSymbol> applicableMethods, bool wasTargetTyped, TypeSymbol type) 6696protected BoundObjectInitializerExpressionBase(BoundKind kind, SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false) 6710public ImmutableArray<BoundExpression> Initializers { get; } 6715public BoundObjectInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false) 6729public BoundObjectInitializerExpression Update(BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type) 6743public 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) 6765public ImmutableArray<BoundExpression> Arguments { get; } 6778public 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) 6837public BoundCollectionInitializerExpression(SyntaxNode syntax, BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type, bool hasErrors = false) 6851public BoundCollectionInitializerExpression Update(BoundObjectOrCollectionValuePlaceholder placeholder, ImmutableArray<BoundExpression> initializers, TypeSymbol type) 6865public 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) 6885public ImmutableArray<BoundExpression> Arguments { get; } 6886public BoundExpression? ImplicitReceiverOpt { get; } 6896public BoundCollectionElementInitializer Update(MethodSymbol addMethod, ImmutableArray<BoundExpression> arguments, BoundExpression? implicitReceiverOpt, bool expanded, ImmutableArray<int> argsToParamsOpt, BitVector defaultArguments, bool invokedAsExtensionMethod, LookupResultKind resultKind, TypeSymbol type) 6910public BoundDynamicCollectionElementInitializer(SyntaxNode syntax, ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type, bool hasErrors = false) 6928public BoundDynamicCollectionElementInitializer Update(ImmutableArray<MethodSymbol> applicableMethods, BoundExpression expression, ImmutableArray<BoundExpression> arguments, TypeSymbol type) 6977public BoundAnonymousObjectCreationExpression(SyntaxNode syntax, MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<BoundAnonymousPropertyDeclaration> declarations, TypeSymbol type, bool hasErrors = false) 6993public ImmutableArray<BoundExpression> Arguments { get; } 6999public BoundAnonymousObjectCreationExpression Update(MethodSymbol constructor, ImmutableArray<BoundExpression> arguments, ImmutableArray<BoundAnonymousPropertyDeclaration> declarations, TypeSymbol type) 7083public BoundDelegateCreationExpression(SyntaxNode syntax, BoundExpression argument, MethodSymbol? methodOpt, bool isExtensionMethod, bool wasTargetTyped, TypeSymbol type, bool hasErrors = false) 7097public BoundExpression Argument { get; } 7105public BoundDelegateCreationExpression Update(BoundExpression argument, MethodSymbol? methodOpt, bool isExtensionMethod, bool wasTargetTyped, TypeSymbol type) 7119public BoundArrayCreation(SyntaxNode syntax, ImmutableArray<BoundExpression> bounds, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false) 7131public ImmutableArray<BoundExpression> Bounds { get; } 7137public BoundArrayCreation Update(ImmutableArray<BoundExpression> bounds, BoundArrayInitialization? initializerOpt, TypeSymbol type) 7151public BoundArrayInitialization(SyntaxNode syntax, bool isInferred, ImmutableArray<BoundExpression> initializers, bool hasErrors = false) 7163public ImmutableArray<BoundExpression> Initializers { get; } 7168public BoundArrayInitialization Update(bool isInferred, ImmutableArray<BoundExpression> initializers) 7182protected BoundStackAllocArrayCreationBase(BoundKind kind, SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false) 7195public BoundExpression Count { get; } 7201public BoundStackAllocArrayCreation(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type, bool hasErrors = false) 7214public BoundStackAllocArrayCreation Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol? type) 7228public BoundConvertedStackAllocExpression(SyntaxNode syntax, TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol type, bool hasErrors = false) 7243public BoundConvertedStackAllocExpression Update(TypeSymbol elementType, BoundExpression count, BoundArrayInitialization? initializerOpt, TypeSymbol type) 7257public BoundFieldAccess(SyntaxNode syntax, BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type, bool hasErrors = false) 7273public BoundExpression? ReceiverOpt { get; } 7283public BoundFieldAccess Update(BoundExpression? receiverOpt, FieldSymbol fieldSymbol, ConstantValue? constantValueOpt, LookupResultKind resultKind, bool isByValue, bool isDeclaration, TypeSymbol type) 7337public BoundPropertyAccess(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 7352public BoundExpression? ReceiverOpt { get; } 7361public BoundPropertyAccess Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, PropertySymbol propertySymbol, AccessorKind autoPropertyAccessorKind, LookupResultKind resultKind, TypeSymbol type) 7375public BoundEventAccess(SyntaxNode syntax, BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type, bool hasErrors = false) 7389public BoundExpression? ReceiverOpt { get; } 7397public BoundEventAccess Update(BoundExpression? receiverOpt, EventSymbol eventSymbol, bool isUsableAsField, LookupResultKind resultKind, TypeSymbol type) 7411public 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) 7433public BoundExpression? ReceiverOpt { get; } 7436public ImmutableArray<BoundExpression> Arguments { get; } 7448public 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) 7462public BoundImplicitIndexerAccess(SyntaxNode syntax, BoundExpression receiver, BoundExpression argument, BoundExpression lengthOrCountAccess, BoundImplicitIndexerReceiverPlaceholder receiverPlaceholder, BoundExpression indexerOrSliceAccess, ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders, TypeSymbol type, bool hasErrors = false) 7487public BoundExpression Receiver { get; } 7488public BoundExpression Argument { get; } 7489public BoundExpression LengthOrCountAccess { get; } 7491public BoundExpression IndexerOrSliceAccess { get; } 7497public BoundImplicitIndexerAccess Update(BoundExpression receiver, BoundExpression argument, BoundExpression lengthOrCountAccess, BoundImplicitIndexerReceiverPlaceholder receiverPlaceholder, BoundExpression indexerOrSliceAccess, ImmutableArray<BoundImplicitIndexerValuePlaceholder> argumentPlaceholders, TypeSymbol type) 7511public BoundInlineArrayAccess(SyntaxNode syntax, BoundExpression expression, BoundExpression argument, bool isValue, WellKnownMember getItemOrSliceHelper, TypeSymbol type, bool hasErrors = false) 7530public BoundExpression Expression { get; } 7531public BoundExpression Argument { get; } 7538public BoundInlineArrayAccess Update(BoundExpression expression, BoundExpression argument, bool isValue, WellKnownMember getItemOrSliceHelper, TypeSymbol type) 7552public BoundDynamicIndexerAccess(SyntaxNode syntax, BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type, bool hasErrors = false) 7569public BoundExpression Receiver { get; } 7570public ImmutableArray<BoundExpression> Arguments { get; } 7578public BoundDynamicIndexerAccess Update(BoundExpression receiver, ImmutableArray<BoundExpression> arguments, ImmutableArray<string?> argumentNamesOpt, ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<PropertySymbol> applicableIndexers, TypeSymbol type) 7676public BoundQueryClause(SyntaxNode syntax, BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type, bool hasErrors = false) 7693public BoundExpression Value { get; } 7695public BoundExpression? Operation { get; } 7696public BoundExpression? Cast { get; } 7698public BoundExpression? UnoptimizedForm { get; } 7703public BoundQueryClause Update(BoundExpression value, RangeVariableSymbol? definedSymbol, BoundExpression? operation, BoundExpression? cast, Binder binder, BoundExpression? unoptimizedForm, TypeSymbol type) 7743public BoundNameOfOperator(SyntaxNode syntax, BoundExpression argument, ConstantValue constantValueOpt, TypeSymbol type, bool hasErrors = false) 7756public BoundExpression Argument { get; } 7762public BoundNameOfOperator Update(BoundExpression argument, ConstantValue constantValueOpt, TypeSymbol type) 7776protected BoundInterpolatedStringBase(BoundKind kind, SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false) 7786public ImmutableArray<BoundExpression> Parts { get; } 7792public BoundUnconvertedInterpolatedString(SyntaxNode syntax, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false) 7804public BoundUnconvertedInterpolatedString Update(ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type) 7818public BoundInterpolatedString(SyntaxNode syntax, InterpolatedStringHandlerData? interpolationData, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type, bool hasErrors = false) 7832public BoundInterpolatedString Update(InterpolatedStringHandlerData? interpolationData, ImmutableArray<BoundExpression> parts, ConstantValue? constantValueOpt, TypeSymbol? type) 7912public BoundStringInsert(SyntaxNode syntax, BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall, bool hasErrors = false) 7925public BoundExpression Value { get; } 7926public BoundExpression? Alignment { get; } 7933public BoundStringInsert Update(BoundExpression value, BoundExpression? alignment, BoundLiteral? format, bool isInterpolatedStringHandlerAppendCall) 7947public BoundIsPatternExpression(SyntaxNode syntax, BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type, bool hasErrors = false) 7965public BoundExpression Expression { get; } 7975public BoundIsPatternExpression Update(BoundExpression expression, BoundPattern pattern, bool isNegated, BoundDecisionDag reachabilityDecisionDag, LabelSymbol whenTrueLabel, LabelSymbol whenFalseLabel, TypeSymbol? type) 8017public BoundConstantPattern(SyntaxNode syntax, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8030public BoundExpression Value { get; } 8036public BoundConstantPattern Update(BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType) 8086protected BoundObjectPattern(BoundKind kind, SyntaxNode syntax, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8098public BoundExpression? VariableAccess { get; } 8103public BoundDeclarationPattern(SyntaxNode syntax, BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8121public BoundDeclarationPattern Update(BoundTypeExpression declaredType, bool isVar, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8135public 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) 8158public BoundRecursivePattern Update(BoundTypeExpression? declaredType, MethodSymbol? deconstructMethod, ImmutableArray<BoundPositionalSubpattern> deconstruction, ImmutableArray<BoundPropertySubpattern> properties, bool isExplicitNotNullTest, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8172public 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) 8194public BoundExpression? LengthAccess { get; } 8195public BoundExpression? IndexerAccess { get; } 8202public BoundListPattern Update(ImmutableArray<BoundPattern> subpatterns, bool hasSlice, BoundExpression? lengthAccess, BoundExpression? indexerAccess, BoundListPatternReceiverPlaceholder? receiverPlaceholder, BoundListPatternIndexPlaceholder? argumentPlaceholder, Symbol? variable, BoundExpression? variableAccess, TypeSymbol inputType, TypeSymbol narrowedType) 8216public BoundSlicePattern(SyntaxNode syntax, BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8234public BoundExpression? IndexerAccess { get; } 8241public BoundSlicePattern Update(BoundPattern? pattern, BoundExpression? indexerAccess, BoundSlicePatternReceiverPlaceholder? receiverPlaceholder, BoundSlicePatternRangePlaceholder? argumentPlaceholder, TypeSymbol inputType, TypeSymbol narrowedType) 8492public BoundRelationalPattern(SyntaxNode syntax, BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType, bool hasErrors = false) 8507public BoundExpression Value { get; } 8513public BoundRelationalPattern Update(BinaryOperatorKind relation, BoundExpression value, ConstantValue constantValue, TypeSymbol inputType, TypeSymbol narrowedType) 8562public BoundThrowExpression(SyntaxNode syntax, BoundExpression expression, TypeSymbol? type, bool hasErrors = false) 8571public BoundExpression Expression { get; } 8576public BoundThrowExpression Update(BoundExpression expression, TypeSymbol? type) 8590protected VariablePendingInference(BoundKind kind, SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8602public BoundExpression? ReceiverOpt { get; } 8607public OutVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8619public OutVariablePendingInference Update(Symbol variableSymbol, BoundExpression? receiverOpt) 8633public DeconstructionVariablePendingInference(SyntaxNode syntax, Symbol variableSymbol, BoundExpression? receiverOpt, bool hasErrors = false) 8645public DeconstructionVariablePendingInference Update(Symbol variableSymbol, BoundExpression? receiverOpt) 8760public BoundExpressionWithNullability(SyntaxNode syntax, BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type, bool hasErrors = false) 8770public BoundExpression Expression { get; } 8777public BoundExpressionWithNullability Update(BoundExpression expression, NullableAnnotation nullableAnnotation, TypeSymbol? type) 8791public BoundWithExpression(SyntaxNode syntax, BoundExpression receiver, MethodSymbol? cloneMethod, BoundObjectInitializerExpressionBase initializerExpression, TypeSymbol type, bool hasErrors = false) 8805public BoundExpression Receiver { get; } 8812public BoundWithExpression Update(BoundExpression receiver, MethodSymbol? cloneMethod, BoundObjectInitializerExpressionBase initializerExpression, TypeSymbol type) 10801BoundExpression value = (BoundExpression)this.Visit(node.Value); 10806BoundExpression value = (BoundExpression)this.Visit(node.Value); 10811BoundExpression value = (BoundExpression)this.Visit(node.Value); 10826BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 10892BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 10898ImmutableArray<BoundExpression> childBoundNodes = this.VisitList(node.ChildBoundNodes); 10915ImmutableArray<BoundExpression> boundDimensionsOpt = this.VisitList(node.BoundDimensionsOpt); 10931BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 10938BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 10940BoundExpression? operandConversion = node.OperandConversion; 10942BoundExpression? resultConversion = node.ResultConversion; 10949BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 10967BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 10973BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 10974BoundExpression index = (BoundExpression)this.Visit(node.Index); 10980BoundExpression invokedExpression = (BoundExpression)this.Visit(node.InvokedExpression); 10981ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 10987BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 10993BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 10999BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 11005BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 11011BoundExpression? leftOperandOpt = (BoundExpression?)this.Visit(node.LeftOperandOpt); 11012BoundExpression? rightOperandOpt = (BoundExpression?)this.Visit(node.RightOperandOpt); 11018BoundExpression left = (BoundExpression)this.Visit(node.Left); 11019BoundExpression right = (BoundExpression)this.Visit(node.Right); 11025BoundExpression left = (BoundExpression)this.Visit(node.Left); 11026BoundExpression right = (BoundExpression)this.Visit(node.Right); 11032BoundExpression left = (BoundExpression)this.Visit(node.Left); 11033BoundExpression right = (BoundExpression)this.Visit(node.Right); 11040BoundExpression left = (BoundExpression)this.Visit(node.Left); 11041BoundExpression right = (BoundExpression)this.Visit(node.Right); 11043BoundExpression? leftConversion = node.LeftConversion; 11045BoundExpression? finalConversion = node.FinalConversion; 11051BoundExpression left = (BoundExpression)this.Visit(node.Left); 11052BoundExpression right = (BoundExpression)this.Visit(node.Right); 11065BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand); 11066BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand); 11068BoundExpression? leftConversion = node.LeftConversion; 11074BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand); 11075BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand); 11081BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 11082BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence); 11083BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative); 11089BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 11090BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence); 11091BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative); 11098BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11099ImmutableArray<BoundExpression> indices = this.VisitList(node.Indices); 11111BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11118BoundExpression? getAwaiter = (BoundExpression?)this.Visit(node.GetAwaiter); 11123BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11218BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 11225BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 11228BoundExpression? operandConversion = node.OperandConversion; 11240BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 11246BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 11257ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11264BoundExpression? elementPointerConversion = node.ElementPointerConversion; 11265BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11302BoundExpression? initializerOpt = (BoundExpression?)this.Visit(node.InitializerOpt); 11303ImmutableArray<BoundExpression> argumentsOpt = this.VisitList(node.ArgumentsOpt); 11326BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt); 11331BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11337BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt); 11342BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11349BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11357BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11362BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 11369BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 11375BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 11382BoundExpression? condition = (BoundExpression?)this.Visit(node.Condition); 11390BoundExpression? elementConversion = node.ElementConversion; 11392BoundExpression? iterationErrorExpressionOpt = (BoundExpression?)this.Visit(node.IterationErrorExpressionOpt); 11393BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11408BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt); 11421BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 11434BoundExpression? exceptionSourceOpt = (BoundExpression?)this.Visit(node.ExceptionSourceOpt); 11436BoundExpression? exceptionFilterOpt = (BoundExpression?)this.Visit(node.ExceptionFilterOpt); 11483BoundExpression value = (BoundExpression)this.Visit(node.Value); 11495BoundExpression? caseExpressionOpt = (BoundExpression?)this.Visit(node.CaseExpressionOpt); 11516BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 11522BoundExpression? whenClause = (BoundExpression?)this.Visit(node.WhenClause); 11523BoundExpression value = (BoundExpression)this.Visit(node.Value); 11528BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11536BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11563BoundExpression? whenExpression = (BoundExpression?)this.Visit(node.WhenExpression); 11630BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess); 11640BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess); 11662BoundExpression? whenClause = (BoundExpression?)this.Visit(node.WhenClause); 11667BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11673ImmutableArray<BoundExpression> sideEffects = this.VisitList(node.SideEffects); 11674BoundExpression value = (BoundExpression)this.Visit(node.Value); 11681BoundExpression value = (BoundExpression)this.Visit(node.Value); 11687BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 11693BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11694ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11700BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 11701BoundExpression accessExpression = (BoundExpression)this.Visit(node.AccessExpression); 11707BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 11708BoundExpression whenNotNull = (BoundExpression)this.Visit(node.WhenNotNull); 11709BoundExpression? whenNullOpt = (BoundExpression?)this.Visit(node.WhenNullOpt); 11720BoundExpression valueTypeReceiver = (BoundExpression)this.Visit(node.ValueTypeReceiver); 11721BoundExpression referenceTypeReceiver = (BoundExpression)this.Visit(node.ReferenceTypeReceiver); 11727BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11733BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11739BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11740ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11746BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11747BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 11753ImmutableArray<BoundExpression> constructorArguments = this.VisitList(node.ConstructorArguments); 11760ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11766ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11780BoundExpression? collectionCreation = node.CollectionCreation; 11782BoundExpression? collectionBuilderInvocationConversion = node.CollectionBuilderInvocationConversion; 11795BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11797BoundExpression? conversion = node.Conversion; 11798BoundExpression? lengthOrCount = node.LengthOrCount; 11805ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11812ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11818ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11832ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers); 11838ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11852ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers); 11858ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11859BoundExpression? implicitReceiverOpt = (BoundExpression?)this.Visit(node.ImplicitReceiverOpt); 11865BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11866ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11877ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11895BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 11901ImmutableArray<BoundExpression> bounds = this.VisitList(node.Bounds); 11908ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers); 11914BoundExpression count = (BoundExpression)this.Visit(node.Count); 11922BoundExpression count = (BoundExpression)this.Visit(node.Count); 11930BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11941BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11947BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11953BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 11954ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11960BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 11961BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 11962BoundExpression lengthOrCountAccess = node.LengthOrCountAccess; 11964BoundExpression indexerOrSliceAccess = node.IndexerOrSliceAccess; 11971BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 11972BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 11978BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 11979ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 11997BoundExpression value = (BoundExpression)this.Visit(node.Value); 11998BoundExpression? operation = node.Operation; 11999BoundExpression? cast = node.Cast; 12000BoundExpression? unoptimizedForm = node.UnoptimizedForm; 12011BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 12017ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts); 12023ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts); 12039BoundExpression value = (BoundExpression)this.Visit(node.Value); 12040BoundExpression? alignment = (BoundExpression?)this.Visit(node.Alignment); 12047BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 12055BoundExpression value = (BoundExpression)this.Visit(node.Value); 12069BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess); 12079BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess); 12087BoundExpression? lengthAccess = node.LengthAccess; 12088BoundExpression? indexerAccess = node.IndexerAccess; 12091BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess); 12099BoundExpression? indexerAccess = node.IndexerAccess; 12154BoundExpression value = (BoundExpression)this.Visit(node.Value); 12166BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 12172BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 12178BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 12202BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 12208BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 12217private readonly ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> _updatedNullabilities; 12221public NullabilityRewriter(ImmutableDictionary<BoundExpression, (NullabilityInfo Info, TypeSymbol? Type)> updatedNullabilities, NullableWalker.SnapshotManager? snapshotManager, ImmutableDictionary<Symbol, Symbol>.Builder remappedSymbols) 12232BoundExpression value = (BoundExpression)this.Visit(node.Value); 12240BoundExpression value = (BoundExpression)this.Visit(node.Value); 12248BoundExpression value = (BoundExpression)this.Visit(node.Value); 12266BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 12432BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 12450ImmutableArray<BoundExpression> childBoundNodes = this.VisitList(node.ChildBoundNodes); 12468ImmutableArray<BoundExpression> boundDimensionsOpt = this.VisitList(node.BoundDimensionsOpt); 12512BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12532BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12534BoundExpression? operandConversion = node.OperandConversion; 12536BoundExpression? resultConversion = node.ResultConversion; 12553BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12605BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12622BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 12623BoundExpression index = (BoundExpression)this.Visit(node.Index); 12640BoundExpression invokedExpression = (BoundExpression)this.Visit(node.InvokedExpression); 12641ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 12659BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12676BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12693BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12711BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 12729BoundExpression? leftOperandOpt = (BoundExpression?)this.Visit(node.LeftOperandOpt); 12730BoundExpression? rightOperandOpt = (BoundExpression?)this.Visit(node.RightOperandOpt); 12747BoundExpression left = (BoundExpression)this.Visit(node.Left); 12748BoundExpression right = (BoundExpression)this.Visit(node.Right); 12766BoundExpression left = (BoundExpression)this.Visit(node.Left); 12767BoundExpression right = (BoundExpression)this.Visit(node.Right); 12769BoundExpression? leftConversion = node.LeftConversion; 12771BoundExpression? finalConversion = node.FinalConversion; 12788BoundExpression left = (BoundExpression)this.Visit(node.Left); 12789BoundExpression right = (BoundExpression)this.Visit(node.Right); 12824BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand); 12825BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand); 12827BoundExpression? leftConversion = node.LeftConversion; 12844BoundExpression leftOperand = (BoundExpression)this.Visit(node.LeftOperand); 12845BoundExpression rightOperand = (BoundExpression)this.Visit(node.RightOperand); 12862BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 12863BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence); 12864BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative); 12882BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 12883BoundExpression consequence = (BoundExpression)this.Visit(node.Consequence); 12884BoundExpression alternative = (BoundExpression)this.Visit(node.Alternative); 12901BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 12902ImmutableArray<BoundExpression> indices = this.VisitList(node.Indices); 12936BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 12956BoundExpression? getAwaiter = (BoundExpression?)this.Visit(node.GetAwaiter); 12962BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13212BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 13230BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 13233BoundExpression? operandConversion = node.OperandConversion; 13268BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 13286BoundExpression operand = (BoundExpression)this.Visit(node.Operand); 13315ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 13335BoundExpression? elementPointerConversion = node.ElementPointerConversion; 13336BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13378BoundExpression? initializerOpt = (BoundExpression?)this.Visit(node.InitializerOpt); 13379ImmutableArray<BoundExpression> argumentsOpt = this.VisitList(node.ArgumentsOpt); 13395BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13405BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 13413BoundExpression condition = (BoundExpression)this.Visit(node.Condition); 13423BoundExpression? condition = (BoundExpression?)this.Visit(node.Condition); 13433BoundExpression? elementConversion = node.ElementConversion; 13435BoundExpression? iterationErrorExpressionOpt = (BoundExpression?)this.Visit(node.IterationErrorExpressionOpt); 13436BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13447BoundExpression? expressionOpt = (BoundExpression?)this.Visit(node.ExpressionOpt); 13465BoundExpression? exceptionSourceOpt = (BoundExpression?)this.Visit(node.ExceptionSourceOpt); 13467BoundExpression? exceptionFilterOpt = (BoundExpression?)this.Visit(node.ExceptionFilterOpt); 13581BoundExpression value = (BoundExpression)this.Visit(node.Value); 13629BoundExpression? whenClause = (BoundExpression?)this.Visit(node.WhenClause); 13630BoundExpression value = (BoundExpression)this.Visit(node.Value); 13636BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13656BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13705BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess); 13716BoundExpression indexerAccess = (BoundExpression)this.Visit(node.IndexerAccess); 13733BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13751ImmutableArray<BoundExpression> sideEffects = this.VisitList(node.SideEffects); 13752BoundExpression value = (BoundExpression)this.Visit(node.Value); 13771BoundExpression value = (BoundExpression)this.Visit(node.Value); 13788BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 13806BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 13807ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 13824BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 13825BoundExpression accessExpression = (BoundExpression)this.Visit(node.AccessExpression); 13843BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 13844BoundExpression whenNotNull = (BoundExpression)this.Visit(node.WhenNotNull); 13845BoundExpression? whenNullOpt = (BoundExpression?)this.Visit(node.WhenNullOpt); 13874BoundExpression valueTypeReceiver = (BoundExpression)this.Visit(node.ValueTypeReceiver); 13875BoundExpression referenceTypeReceiver = (BoundExpression)this.Visit(node.ReferenceTypeReceiver); 13895BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 13913BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 13932BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 13933ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 13951BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 13952BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 13970ImmutableArray<BoundExpression> constructorArguments = this.VisitList(node.ConstructorArguments); 13988ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14007ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14044BoundExpression? collectionCreation = node.CollectionCreation; 14046BoundExpression? collectionBuilderInvocationConversion = node.CollectionBuilderInvocationConversion; 14077ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14095ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14113ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14149ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers); 14168ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14203ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers); 14221ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14222BoundExpression? implicitReceiverOpt = (BoundExpression?)this.Visit(node.ImplicitReceiverOpt); 14240BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 14241ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14271ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14324BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 14341ImmutableArray<BoundExpression> bounds = this.VisitList(node.Bounds); 14359ImmutableArray<BoundExpression> initializers = this.VisitList(node.Initializers); 14377BoundExpression count = (BoundExpression)this.Visit(node.Count); 14396BoundExpression count = (BoundExpression)this.Visit(node.Count); 14415BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 14450BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 14468BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 14487BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 14488ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14505BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 14506BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 14524BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver); 14525ImmutableArray<BoundExpression> arguments = this.VisitList(node.Arguments); 14579BoundExpression value = (BoundExpression)this.Visit(node.Value); 14580BoundExpression? operation = node.Operation; 14581BoundExpression? cast = node.Cast; 14582BoundExpression? unoptimizedForm = node.UnoptimizedForm; 14599BoundExpression argument = (BoundExpression)this.Visit(node.Argument); 14616ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts); 14633ImmutableArray<BoundExpression> parts = this.VisitList(node.Parts); 14674BoundExpression value = (BoundExpression)this.Visit(node.Value); 14675BoundExpression? alignment = (BoundExpression?)this.Visit(node.Alignment); 14693BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 14714BoundExpression value = (BoundExpression)this.Visit(node.Value); 14731BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess); 14744BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess); 14754BoundExpression? lengthAccess = node.LengthAccess; 14755BoundExpression? indexerAccess = node.IndexerAccess; 14758BoundExpression? variableAccess = (BoundExpression?)this.Visit(node.VariableAccess); 14767BoundExpression? indexerAccess = node.IndexerAccess; 14826BoundExpression value = (BoundExpression)this.Visit(node.Value); 14844BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 14862BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 14880BoundExpression? receiverOpt = (BoundExpression?)this.Visit(node.ReceiverOpt); 14923BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 14941BoundExpression receiver = (BoundExpression)this.Visit(node.Receiver);
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (17)
362BoundExpression caseExpressionOpt = (BoundExpression)this.Visit(node.CaseExpressionOpt); 387var returnExpr = (BoundExpression)(this.Visit(node.ExpressionOpt)); 557var storePending = _F.AssignmentExpression( 575var filterOpt = node.ExceptionFilterOpt; 612var sourceOpt = node.ExceptionSourceOpt; 616prologueBuilder.Add(_F.ExpressionStatement(AssignCatchSource((BoundExpression)this.Visit(sourceOpt), currentAwaitCatchFrame))); 625var rewrittenFilter = (BoundExpression)this.Visit(filterOpt); 645var sourceOpt = node.ExceptionSourceOpt; 648BoundExpression assignSource = AssignCatchSource((BoundExpression)this.Visit(sourceOpt), currentAwaitCatchFrame); 665private BoundExpression AssignCatchSource(BoundExpression rewrittenSource, AwaitCatchFrame currentAwaitCatchFrame) 667BoundExpression assignSource = null; 985BoundExpression valueOpt,
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (3)
150ImmutableArray<BoundExpression>.Empty)); 268var rewrittenExpression = (BoundExpression)Visit(node.Expression);
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (20)
63private readonly Dictionary<BoundValuePlaceholderBase, BoundExpression> _placeholderMap; 96_placeholderMap = new Dictionary<BoundValuePlaceholderBase, BoundExpression>(); 222? ImmutableArray.Create<BoundExpression>(F.Local(_exprRetValue)) 223: ImmutableArray<BoundExpression>.Empty)); 320BoundExpression expr = (BoundExpression)this.Visit(node.Expression); 336private BoundBlock VisitAwaitExpression(BoundAwaitExpression node, BoundExpression resultPlace) 338var expression = (BoundExpression)Visit(node.Expression); 346var getAwaiter = node.AwaitableInfo.IsDynamic ? 348(BoundExpression)Visit(node.AwaitableInfo.GetAwaiter); 350resultPlace = (BoundExpression)Visit(resultPlace); 378BoundExpression getResultCall = MakeCallMaybeDynamic( 400private BoundExpression MakeCallMaybeDynamic( 401BoundExpression receiver, 422loweredArguments: ImmutableArray<BoundExpression>.Empty, 429private BoundExpression GenerateGetIsCompleted(LocalSymbol awaiterTemp, MethodSymbol getIsCompletedMethod) 620BoundExpression result = 630ImmutableArray.Create<BoundExpression>(F.AssignmentExpression(F.Local(thisTemp), F.This())), 648F.Assignment(F.Local(_exprRetValue), (BoundExpression)Visit(node.ExpressionOpt)),
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (5)
171var managedThreadId = MakeCurrentThreadId(); 210protected override BoundStatement InitializeParameterField(MethodSymbol getEnumeratorMethod, ParameterSymbol parameter, BoundExpression resultParameter, BoundExpression parameterProxy) 397ImmutableArray.Create<BoundExpression>(instLocal))); 658BoundExpression managedThreadId = null;
Lowering\AsyncRewriter\AsyncRewriter.cs (2)
185new BoundExpression[] { F.Parameter(F.CurrentFunction.Parameters[0]) })), 265ImmutableArray.Create<BoundExpression>(F.Local(stateMachineVariable)))));
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\DiagnosticsPass_ExpressionTrees.cs (8)
64private void CheckUnsafeType(BoundExpression e) 193private void CheckReferenceToThisOrBase(BoundExpression node) 206private void CheckReferenceToVariable(BoundExpression node, Symbol symbol) 221private void CheckReferenceToMethodIfLocalFunction(BoundExpression node, MethodSymbol method) 307ImmutableArray<BoundExpression> arguments, 357static bool hasDefaultArgument(ImmutableArray<BoundExpression> arguments, BitVector defaultArguments) 376node is BoundExpression expr && 752BoundExpression operand = node.Operand;
Lowering\DiagnosticsPass_Warnings.cs (21)
21private void CheckArguments(ImmutableArray<RefKind> argumentRefKindsOpt, ImmutableArray<BoundExpression> arguments, Symbol method) 30var argument = arguments[i]; 95private void CheckReceiverIfField(BoundExpression receiverOpt) 135BoundExpression receiver = fieldAccess.ReceiverOpt; 160private static BoundExpression StripImplicitCasts(BoundExpression expr) 162BoundExpression current = expr; 176private static bool IsSameLocalOrField(BoundExpression expr1, BoundExpression expr2) 235private static bool IsComCallWithRefOmitted(MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt) 286BoundExpression left = node.Left; 345private static bool IsExplicitCast(BoundExpression node) 460private void CheckForBitwiseOrSignExtend(BoundExpression node, BinaryOperatorKind operatorKind, BoundExpression leftOperand, BoundExpression rightOperand) 572private static ConstantValue GetConstantValueForBitwiseOrCheck(BoundExpression operand) 604private static ulong FindSurprisingSignExtensionBits(BoundExpression expr) 851private static TypeSymbol GetTypeForLiftedComparisonWarning(BoundExpression node) 887private void CheckForDeconstructionAssignmentToSelf(BoundTupleExpression leftTuple, BoundExpression right) 916var leftArgument = leftArguments[i]; 917var rightArgument = rightTuple.Arguments[i];
Lowering\Extensions.cs (3)
32public static bool NullableAlwaysHasValue(this BoundExpression expr) 76public static bool NullableNeverHasValue(this BoundExpression expr) 129public static bool IsNullableNonBoolean(this BoundExpression expr)
Lowering\InitializerRewriter.cs (3)
37BoundExpression trailingExpression = null; 50var expression = GetTrailingScriptExpression(lastStatement); 82internal static BoundExpression GetTrailingScriptExpression(BoundStatement statement)
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (10)
171BoundExpression mvid, 172BoundExpression methodToken, 173BoundExpression payloadSlot, 178BoundExpression fileIndexOrIndicesArgument; 192var fileIndices = ArrayBuilder<BoundExpression>.GetInstance(); 268BoundExpression mvid = _methodBodyFactory.ModuleVersionId(); 269BoundExpression methodToken = _methodBodyFactory.MethodDefIndex(_method); 271BoundExpression payloadSlot = 289BoundExpression payloadNullTest = 437public override BoundStatement InstrumentSwitchWhenClauseConditionalGotoBody(BoundExpression original, BoundStatement ifConditionGotoBody)
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\DebugInfoInjector_SequencePoints.cs (4)
171private static BoundExpression AddConditionSequencePoint(BoundExpression condition, SyntaxNode synthesizedVariableSyntax, SyntheticBoundNodeFactory factory) 186var valueExpression = (condition.ConstantValueOpt == null) ? 193ImmutableArray.Create<BoundExpression>(factory.AssignmentExpression(factory.Local(local), condition)),
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\Instrumentation\ModuleCancellationInstrumenter.cs (10)
94private BoundExpression InstrumentExpression(BoundExpression expression) 100public override BoundExpression InstrumentWhileStatementCondition(BoundWhileStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) 103public override BoundExpression InstrumentDoStatementCondition(BoundDoStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) 106public override BoundExpression InstrumentForStatementCondition(BoundForStatement original, BoundExpression rewrittenCondition, SyntheticBoundNodeFactory factory) 120ref BoundExpression? receiver, 121ref ImmutableArray<BoundExpression> arguments,
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (4)
332var rewrittenExpression = (BoundExpression)Visit(node.Expression); 345BoundExpression caseExpressionOpt = (BoundExpression)this.Visit(node.CaseExpressionOpt);
Lowering\IteratorRewriter\IteratorRewriter.cs (3)
193BoundExpression managedThreadId = null; // Thread.CurrentThread.ManagedThreadId 254private void GenerateEnumerableImplementation(ref BoundExpression managedThreadId) 269private void GenerateConstructor(BoundExpression managedThreadId)
Lowering\LocalRewriter\DelegateCacheRewriter.cs (2)
44internal BoundExpression Rewrite(BoundDelegateCreationExpression boundDelegateCreation) 55var rewrittenNode = _factory.Coalesce(boundCacheField, _factory.AssignmentExpression(boundCacheField, boundDelegateCreation));
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.PlaceholderReplacer.cs (7)
14private readonly Dictionary<BoundEarlyValuePlaceholderBase, BoundExpression> _placeholders; 16private PlaceholderReplacer(Dictionary<BoundEarlyValuePlaceholderBase, BoundExpression> placeholders) 21public static BoundExpression Replace(Dictionary<BoundEarlyValuePlaceholderBase, BoundExpression> placeholders, BoundExpression expr) 25return (BoundExpression)result; 30var value = _placeholders[placeholder];
Lowering\LocalRewriter\LocalRewriter_AsOperator.cs (7)
18BoundExpression rewrittenOperand = VisitExpression(node.Operand); 32private BoundExpression MakeAsOperator( 35BoundExpression rewrittenOperand, 38BoundExpression? operandConversion, 61BoundExpression result = rewrittenType.IsNullableType() ? new BoundDefaultExpression(syntax, rewrittenType) : MakeLiteral(syntax, constantValue, rewrittenType); 74sideEffects: ImmutableArray.Create<BoundExpression>(rewrittenOperand), 87BoundExpression result = VisitExpression(operandConversion);
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_Await.cs (7)
18public BoundExpression VisitAwaitExpression(BoundAwaitExpression node, bool used) 20return RewriteAwaitExpression((BoundExpression)base.VisitAwaitExpression(node)!, used); 23private BoundExpression RewriteAwaitExpression(SyntaxNode syntax, BoundExpression rewrittenExpression, BoundAwaitableInfo awaitableInfo, TypeSymbol type, BoundAwaitExpressionDebugInfo debugInfo, bool used) 31private BoundExpression RewriteAwaitExpression(BoundExpression rewrittenAwait, bool used) 53sideEffects: ImmutableArray.Create<BoundExpression>(tempAssignment),
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)
24public BoundExpression VisitDynamicInvocation(BoundDynamicInvocation node, bool resultDiscarded) 31BoundExpression loweredReceiver; 82var loweredExpression = VisitExpression(node.Expression); 98private void EmbedIfNeedTo(BoundExpression receiver, ImmutableArray<MethodSymbol> methods, SyntaxNode syntaxNode) 117private void EmbedIfNeedTo(BoundExpression receiver, ImmutableArray<PropertySymbol> properties, SyntaxNode syntaxNode) 138ref BoundExpression? receiverOpt, 139ref ImmutableArray<BoundExpression> arguments, 325BoundExpression rewrittenCall; 342BoundExpression? rewrittenReceiver = VisitExpression(node.ReceiverOpt); 356BoundExpression? rewrittenReceiver = VisitExpression(node.ReceiverOpt); 382BoundExpression visitArgumentsAndFinishRewrite(BoundCall node, BoundExpression? rewrittenReceiver) 387ImmutableArray<BoundExpression> arguments = node.Arguments; 391BoundExpression? firstRewrittenArgument = null; 427var rewrittenCall = MakeCall(node, node.Syntax, rewrittenReceiver, method, rewrittenArguments, argRefKindsOpt, node.ResultKind, temps.ToImmutableAndFree()); 438private BoundExpression MakeCall( 441BoundExpression? rewrittenReceiver, 443ImmutableArray<BoundExpression> rewrittenArguments, 448BoundExpression rewrittenBoundCall; 515sideEffects: ImmutableArray<BoundExpression>.Empty, 523private BoundExpression MakeCall(SyntaxNode syntax, BoundExpression? rewrittenReceiver, MethodSymbol method, ImmutableArray<BoundExpression> rewrittenArguments) 536private static bool IsSafeForReordering(BoundExpression expression, RefKind kind) 543var current = expression; 622internal static bool IsCapturedPrimaryConstructorParameter(BoundExpression expression) 654private ImmutableArray<BoundExpression> VisitArgumentsAndCaptureReceiverIfNeeded( 655[NotNullIfNotNull(nameof(rewrittenReceiver))] ref BoundExpression? rewrittenReceiver, 657ImmutableArray<BoundExpression> arguments, 661ArrayBuilder<BoundExpression>? storesOpt, 663BoundExpression? firstRewrittenArgument = null) 722ImmutableArray<BoundExpression> rewrittenArguments; 731var visitedArgumentsBuilder = ArrayBuilder<BoundExpression>.GetInstance(arguments.Length); 740var argument = arguments[i]; 809extraRefInitialization is object ? ImmutableArray.Create<BoundExpression>(extraRefInitialization, assignmentToTemp) : ImmutableArray.Create<BoundExpression>(assignmentToTemp), 828ArrayBuilder<BoundExpression> visitedArgumentsBuilder, 834var argument = arguments[argumentIndex]; 885visitedArgumentsBuilder[argIndex] = _factory.Sequence(ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create<BoundExpression>(store), local); 907static bool usesReceiver(BoundExpression argument) 965_factory.Sequence(new BoundExpression[] { _factory.AssignmentExpression(cache, intermediateRef) }, cache), 983_factory.Sequence(new BoundExpression[] { _factory.AssignmentExpression(cache, assignmentToTemp.Right) }, cache), 998private ImmutableArray<BoundExpression> MakeArguments( 999ImmutableArray<BoundExpression> rewrittenArguments, 1018BoundExpression? optimized; 1084BoundExpression[] actualArguments = new BoundExpression[parameters.Length]; // The actual arguments that will be passed; one actual argument per formal parameter. 1131private bool TryOptimizeParamsArray(BoundExpression possibleParamsArray, [NotNullWhen(true)] out BoundExpression? optimized) 1211ImmutableArray<BoundExpression> rewrittenArguments, 1256private delegate BoundExpression ParamsArrayElementRewriter<TArg>(BoundExpression element, ref TArg arg); 1257private static BoundExpression RewriteParamsArray<TArg>(BoundExpression paramsArray, ParamsArrayElementRewriter<TArg> elementRewriter, ref TArg arg) 1263ArrayBuilder<BoundExpression>? elementsBuilder = null; 1267var element = elements[i]; 1268var replacement = elementRewriter(element, ref arg); 1274elementsBuilder = ArrayBuilder<BoundExpression>.GetInstance(elements.Length); 1307ImmutableArray<BoundExpression> rewrittenArguments, 1309/* out */ BoundExpression[] arguments, 1320BoundExpression argument = rewrittenArguments[a]; 1346static (BoundExpression element, ref (LocalRewriter rewriter, bool forceLambdaSpilling, ArrayBuilder<BoundAssignmentOperator> storesToTemps) arg) => 1376private BoundExpression StoreArgumentToTempIfNecessary(bool forceLambdaSpilling, ArrayBuilder<BoundAssignmentOperator> storesToTemps, BoundExpression argument, RefKind argRefKind, RefKind paramRefKind) 1395bool isLambdaConversion(BoundExpression expr) 1399private BoundExpression CreateEmptyArray(SyntaxNode syntax, ArrayTypeSymbol arrayType) 1401BoundExpression? arrayEmpty = CreateArrayEmptyCallIfAvailable(syntax, arrayType.ElementType); 1409ImmutableArray.Create<BoundExpression>( 1419private BoundExpression? CreateArrayEmptyCallIfAvailable(SyntaxNode syntax, TypeSymbol elementType) 1441ImmutableArray<BoundExpression>.Empty, 1454BoundExpression[] arguments, 1484BoundExpression[] arguments, 1509var argument = arguments[a]; 1516static (BoundExpression element, ref (ArrayBuilder<BoundAssignmentOperator> tempStores, int tempsRemainedInUse, int firstUnclaimedStore) arg) => 1531static BoundExpression mergeArgumentAndSideEffect(BoundExpression argument, ArrayBuilder<BoundAssignmentOperator> tempStores, ref int tempsRemainedInUse, ref int firstUnclaimedStore) 1569var sideeffects = new BoundExpression[correspondingStore - firstUnclaimedStore]; 1602BoundExpression[] actualArguments, //already re-ordered to match parameters 1626var argument = actualArguments[argIndex]; 1645sideEffects: ImmutableArray.Create<BoundExpression>(boundAssignmentToTemp), 1664var loweredReceiver = VisitExpression(node.Receiver);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (103)
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); 214private static bool CanOptimizeSingleSpreadAsCollectionBuilderArgument(BoundCollectionExpression node, [NotNullWhen(true)] out BoundExpression? spreadExpression) 232private BoundExpression VisitImmutableArrayCollectionExpression(BoundCollectionExpression node, TypeWithAnnotations elementType, MethodSymbol asImmutableArray) 234var arrayCreation = VisitArrayOrSpanCollectionExpression( 243private BoundExpression VisitArrayOrSpanCollectionExpression(BoundCollectionExpression node, CollectionExpressionTypeKind collectionTypeKind, TypeSymbol collectionType, TypeWithAnnotations elementType) 277var rewrittenElements = elements.SelectAsArray(static (element, rewriter) => rewriter.VisitExpression((BoundExpression)element), this); 298BoundExpression array; 307var list = CreateAndPopulateList(node, elementType, elements); 325private BoundExpression VisitCollectionInitializerCollectionExpression(BoundCollectionExpression node, TypeSymbol collectionType) 330var rewrittenReceiver = VisitExpression(node.CollectionCreation); 337var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(elements.Length + 1); 347var rewrittenElement = element is BoundCollectionExpressionSpreadElement spreadElement ? 354var rewrittenValue = rewriteCollectionInitializer(temp, ((BoundExpressionStatement)iteratorBody).Expression); 360rewriteCollectionInitializer(temp, (BoundExpression)element); 376BoundExpression? rewriteCollectionInitializer(BoundLocal rewrittenReceiver, BoundExpression expressionElement) 387private BoundExpression VisitListInterfaceCollectionExpression(BoundCollectionExpression node) 400BoundExpression arrayOrList; 430BoundExpression fieldValue = kind switch 433SynthesizedReadOnlyListKind.SingleElement => this.VisitExpression((BoundExpression)elements.Single()), 453private BoundExpression VisitCollectionBuilderCollectionExpression(BoundCollectionExpression node) 474BoundExpression span = CanOptimizeSingleSpreadAsCollectionBuilderArgument(node, out var spreadExpression) 496var result = VisitExpression(node.CollectionBuilderInvocationConversion); 515node.Elements.All(e => ((BoundExpression)e).ConstantValueOpt is { }); 525private BoundExpression CreateAndPopulateSpanFromInlineArray( 532Debug.Assert(elements.All(e => e is BoundExpression)); 549var element = VisitExpression((BoundExpression)elements[0]); 567var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(); 577var element = VisitExpression((BoundExpression)elements[i]); 639private BoundExpression CreateAndPopulateArray(BoundCollectionExpression node, ArrayTypeSymbol arrayType) 660var rewrittenSpreadExpression = VisitExpression(spreadExpression); 670var rewrittenSpreadExpression = CallAsSpanMethod(VisitExpression(spreadExpression), asSpanMethod); 699elements.SelectAsArray(static (element, rewriter) => rewriter.VisitExpression((BoundExpression)element), this)); 702ImmutableArray.Create<BoundExpression>( 714var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(); 741addElement: (ArrayBuilder<BoundExpression> expressions, BoundExpression arrayTemp, BoundExpression rewrittenValue, bool isLastElement) => 769tryOptimizeSpreadElement: (ArrayBuilder<BoundExpression> sideEffects, BoundExpression arrayTemp, BoundCollectionExpressionSpreadElement spreadElement, BoundExpression rewrittenSpreadOperand) => 776if (!TryConvertToSpan(arrayTemp, writableOnly: true, out var targetSpan)) 856private bool TryConvertToSpan(BoundExpression expression, bool writableOnly, [NotNullWhen(true)] out BoundExpression? span) 871private BoundExpression CallAsSpanMethod(BoundExpression spreadExpression, MethodSymbol? asSpanMethod) 895private (MethodSymbol spanSliceMethod, BoundExpression spreadElementAsSpan, MethodSymbol getLengthMethod, MethodSymbol copyToMethod)? PrepareCopyToOptimization( 897BoundExpression rewrittenSpreadOperand) 907if (!TryConvertToSpan(rewrittenSpreadOperand, writableOnly: false, out var spreadOperandAsSpan)) 937ArrayBuilder<BoundExpression> sideEffects, 940BoundExpression spanTemp, 941BoundExpression rewrittenSpreadOperand, 943BoundExpression spreadOperandAsSpan, 976private BoundExpression CreateAndPopulateList(BoundCollectionExpression node, TypeWithAnnotations elementType, ImmutableArray<BoundNode> elements) 984var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(elements.Length + 1); 1014var knownLengthExpression = GetKnownLengthExpression(elements, numberIncludingLastSpread, localsBuilder); 1026rewrittenReceiver = _factory.New(constructor, ImmutableArray.Create<BoundExpression>(knownLengthTemp)); 1038rewrittenReceiver = _factory.New(constructor, ImmutableArray<BoundExpression>.Empty); 1078addElement: (ArrayBuilder<BoundExpression> expressions, BoundExpression spanTemp, BoundExpression rewrittenValue, bool isLastElement) => 1106tryOptimizeSpreadElement: (ArrayBuilder<BoundExpression> sideEffects, BoundExpression spanTemp, BoundCollectionExpressionSpreadElement spreadElement, BoundExpression rewrittenSpreadOperand) => 1125addElement: (ArrayBuilder<BoundExpression> expressions, BoundExpression listTemp, BoundExpression rewrittenValue, bool isLastElement) => 1131tryOptimizeSpreadElement: (ArrayBuilder<BoundExpression> sideEffects, BoundExpression listTemp, BoundCollectionExpressionSpreadElement spreadElement, BoundExpression rewrittenSpreadOperand) => 1159private BoundExpression RewriteCollectionExpressionElementExpression(BoundNode element) 1161var expression = element is BoundCollectionExpressionSpreadElement spreadElement ? 1163(BoundExpression)element; 1171ArrayBuilder<BoundExpression> sideEffects) 1175var rewrittenExpression = RewriteCollectionExpressionElementExpression(elements[i]); 1185BoundExpression rewrittenReceiver, 1188ArrayBuilder<BoundExpression> sideEffects, 1189Action<ArrayBuilder<BoundExpression>, BoundExpression, BoundExpression, bool> addElement, 1190Func<ArrayBuilder<BoundExpression>, BoundExpression, BoundCollectionExpressionSpreadElement, BoundExpression, bool> tryOptimizeSpreadElement) 1204var rewrittenElement = MakeCollectionExpressionSpreadElement( 1209var rewrittenValue = VisitExpression(((BoundExpressionStatement)iteratorBody).Expression); 1210var builder = ArrayBuilder<BoundExpression>.GetInstance(); 1229private BoundExpression GetKnownLengthExpression(ImmutableArray<BoundNode> elements, int numberIncludingLastSpread, ArrayBuilder<BoundLocal> rewrittenExpressions) 1234BoundExpression? sum = null; 1244var lengthAccess = VisitExpression(spreadElement.LengthOrCount); 1269BoundExpression add(BoundExpression? sum, BoundExpression value) 1277private BoundExpression MakeCollectionExpressionSpreadElement( 1279BoundExpression 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_ConditionalAccess.cs (9)
26private BoundExpression? _currentConditionalAccessTarget; 38internal BoundExpression? RewriteConditionalAccess(BoundConditionalAccess node, bool used) 43var loweredReceiver = this.VisitExpression(node.Receiver); 76var previousConditionalAccessTarget = _currentConditionalAccessTarget; 104BoundExpression? loweredAccessExpression; 144BoundExpression result; 176var condition = _factory.IsNotNullReference(loweredReceiver); 178var consequence = loweredAccessExpression; 204var newtarget = _currentConditionalAccessTarget;
Lowering\LocalRewriter\LocalRewriter_ConditionalOperator.cs (7)
23var rewrittenCondition = VisitExpression(node.Condition); 24var rewrittenConsequence = VisitExpression(node.Consequence); 25var rewrittenAlternative = VisitExpression(node.Alternative); 42private static BoundExpression RewriteConditionalOperator( 44BoundExpression rewrittenCondition, 45BoundExpression rewrittenConsequence, 46BoundExpression rewrittenAlternative,
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_DelegateCreationExpression.cs (3)
20var loweredArgument = VisitExpression(node.Argument); 23var loweredReceiver = _dynamicFactory.MakeDynamicConversion(loweredArgument, isExplicit: false, isArrayIndex: false, isChecked: false, resultType: node.Type).ToExpression(); 35var receiver = (!method.RequiresInstanceReceiver && !node.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ? _factory.Type(method.ContainingType) : VisitExpression(mg.ReceiverOpt)!;
Lowering\LocalRewriter\LocalRewriter_DoStatement.cs (1)
19var rewrittenCondition = VisitExpression(node.Condition);
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_ExpressionStatement.cs (3)
23var loweredExpression = VisitUnusedExpression(node.Expression); 41private BoundExpression? VisitUnusedExpression(BoundExpression expression)
Lowering\LocalRewriter\LocalRewriter_Field.cs (8)
13BoundExpression? rewrittenReceiver = VisitExpression(node.ReceiverOpt); 17private BoundExpression MakeFieldAccess( 19BoundExpression? rewrittenReceiver, 31BoundExpression result = oldNodeOpt != null ? 50private BoundExpression MakeTupleFieldAccess( 53BoundExpression? rewrittenReceiver) 98private BoundExpression MakeTupleFieldAccessAndReportUseSiteDiagnostics(BoundExpression tuple, SyntaxNode syntax, FieldSymbol field)
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_ForStatement.cs (3)
20var rewrittenCondition = VisitExpression(node.Condition); 44BoundExpression? rewrittenCondition, 175BoundExpression? rewrittenCondition,
Lowering\LocalRewriter\LocalRewriter_FunctionPointerInvocation.cs (4)
16var rewrittenExpression = VisitExpression(node.InvokedExpression); 24BoundExpression? discardedReceiver = null; 52BoundExpression rewrittenInvocation = node.Update(rewrittenExpression, rewrittenArgs, argumentRefKindsOpt, node.ResultKind, node.Type); 60rewrittenInvocation = new BoundSequence(rewrittenInvocation.Syntax, temps.ToImmutableAndFree(), sideEffects: ImmutableArray<BoundExpression>.Empty, rewrittenInvocation, node.Type);
Lowering\LocalRewriter\LocalRewriter_GotoStatement.cs (1)
18BoundExpression? caseExpressionOpt = null;
Lowering\LocalRewriter\LocalRewriter_IfStatement.cs (2)
23var rewrittenCondition = VisitExpression(node.Condition); 121BoundExpression rewrittenCondition,
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_IsOperator.cs (7)
18BoundExpression rewrittenOperand = VisitExpression(node.Operand); 25private BoundExpression MakeIsOperator( 28BoundExpression rewrittenOperand, 36BoundExpression? receiver = methodGroup.ReceiverOpt; 80private BoundExpression RewriteConstantIsOperator( 82BoundExpression loweredOperand, 92sideEffects: ImmutableArray.Create<BoundExpression>(loweredOperand),
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (20)
19BoundExpression result; 109internal BoundExpression LowerGeneralIsPattern(BoundIsPatternExpression node, BoundDecisionDag decisionDag) 113var inputExpression = _localRewriter.VisitExpression(node.Expression); 149private readonly ArrayBuilder<BoundExpression> _sideEffectBuilder; 156private readonly ArrayBuilder<BoundExpression> _conjunctBuilder; 161_conjunctBuilder = ArrayBuilder<BoundExpression>.GetInstance(); 162_sideEffectBuilder = ArrayBuilder<BoundExpression>.GetInstance(); 172private void AddConjunct(BoundExpression test) 198var sideEffect = LowerEvaluation(eval); 204var testExpression = LowerTest(test); 218public BoundExpression LowerIsPatternAsLinearTestSequence( 224BoundExpression loweredInput = _localRewriter.VisitExpression(isPatternExpression.Expression); 237private BoundExpression ProduceLinearTestSequence( 257TryLowerTypeTestAndCast(testNode.Test, e.Evaluation, out BoundExpression? sideEffect, out BoundExpression? testExpression)) 287BoundExpression left = _localRewriter.VisitExpression(binding.VariableAccess); 288BoundExpression right = _tempAllocator.GetTemp(binding.TempContainingValue); 308BoundExpression? result = null; 309foreach (BoundExpression conjunct in _conjunctBuilder) 319result = _factory.Sequence(allTemps, ImmutableArray<BoundExpression>.Empty, result);
Lowering\LocalRewriter\LocalRewriter_Literal.cs (5)
23private BoundExpression MakeLiteral(SyntaxNode syntax, ConstantValue constantValue, TypeSymbol? type, BoundLiteral? oldNodeOpt = null) 51private BoundExpression MakeDecimalLiteral(SyntaxNode syntax, ConstantValue constantValue) 62var arguments = new ArrayBuilder<BoundExpression>(); 142private BoundExpression MakeDateTimeLiteral(SyntaxNode syntax, ConstantValue constantValue) 147var arguments = new ArrayBuilder<BoundExpression>();
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.cs (1)
19private BoundStatement? RewriteLocalDeclaration(BoundLocalDeclaration? originalOpt, SyntaxNode syntax, LocalSymbol localSymbol, BoundExpression? rewrittenInitializer, bool hasErrors = false)
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (5)
26BoundExpression rewrittenArgument = VisitExpression(node.Argument); 103BoundExpression exitCallExpr; 117exitCallExpr = new BoundBadExpression(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType); 197BoundExpression enterCallExpr; 212enterCallExpr = new BoundBadExpression(lockSyntax, LookupResultKind.NotInvocable, ImmutableArray<Symbol?>.Empty, ImmutableArray.Create<BoundExpression>(boundLockTemp), ErrorTypeSymbol.UnknownResultType);
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_PatternSwitchStatement.cs (2)
76var loweredSwitchGoverningExpression = _localRewriter.VisitExpression(node.Expression); 81var instrumentedExpression = _localRewriter.Instrumenter.InstrumentSwitchStatementExpression(node, loweredSwitchGoverningExpression, _factory);
Lowering\LocalRewriter\LocalRewriter_PointerElementAccess.cs (8)
14BoundExpression rewrittenExpression = LowerReceiverOfPointerElementAccess(node.Expression); 15BoundExpression rewrittenIndex = VisitExpression(node.Index); 20private BoundExpression LowerReceiverOfPointerElementAccess(BoundExpression receiver) 24var loweredFieldReceiver = VisitExpression(fieldAccess.ReceiverOpt); 32private BoundExpression RewritePointerElementAccess(BoundPointerElementAccess node, BoundExpression rewrittenExpression, BoundExpression rewrittenIndex)
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_SwitchExpression.cs (8)
35public static BoundExpression Rewrite(LocalRewriter localRewriter, BoundConvertedSwitchExpression node) 38BoundExpression result = rewriter.LowerSwitchExpression(node); 43private BoundExpression LowerSwitchExpression(BoundConvertedSwitchExpression node) 51var loweredSwitchGoverningExpression = _localRewriter.VisitExpression(node.Expression); 55loweredSwitchGoverningExpression, result, out BoundExpression savedInputExpression); 97var loweredValue = _localRewriter.VisitExpression(arm.Value); 148bool implicitConversionExists(BoundExpression expression, TypeSymbol type) 156private static BoundStatement ConstructThrowSwitchExpressionExceptionHelperCall(SyntheticBoundNodeFactory factory, BoundExpression unmatchedValue)
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (4)
85BoundExpression? rewrittenExceptionSourceOpt = (BoundExpression?)this.Visit(node.ExceptionSourceOpt); 87BoundExpression? rewrittenFilter = (BoundExpression?)this.Visit(node.ExceptionFilterOpt);
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\LocalRewriter_UsingStatement.cs (12)
127BoundExpression rewrittenExpression = VisitExpression(node.ExpressionOpt); 168BoundExpression tempInit = MakeConversionNode( 244BoundExpression tempInit = MakeConversionNode( 358BoundExpression disposedExpression; 373BoundExpression disposeCall = GenerateDisposeCall(resourceTypeSyntax, resourceSyntax, disposedExpression, patternDisposeInfo, awaitOpt, awaitKeywordOpt); 378BoundExpression? ifCondition; 434private BoundExpression GenerateDisposeCall( 437BoundExpression disposedExpression, 460BoundExpression disposeCall; 492private BoundExpression MakeCallWithNoExplicitArgument(MethodArgumentInfo methodArgumentInfo, SyntaxNode syntax, BoundExpression? expression, BoundExpression? firstRewrittenArgument)
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (3)
20var rewrittenCondition = VisitExpression(node.Condition); 43BoundExpression rewrittenCondition, 109BoundExpression rewrittenCondition,
Lowering\LocalRewriter\LoweredDynamicOperation.cs (10)
26public readonly BoundExpression? SiteInitialization; 27public readonly BoundExpression SiteInvocation; 29public LoweredDynamicOperation(SyntheticBoundNodeFactory? factory, BoundExpression? siteInitialization, BoundExpression siteInvocation, TypeSymbol resultType, ImmutableArray<LocalSymbol> temps) 39BoundExpression? loweredReceiver, 40ImmutableArray<BoundExpression> loweredArguments, 41BoundExpression? loweredRight, 44var children = ArrayBuilder<BoundExpression>.GetInstance(); 52public static LoweredDynamicOperation Bad(TypeSymbol resultType, ImmutableArray<BoundExpression> children) 59public BoundExpression ToExpression()
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\IteratorAndAsyncCaptureWalker.cs (5)
40private readonly Dictionary<LocalSymbol, BoundExpression> _boundRefLocalInitializers = new Dictionary<LocalSymbol, BoundExpression>(); 219if (_variablesToHoist.Add(variable) && variable is LocalSymbol local && _boundRefLocalInitializers.TryGetValue(local, out var variableInitializer)) 232private void CaptureRefInitializer(BoundExpression variableInitializer, SyntaxNode syntax) 242case BoundFieldAccess { FieldSymbol: { IsStatic: false, ContainingType: { IsValueType: true } }, ReceiverOpt: BoundExpression receiver }:
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (19)
144BoundExpression thisProxyReplacement = thisProxy.Replacement(F.Syntax, static (frameType, F) => F.This(), F); 199protected override BoundExpression FramePointer(SyntaxNode syntax, NamedTypeSymbol frameClass) 339var variableCleanup = ArrayBuilder<BoundExpression>.GetInstance(); 425private void AddVariableCleanup(ArrayBuilder<BoundExpression> cleanup, FieldSymbol field) 491private BoundExpression HoistRefInitialization(SynthesizedLocal local, BoundAssignmentOperator node) 505var right = (BoundExpression)Visit(node.Right); 507var sideEffects = ArrayBuilder<BoundExpression>.GetInstance(); 534var replacement = HoistExpression(right, awaitSyntaxOpt, syntaxOffset, local.RefKind, sideEffects, hoistedFields, ref needsSacrificialEvaluation); 557private BoundExpression HoistExpression( 558BoundExpression expr, 562ArrayBuilder<BoundExpression> sideEffects, 571BoundExpression expression = HoistExpression(array.Expression, awaitSyntaxOpt, syntaxOffset, RefKind.None, sideEffects, hoistedFields, ref needsSacrificialEvaluation); 572var indices = ArrayBuilder<BoundExpression>.GetInstance(); 573foreach (var index in array.Indices) 599var receiver = HoistExpression(field.ReceiverOpt, awaitSyntaxOpt, syntaxOffset, 805BoundExpression expression = (BoundExpression)this.Visit(node.Expression); 929var fetchThis = proxy.Replacement(F.Syntax, static (frameType, F) => F.This(), F);
Lowering\StateMachineRewriter\ResumableStateMachineStateAllocator.cs (1)
80public BoundStatement? GenerateThrowMissingStateDispatch(SyntheticBoundNodeFactory f, BoundExpression cachedState, HotReloadExceptionCode errorCode)
Lowering\StateMachineRewriter\StateMachineRewriter.cs (10)
314var leftExpression = proxy.Replacement( 328var leftExpression = proxy.Replacement( 375protected BoundExpression MakeCurrentThreadId() 398protected SynthesizedImplementationMethod GenerateIteratorGetEnumerator(MethodSymbol getEnumeratorMethod, ref BoundExpression managedThreadId, StateMachineState initialState) 468var leftExpression = proxy.Replacement( 473var rightExpression = copySrc[method.ThisParameter].Replacement(F.Syntax, static (stateMachineType, F) => F.This(), F); 487BoundExpression resultParameter = proxy.Replacement( 493BoundExpression parameterProxy = copySrc[parameter].Replacement(F.Syntax, static (stateMachineType, F) => F.This(), F); 515protected 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,
Symbols\ConstantValueUtils.cs (3)
79BoundExpression boundValue, 96var unconvertedBoundValue = boundValue; 163internal static void CheckLangVersionForConstantValue(BoundExpression expression, BindingDiagnosticBag diagnostics)
Symbols\FunctionTypeSymbol.cs (5)
40private readonly Func<Binder, BoundExpression, NamedTypeSymbol?>? _calculateDelegate; 42private BoundExpression? _expression; 45internal static FunctionTypeSymbol? CreateIfFeatureEnabled(SyntaxNode syntax, Binder binder, Func<Binder, BoundExpression, NamedTypeSymbol?> calculateDelegate) 52private FunctionTypeSymbol(Binder binder, Func<Binder, BoundExpression, NamedTypeSymbol?> calculateDelegate) 64internal void SetExpression(BoundExpression expression)
Symbols\LocalSymbol.cs (1)
363internal abstract ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue);
Symbols\ReducedExtensionMethodSymbol.cs (1)
149var arguments = new BoundExpression[paramCount];
Symbols\Source\ParameterHelpers.cs (3)
712BoundExpression defaultExpression, 713BoundExpression convertedExpression, 864private static bool IsValidDefaultValue(BoundExpression expression)
Symbols\Source\SourceComplexParameterSymbol.cs (2)
383parameterEqualsValue = binder.BindParameterDefaultValue(defaultSyntax, this, diagnostics, out var valueBeforeConversion); 389BoundExpression convertedExpression = parameterEqualsValue.Value;
Symbols\Source\SourceFixedFieldSymbol.cs (1)
90BoundExpression boundSizeExpression = binder.GenerateConversionForAssignment(
Symbols\Source\SourceLocalSymbol.cs (4)
475internal override ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue) 563BoundExpression initializerOpt = this._initializerBinder.BindInferredVariableInitializer(diagnostics, RefKind, _initializer, _initializer); 575private void MakeConstantTuple(LocalSymbol inProgress, BoundExpression boundInitValue) 609internal override ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue)
Symbols\Source\SourceMemberFieldSymbol.cs (1)
539var initializerOpt = executableBinder.BindInferredVariableInitializer(diagnostics, RefKind.None, syntaxNode, declarator);
Symbols\Symbol_Attributes.cs (1)
425Binder.CheckRequiredMembersInObjectInitializer(ctor, ImmutableArray<BoundExpression>.CastUp(boundAttribute.NamedArguments), boundAttribute.Syntax, diagnostics);
Symbols\Synthesized\Records\SynthesizedRecordEqualityOperator.cs (3)
64BoundExpression expression; 71BoundExpression objectEqual = F.ObjectEqual(left, right); 72BoundExpression recordEquals = F.LogicalAnd(F.ObjectNotEqual(left, F.Null(F.SpecialType(SpecialType.System_Object))),
Symbols\Synthesized\Records\SynthesizedRecordEquals.cs (1)
53BoundExpression? retExpr;
Symbols\Synthesized\Records\SynthesizedRecordGetHashCode.cs (1)
48BoundExpression? currentHashValue;
Symbols\Synthesized\Records\SynthesizedRecordObjEquals.cs (1)
56BoundExpression expression;
Symbols\Synthesized\SynthesizedEmbeddedNativeIntegerAttributeSymbol.cs (1)
82ImmutableArray.Create<BoundExpression>(factory.Literal(true))
Symbols\Synthesized\SynthesizedEmbeddedNullableAttributeSymbol.cs (1)
100ImmutableArray.Create<BoundExpression>(
Symbols\Synthesized\SynthesizedEntryPointSymbol.cs (6)
291private static BoundCall CreateParameterlessCall(CSharpSyntaxNode syntax, BoundExpression receiver, ThreeState receiverIsSubjectToCloning, MethodSymbol method) 298ImmutableArray<BoundExpression>.Empty, 334private readonly BoundExpression _getAwaiterGetResultCall; 353var arguments = Parameters.SelectAsArray((p, s) => (BoundExpression)new BoundParameter(s, p, p.Type), _userMainReturnTypeSyntax); 491BoundExpression getAwaiterGetResultCall; 590ImmutableArray.Create<BoundExpression>(submissionArrayParameter),
Symbols\Synthesized\SynthesizedLocal.cs (1)
195internal sealed override ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue)
Symbols\Synthesized\SynthesizedParameterlessThrowMethod.cs (1)
33var body = F.Throw(F.New(_exceptionConstructor, ImmutableArray<BoundExpression>.Empty));
Symbols\Synthesized\SynthesizedThrowSwitchExpressionExceptionMethod.cs (1)
34var body = F.Throw(F.New(F.WellKnownMethod(WellKnownMember.System_Runtime_CompilerServices_SwitchExpressionException__ctorObject), ImmutableArray.Create<BoundExpression>(F.Parameter(unmatchedValue))));
Symbols\Synthesized\TypeSubstitutedLocalSymbol.cs (1)
121internal override ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue)
Symbols\UpdatedContainingSymbolLocal.cs (1)
95internal override ReadOnlyBindingDiagnostic<AssemblySymbol> GetConstantValueDiagnostics(BoundExpression boundInitValue) =>