Binder\Binder_Invocation.cs (7)
1044var call = (BoundCall)expression;
1098private BoundCall BindInvocationExpressionContinued(
1912private BoundCall CreateBadCall(
1953return BoundCall.ErrorCall(node, receiver, method, args, argNames, argRefKinds, isDelegate, invokedAsExtensionMethod: invokedAsExtensionMethod, originalMethods: methods, resultKind: resultKind, binder: this);
2166private BoundCall CreateBadCall(
2181return 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)
683var i1 = r1 != null ? r1.ExpressionOpt as BoundCall : null;
757var invocation = MakeQueryInvocation(let, state.fromExpression, "Select", lambda, diagnostics
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
913protected BoundCall MakeQueryInvocation(CSharpSyntaxNode node, BoundExpression receiver, string methodName, SeparatedSyntaxList<TypeSyntax> typeArgsSyntax, ImmutableArray<TypeWithAnnotations> typeArgs, ImmutableArray<BoundExpression> args, BindingDiagnosticBag diagnostics
1008return (BoundCall)MakeInvocationExpression(
BoundTree\Constructors.cs (8)
106public BoundCall Update(BoundExpression? receiverOpt,
121public static BoundCall ErrorCall(
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)
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)
CodeGen\EmitExpression.cs (19)
103EmitCallExpression((BoundCall)expression, used ? UseKind.UsedAsValue : UseKind.Unused);
630protected override void VisitReceiver(BoundCall node)
1618private void EmitCallExpression(BoundCall call, UseKind useKind)
1635private void EmitDefaultValueTypeConstructorCallExpression(BoundCall call)
1655private void EmitStaticCallExpression(BoundCall call, UseKind useKind)
1686private void EmitInstanceCallExpression(BoundCall call, UseKind useKind)
1693if (receiverIsInstanceCall(call, out BoundCall nested))
1695var calls = ArrayBuilder<BoundCall>.GetInstance();
1823CallKind determineEmitReceiverStrategy(BoundCall call, out AddressKind? addressKind, out bool box)
1914void emitReceiver(BoundCall call, CallKind callKind, AddressKind? addressKind, bool box, out LocalDefinition tempOpt)
1940void emitArgumentsAndCallEpilogue(BoundCall call, CallKind callKind, UseKind useKind)
2020void emitGenericReceiverCloneIfNecessary(BoundCall call, CallKind callKind, ref LocalDefinition tempOpt)
2071static bool receiverIsInstanceCall(BoundCall call, out BoundCall nested)
2073if (call.ReceiverOpt is BoundCall { Method: { RequiresInstanceReceiver: true } method } receiver && !method.IsDefaultValueTypeConstructor())
2220return ((BoundCall)receiver).Method.RefKind != RefKind.None;
2929var left = (BoundCall)assignmentTarget;
3133Debug.Assert(((BoundCall)expression).Method.RefKind != RefKind.None);
FlowAnalysis\NullableWalker.cs (16)
1461return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } }
6172public override BoundNode? VisitCall(BoundCall node)
6175if (tryGetReceiver(node, out BoundCall? receiver))
6178var calls = ArrayBuilder<BoundCall>.GetInstance();
6186while (tryGetReceiver(node, out BoundCall? receiver2))
6241bool tryGetReceiver(BoundCall node, [MaybeNullWhen(returnValue: false)] out BoundCall receiver)
6243if (node.ReceiverOpt is BoundCall instanceReceiver)
6249if (node.InvokedAsExtensionMethod && node.Arguments is [BoundCall extensionReceiver, ..] &&
6262TypeWithState visitAndCheckReceiver(BoundCall node)
6275void reinferMethodAndVisitArguments(BoundCall node, TypeWithState receiverType, VisitResult? firstArgumentResult = null)
6305private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitResult> results)
6877if (node is BoundCall { HasErrors: true, ArgumentNamesOpt.IsDefaultOrEmpty: false, ArgsToParamsOpt.IsDefault: true } &&
6917if (node is BoundCall { Method: { OriginalDefinition: LocalFunctionSymbol localFunction } })
10159var invocation = conversion.DeconstructionInfo.Invocation as BoundCall;
Generated\BoundNodes.xml.Generated.cs (10)
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)
6188var result = new BoundCall(this.Syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, argumentNamesOpt, argumentRefKindsOpt, isDelegateCall, expanded, invokedAsExtensionMethod, argsToParamsOpt, defaultArguments, resultKind, originalMethodsOpt, type, this.HasErrors);
9157return VisitCall((BoundCall)node, arg);
9466public virtual R VisitCall(BoundCall node, A arg) => this.DefaultVisit(node, arg);
9702public virtual BoundNode? VisitCall(BoundCall node) => this.DefaultVisit(node);
10458public override BoundNode? VisitCall(BoundCall node)
11737public override BoundNode? VisitCall(BoundCall node)
13928public override BoundNode? VisitCall(BoundCall node)
13934BoundCall updatedNode;
16383public 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),
759return BoundCall.Synthesized(
786return BoundCall.Synthesized(
896return BoundCall.Synthesized(
928return BoundCall.Synthesized(
1840BoundExpression callX_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempX, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultX);
1842BoundExpression callY_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempY, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultY);
2005return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
2031: (BoundExpression)BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
2066return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (10)
1081value = BoundCall.Synthesized(syntax, rewrittenOperand, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, get_Value);
1181BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault),
1224return MakeLiftedUserDefinedConversionConsequence(BoundCall.Synthesized(
1369BoundExpression result = BoundCall.Synthesized(
1379private BoundExpression MakeLiftedUserDefinedConversionConsequence(BoundCall call, TypeSymbol resultType)
1441BoundCall callGetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
1446BoundCall userDefinedCall = BoundCall.Synthesized(
1745return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, operand);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (7)
198BoundCall.Synthesized(
445BoundExpression disposeCall = BoundCall.Synthesized(syntax: forEachSyntax, receiverOpt: boundDisposableVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method: disposeMethod);
548return BoundCall.Synthesized(syntax, receiver, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, methodArgumentInfo.Method, arguments: ImmutableArray<BoundExpression>.Empty);
717return BoundCall.Synthesized(
726return BoundCall.Synthesized(
1102BoundExpression currentDimensionUpperBound = BoundCall.Synthesized(forEachSyntax, boundArrayVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getUpperBoundMethod, dimensionArgument);
1156BoundExpression 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 (15)
171case BoundCall boundCall:
217case BoundSequence { SideEffects.Length: 0, Value: BoundCall sequenceCall } sequence:
235case BoundCall { Method: var argMethod, Arguments: [var singleArgument] } when (object)argMethod == _compilation.GetSpecialTypeMember(SpecialMember.System_String__op_Implicit_ToReadOnlySpanOfChar):
377return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
389return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, ImmutableArray.Create(loweredFirst, loweredSecond, loweredThird));
402return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, ImmutableArray.Create(loweredFirst, loweredSecond, loweredThird, loweredFourth));
415return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, array);
434if (arg is BoundCall { ReceiverOpt: { Type: NamedTypeSymbol { SpecialType: SpecialType.System_Char } receiverCharType } receiver } potentialToStringCall &&
570preparedArgsBuilder.Add(BoundCall.Synthesized(arg.Syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, stringImplicitConversionToReadOnlySpan, arg));
574var concatCall = BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, spanConcat, preparedArgsBuilder.ToImmutableAndFree());
626if (expr is BoundCall { Type.SpecialType: SpecialType.System_String, Method: { Name: "ToString" } method, ReceiverOpt: { Type: NamedTypeSymbol { SpecialType: SpecialType.System_Char } charType, ConstantValueOpt.IsChar: true } } call &&
689return BoundCall.Synthesized(syntax, expr, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, structToStringMethod);
714return BoundCall.Synthesized(syntax, expr, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, objectToStringMethod);
742whenNotNull: BoundCall.Synthesized(
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (9)
116return BoundCall.Synthesized(
169return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredOperand);
210BoundExpression call_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
651return BoundCall.Synthesized(
678BoundExpression call_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
681BoundExpression userDefinedCall = BoundCall.Synthesized(
828return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, operand);
843BoundExpression getValueCall = BoundCall.Synthesized(syntax, operand, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
845BoundExpression methodCall = BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, getValueCall);
Lowering\SyntheticBoundNodeFactory.cs (8)
824public BoundCall Call(BoundExpression? receiver, MethodSymbol method)
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)
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)
1796return BoundCall.Synthesized(