Binder\Binder_Await.cs (11)
62out BoundCall? runtimeAsyncAwaitCall,
95var call = (BoundCall)expression;
261out BoundCall? runtimeAsyncAwaitCall,
276out BoundCall? runtimeAsyncAwaitCall,
323bool tryGetRuntimeAwaitHelper(BoundExpression expression, out BoundAwaitableValuePlaceholder? placeholder, out BoundCall? runtimeAwaitCall, BindingDiagnosticBag diagnostics)
487bool getRuntimeAwaitAwaiter(TypeSymbol awaiterType, out BoundCall? runtimeAwaitAwaiterCall, out BoundAwaitableValuePlaceholder? placeholder, SyntaxNode syntax, BindingDiagnosticBag diagnostics)
607var call = (BoundCall)getAwaiterCall;
724var call = (BoundCall)getAwaiterGetResultCall;
Binder\Binder_Invocation.cs (7)
1109var call = (BoundCall)expression;
1163private BoundCall BindInvocationExpressionContinued(
2064private BoundCall CreateBadCall(
2120return BoundCall.ErrorCall(node, receiver, method, args, argNames, argRefKinds, isDelegate, invokedAsExtensionMethod: invokedAsExtensionMethod, originalMethods: methods, resultKind: resultKind, binder: this);
2346private BoundCall CreateBadCall(
2361return BoundCall.ErrorCall(node, expr, method, args, argNames, argRefKinds, isDelegateCall: false, invokedAsExtensionMethod: false, originalMethods: originalMethods, resultKind: resultKind, binder: this);
Binder\Binder_Query.cs (19)
233var result = MakeQueryInvocation(state.selectOrGroup, e, "Select", lambda, diagnostics
257BoundCall result;
308private static BoundCall ReverseLastTwoParameterOrder(BoundCall result)
367var invocation = MakeQueryInvocation(where, state.fromExpression, "Where", lambda, diagnostics
415BoundCall invocation;
481BoundCall invocation;
568var invocation = MakeQueryInvocation(ordering, state.fromExpression, methodName, lambda, diagnostics
611var invocation = MakeQueryInvocation(
658var invocation = MakeQueryInvocation(
677private static BoundExpression? ExtractCastInvocation(BoundCall invocation)
688var i1 = r1 != null ? r1.ExpressionOpt as BoundCall : null;
762var invocation = MakeQueryInvocation(let, state.fromExpression, "Select", lambda, diagnostics
879protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, BoundExpression arg, BindingDiagnosticBag diagnostics
892protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
905protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, TypeSyntax typeArgSyntax, TypeWithAnnotations typeArg, BindingDiagnosticBag diagnostics
918protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
997return (BoundCall)MakeInvocationExpression(
BoundTree\Constructors.cs (8)
106public BoundCall Update(BoundExpression? receiverOpt,
121public static BoundCall ErrorCall(
165public BoundCall Update(ImmutableArray<BoundExpression> arguments)
170public BoundCall Update(BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments)
175public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method)
180public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0)
185public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, BoundExpression arg0, BoundExpression arg1)
190public static BoundCall Synthesized(SyntaxNode syntax, BoundExpression? receiverOpt, ThreeState initialBindingReceiverIsSubjectToCloning, MethodSymbol method, ImmutableArray<BoundExpression> arguments, ImmutableArray<RefKind> argumentRefKindsOpt = default)
CodeGen\EmitExpression.cs (20)
103EmitCallExpression((BoundCall)expression, used ? UseKind.UsedAsValue : UseKind.Unused);
630protected override void VisitReceiver(BoundCall node)
1629private void EmitCallExpression(BoundCall call, UseKind useKind)
1646private void EmitDefaultValueTypeConstructorCallExpression(BoundCall call)
1666private void EmitStaticCallExpression(BoundCall call, UseKind useKind)
1703private void EmitInstanceCallExpression(BoundCall call, UseKind useKind)
1712if (receiverIsInstanceCall(call, out BoundCall nested))
1714var calls = ArrayBuilder<BoundCall>.GetInstance();
1730var parentCall = calls.Pop();
1850CallKind determineEmitReceiverStrategy(BoundCall call, out AddressKind? addressKind, out bool box)
1945void emitReceiver(BoundCall call, CallKind callKind, AddressKind? addressKind, bool box, out LocalDefinition tempOpt)
1971void emitArgumentsAndCallEpilogue(BoundCall call, CallKind callKind, UseKind useKind)
2057void emitGenericReceiverCloneIfNecessary(BoundCall call, CallKind callKind, ref LocalDefinition tempOpt)
2108static bool receiverIsInstanceCall(BoundCall call, out BoundCall nested)
2110if (call.ReceiverOpt is BoundCall { Method: { RequiresInstanceReceiver: true } method } receiver && !method.IsDefaultValueTypeConstructor())
2258return ((BoundCall)receiver).Method.RefKind != RefKind.None;
2979var left = (BoundCall)assignmentTarget;
3183Debug.Assert(((BoundCall)expression).Method.RefKind != RefKind.None);
FlowAnalysis\NullableWalker.cs (18)
1591return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } }
4020else if (collectionCreation is BoundCall call)
6775public override BoundNode? VisitCall(BoundCall node)
6778if (tryGetReceiver(node, out BoundCall? receiver))
6781var calls = ArrayBuilder<BoundCall>.GetInstance();
6789while (tryGetReceiver(node, out BoundCall? receiver2))
6878bool tryGetReceiver(BoundCall node, [MaybeNullWhen(returnValue: false)] out BoundCall receiver)
6880if (node.ReceiverOpt is BoundCall instanceReceiver)
6886if (node.InvokedAsExtensionMethod && node.Arguments is [BoundCall extensionReceiver, ..] &&
6899TypeWithState visitAndCheckReceiver(BoundCall node)
6909void reinferMethodAndVisitArguments(BoundCall node, TypeWithState receiverType, VisitResult? firstArgumentResult = null)
7117private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitResult> results)
7506if (node is BoundCall && node.Syntax is SlicePatternSyntax)
7716if (node is BoundCall { HasErrors: true, ArgumentNamesOpt.IsDefaultOrEmpty: false, ArgsToParamsOpt.IsDefault: true } &&
7760if (node is BoundCall { Method: { OriginalDefinition: LocalFunctionSymbol localFunction } })
11469var invocation = conversion.DeconstructionInfo.Invocation as BoundCall;
Generated\BoundNodes.xml.Generated.cs (17)
2174public BoundAwaitableInfo(SyntaxNode syntax, BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, BoundCall? runtimeAsyncAwaitCall, BoundAwaitableValuePlaceholder? runtimeAsyncAwaitCallPlaceholder, bool hasErrors = false)
2195public BoundCall? RuntimeAsyncAwaitCall { get; }
2201public BoundAwaitableInfo Update(BoundAwaitableValuePlaceholder? awaitableInstancePlaceholder, bool isDynamic, BoundExpression? getAwaiter, PropertySymbol? isCompleted, MethodSymbol? getResult, BoundCall? runtimeAsyncAwaitCall, BoundAwaitableValuePlaceholder? runtimeAsyncAwaitCallPlaceholder)
6258public 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)
6262var result = new BoundCall(this.Syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, argumentNamesOpt, argumentRefKindsOpt, isDelegateCall, expanded, invokedAsExtensionMethod, argsToParamsOpt, defaultArguments, resultKind, originalMethodsOpt, type, this.HasErrors);
9404return VisitCall((BoundCall)node, arg);
9721public virtual R VisitCall(BoundCall node, A arg) => this.DefaultVisit(node, arg);
9962public virtual BoundNode? VisitCall(BoundCall node) => this.DefaultVisit(node);
10740public override BoundNode? VisitCall(BoundCall node)
11455BoundCall? runtimeAsyncAwaitCall = (BoundCall?)this.Visit(node.RuntimeAsyncAwaitCall);
12163public override BoundNode? VisitCall(BoundCall node)
13442BoundCall? runtimeAsyncAwaitCall = (BoundCall?)this.Visit(node.RuntimeAsyncAwaitCall);
14421public override BoundNode? VisitCall(BoundCall node)
14427BoundCall updatedNode;
16917public override TreeDumperNode VisitCall(BoundCall node, object? arg) => new TreeDumperNode("call", null, new TreeDumperNode[]
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (11)
87var falseOperatorCall = BoundCall.Synthesized(syntax, receiverOpt: node.ConstrainedToTypeOpt is null ? null : new BoundTypeExpression(syntax, aliasOpt: null, node.ConstrainedToTypeOpt),
778return BoundCall.Synthesized(
805return BoundCall.Synthesized(
915return BoundCall.Synthesized(
947return BoundCall.Synthesized(
1859BoundExpression callX_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempX, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultX);
1861BoundExpression callY_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempY, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultY);
2024return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
2050: (BoundExpression)BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
2085return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (11)
1151value = BoundCall.Synthesized(syntax, rewrittenOperand, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, get_Value);
1252BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault),
1295return MakeLiftedUserDefinedConversionConsequence(BoundCall.Synthesized(
1442BoundExpression result = BoundCall.Synthesized(
1452private BoundExpression MakeLiftedUserDefinedConversionConsequence(BoundCall call, TypeSymbol resultType)
1516BoundCall callGetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
1521BoundCall userDefinedCall = BoundCall.Synthesized(
1584return BoundCall.Synthesized(
1862return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, operand);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (6)
202BoundCall.Synthesized(
455BoundExpression disposeCall = BoundCall.Synthesized(syntax: forEachSyntax, receiverOpt: boundDisposableVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method: disposeMethod);
716return BoundCall.Synthesized(
725return BoundCall.Synthesized(
1101BoundExpression currentDimensionUpperBound = BoundCall.Synthesized(forEachSyntax, boundArrayVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getUpperBoundMethod, dimensionArgument);
1155BoundExpression currentDimensionLowerBound = BoundCall.Synthesized(forEachSyntax, boundArrayVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getLowerBoundMethod, dimensionArgument);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (5)
142return BoundCall.Synthesized(rewrittenLeft.Syntax, rewrittenLeft, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
149return BoundCall.Synthesized(rewrittenLeft.Syntax, rewrittenLeft, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultDefaultValue, rewrittenRight);
197var boundCall = (BoundCall)expression;
258rewrittenLeft = BoundCall.Synthesized(rewrittenLeft.Syntax, rewrittenLeft, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (11)
196return BoundCall.Synthesized(originalSyntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, finalArguments);
293else if (argument is BoundCall call)
413public bool IsWellKnownConcatMethod(BoundCall call, out ImmutableArray<BoundExpression> arguments)
441public bool IsCharToString(BoundCall call, [NotNullWhen(true)] out BoundExpression? charExpression)
463private readonly bool IsConcatNonArray(BoundCall call, ref MethodSymbol? concatMethod, SpecialMember concatSpecialMember, out ImmutableArray<BoundExpression> arguments)
554args[i] = BoundCall.Synthesized(arg.Syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, stringImplicitConversionToReadOnlySpan, arg);
558var concatCall = BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, spanConcat, args.ToImmutableAndFree());
693return BoundCall.Synthesized(syntax, expr, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, structToStringMethod);
718return BoundCall.Synthesized(syntax, expr, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, objectToStringMethod);
746whenNotNull: BoundCall.Synthesized(
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (15)
117return BoundCall.Synthesized(
170return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredOperand);
211BoundExpression call_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
415return BoundCall.Synthesized(syntax,
442BoundCall.Synthesized(syntax,
481BoundCall increment = makeIncrementCall(syntax, boundTemp, rightOpt, operatorMethod);
497BoundCall increment = makeIncrementCall(syntax, boundTemp, rightOpt, operatorMethod);
523static BoundCall makeIncrementCall(SyntaxNode syntax, BoundLocal boundTemp, BoundExpression? rightOpt, MethodSymbol operatorMethod)
525return BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.False, operatorMethod, rightOpt is null ? [] : [rightOpt]);
812return BoundCall.Synthesized(
839BoundExpression call_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
842BoundExpression userDefinedCall = BoundCall.Synthesized(
989return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, operand);
1004BoundExpression getValueCall = BoundCall.Synthesized(syntax, operand, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
1006BoundExpression methodCall = BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, getValueCall);
Lowering\SyntheticBoundNodeFactory.cs (8)
858public BoundCall Call(BoundExpression? receiver, MethodSymbol method)
863public BoundCall Call(BoundExpression? receiver, MethodSymbol method, BoundExpression arg0, bool useStrictArgumentRefKinds = false)
868public BoundCall Call(BoundExpression? receiver, MethodSymbol method, BoundExpression arg0, BoundExpression arg1, bool useStrictArgumentRefKinds = false)
873public BoundCall Call(BoundExpression? receiver, MethodSymbol method, params BoundExpression[] args)
878public BoundCall Call(BoundExpression? receiver, WellKnownMember method, BoundExpression arg0)
881public BoundCall Call(BoundExpression? receiver, MethodSymbol method, ImmutableArray<BoundExpression> args, bool useStrictArgumentRefKinds = false)
923public BoundCall Call(BoundExpression? receiver, MethodSymbol method, ImmutableArray<RefKind> refKinds, ImmutableArray<BoundExpression> args)
1815return BoundCall.Synthesized(