Binder\Binder_Invocation.cs (7)
1061var call = (BoundCall)expression;
1115private BoundCall BindInvocationExpressionContinued(
1968private BoundCall CreateBadCall(
2023return BoundCall.ErrorCall(node, receiver, method, args, argNames, argRefKinds, isDelegate, invokedAsExtensionMethod: invokedAsExtensionMethod, originalMethods: methods, resultKind: resultKind, binder: this);
2247private BoundCall CreateBadCall(
2262return 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
992return (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)
1549return constructorBody is BoundConstructorMethodBody { Initializer: BoundExpressionStatement { Expression: BoundCall { Method: { MethodKind: MethodKind.Constructor } initializerMethod } } }
6331public override BoundNode? VisitCall(BoundCall node)
6334if (tryGetReceiver(node, out BoundCall? receiver))
6337var calls = ArrayBuilder<BoundCall>.GetInstance();
6345while (tryGetReceiver(node, out BoundCall? receiver2))
6415bool tryGetReceiver(BoundCall node, [MaybeNullWhen(returnValue: false)] out BoundCall receiver)
6417if (node.ReceiverOpt is BoundCall instanceReceiver)
6423if (node.InvokedAsExtensionMethod && node.Arguments is [BoundCall extensionReceiver, ..] &&
6436TypeWithState visitAndCheckReceiver(BoundCall node)
6450void reinferMethodAndVisitArguments(BoundCall node, TypeWithState receiverType, VisitResult? firstArgumentResult = null)
6571private void LearnFromEqualsMethod(MethodSymbol method, BoundCall node, TypeWithState receiverType, ImmutableArray<VisitResult> results)
7168if (node is BoundCall { HasErrors: true, ArgumentNamesOpt.IsDefaultOrEmpty: false, ArgsToParamsOpt.IsDefault: true } &&
7212if (node is BoundCall { Method: { OriginalDefinition: LocalFunctionSymbol localFunction } })
10528var invocation = conversion.DeconstructionInfo.Invocation as BoundCall;
Generated\BoundNodes.xml.Generated.cs (10)
6187public 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)
6191var result = new BoundCall(this.Syntax, receiverOpt, initialBindingReceiverIsSubjectToCloning, method, arguments, argumentNamesOpt, argumentRefKindsOpt, isDelegateCall, expanded, invokedAsExtensionMethod, argsToParamsOpt, defaultArguments, resultKind, originalMethodsOpt, type, this.HasErrors);
9196return VisitCall((BoundCall)node, arg);
9505public virtual R VisitCall(BoundCall node, A arg) => this.DefaultVisit(node, arg);
9741public virtual BoundNode? VisitCall(BoundCall node) => this.DefaultVisit(node);
10497public override BoundNode? VisitCall(BoundCall node)
11885public override BoundNode? VisitCall(BoundCall node)
14114public override BoundNode? VisitCall(BoundCall node)
14120BoundCall updatedNode;
16570public 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),
777return BoundCall.Synthesized(
804return BoundCall.Synthesized(
914return BoundCall.Synthesized(
946return BoundCall.Synthesized(
1858BoundExpression callX_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempX, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultX);
1860BoundExpression callY_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTempY, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefaultY);
2023return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
2049: (BoundExpression)BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
2084return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, loweredLeft, loweredRight);
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (5)
44return BoundCall.Synthesized(syntax, VisitExpression(node.Left), initialBindingReceiverIsSubjectToCloning: ThreeState.False, node.Operator.Method, VisitExpression(node.Right));
60sideEffects: [tempAssignment, BoundCall.Synthesized(syntax, targetOfCompoundOperation, initialBindingReceiverIsSubjectToCloning: ThreeState.False, node.Operator.Method, VisitExpression(node.Right))],
757Debug.Assert(((BoundCall)originalLHS).Method.RefKind != RefKind.None);
973var call = (BoundCall)expression;
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (10)
1079value = BoundCall.Synthesized(syntax, rewrittenOperand, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, get_Value);
1179BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault),
1222return MakeLiftedUserDefinedConversionConsequence(BoundCall.Synthesized(
1367BoundExpression result = BoundCall.Synthesized(
1377private BoundExpression MakeLiftedUserDefinedConversionConsequence(BoundCall call, TypeSymbol resultType)
1439BoundCall callGetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
1444BoundCall userDefinedCall = BoundCall.Synthesized(
1743return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, operand);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (6)
198BoundCall.Synthesized(
444BoundExpression disposeCall = BoundCall.Synthesized(syntax: forEachSyntax, receiverOpt: boundDisposableVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method: disposeMethod);
703return BoundCall.Synthesized(
712return BoundCall.Synthesized(
1088BoundExpression currentDimensionUpperBound = BoundCall.Synthesized(forEachSyntax, boundArrayVar, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getUpperBoundMethod, dimensionArgument);
1142BoundExpression 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 (12)
196return BoundCall.Synthesized(originalSyntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, finalArguments);
222not (BoundCall or BoundConversion { ConversionKind: ConversionKind.Boxing, Type.SpecialType: SpecialType.System_Object, Operand.Type.SpecialType: SpecialType.System_Char })
290else if (argument is BoundCall call)
366public bool IsWellKnownConcatMethod(BoundCall call, out ImmutableArray<BoundExpression> arguments)
394public bool IsCharToString(BoundCall call, [NotNullWhen(true)] out BoundExpression? charExpression)
416private readonly bool IsConcatNonArray(BoundCall call, ref MethodSymbol? concatMethod, SpecialMember concatSpecialMember, out ImmutableArray<BoundExpression> arguments)
507args[i] = BoundCall.Synthesized(arg.Syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, stringImplicitConversionToReadOnlySpan, arg);
511var concatCall = BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, spanConcat, args.ToImmutableAndFree());
646return BoundCall.Synthesized(syntax, expr, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, structToStringMethod);
671return BoundCall.Synthesized(syntax, expr, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, objectToStringMethod);
699whenNotNull: BoundCall.Synthesized(
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (15)
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);
413return BoundCall.Synthesized(syntax, VisitExpression(node.Operand), initialBindingReceiverIsSubjectToCloning: ThreeState.False, node.MethodOpt);
434sideEffects: [tempAssignment, BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.False, node.MethodOpt)],
467BoundCall increment = makeIncrementCall(syntax, boundTemp, rightOpt, operatorMethod);
483BoundCall increment = makeIncrementCall(syntax, boundTemp, rightOpt, operatorMethod);
509static BoundCall makeIncrementCall(SyntaxNode syntax, BoundLocal boundTemp, BoundExpression? rightOpt, MethodSymbol operatorMethod)
511return BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.False, operatorMethod, rightOpt is null ? [] : [rightOpt]);
784return BoundCall.Synthesized(
811BoundExpression call_GetValueOrDefault = BoundCall.Synthesized(syntax, boundTemp, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
814BoundExpression userDefinedCall = BoundCall.Synthesized(
961return BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, operand);
976BoundExpression getValueCall = BoundCall.Synthesized(syntax, operand, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault);
978BoundExpression methodCall = BoundCall.Synthesized(syntax, receiverOpt: null, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, method, getValueCall);
Lowering\SyntheticBoundNodeFactory.cs (8)
855public BoundCall Call(BoundExpression? receiver, MethodSymbol method)
860public BoundCall Call(BoundExpression? receiver, MethodSymbol method, BoundExpression arg0, bool useStrictArgumentRefKinds = false)
865public BoundCall Call(BoundExpression? receiver, MethodSymbol method, BoundExpression arg0, BoundExpression arg1, bool useStrictArgumentRefKinds = false)
870public BoundCall Call(BoundExpression? receiver, MethodSymbol method, params BoundExpression[] args)
875public BoundCall Call(BoundExpression? receiver, WellKnownMember method, BoundExpression arg0)
878public BoundCall Call(BoundExpression? receiver, MethodSymbol method, ImmutableArray<BoundExpression> args, bool useStrictArgumentRefKinds = false)
920public BoundCall Call(BoundExpression? receiver, MethodSymbol method, ImmutableArray<RefKind> refKinds, ImmutableArray<BoundExpression> args)
1832return BoundCall.Synthesized(