14 instantiations of BoundBinaryOperator
Microsoft.CodeAnalysis.CSharp (14)
Binder\Binder_InterpolatedString.cs (1)
541=> new BoundBinaryOperator(
Compiler\MethodBodySynthesizer.cs (1)
497BoundExpression loopExitCondition = new BoundBinaryOperator(syntax,
Generated\BoundNodes.xml.Generated.cs (1)
1685var result = new BoundBinaryOperator(this.Syntax, operatorKind, data, resultKind, left, right, type, this.HasErrors);
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (5)
534new BoundBinaryOperator(syntax, operatorKind, constantValueOpt: null, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Viable, loweredLeft, loweredRight, type); 2020return new BoundBinaryOperator(syntax, operatorKind, constantValueOpt: null, methodOpt: null, constrainedToTypeOpt: null, LookupResultKind.Empty, loweredLeft, loweredRight, type); 2030? new BoundBinaryOperator(syntax, operatorKind, null, method, constrainedToTypeOpt: null, default(LookupResultKind), loweredLeft, loweredRight, method.ReturnType) 2154loweredRight = new BoundBinaryOperator( 2167? new BoundBinaryOperator(
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
460rewrittenBoundCall = new BoundBinaryOperator(
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (4)
666BoundExpression exitCondition = new BoundBinaryOperator( 962BoundExpression exitCondition = new BoundBinaryOperator( 1166BoundExpression exitCondition = new BoundBinaryOperator( 1261right: new BoundBinaryOperator(syntax,
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (1)
602return new BoundBinaryOperator(syntax, operatorKind, constantValueOpt: null, method, constrainedToTypeOpt: null, default(LookupResultKind), loweredLeft, loweredRight, type);
215 references to BoundBinaryOperator
Microsoft.CodeAnalysis.CSharp (215)
Binder\Binder.ValueChecks.cs (7)
3596Debug.Assert(expr is BoundBinaryOperator binaryOperator && 3966Debug.Assert(expr is BoundBinaryOperator binaryOperator && 4407var binary = (BoundBinaryOperator)expr; 5198var binary = (BoundBinaryOperator)expr; 5629case BoundBinaryOperator binary:
Binder\Binder_Expressions.cs (4)
387case BoundBinaryOperator unconvertedBinaryOperator: 3518Debug.Assert(argument is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 3693Debug.Assert(unconvertedString is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 6398({ Type: null } or BoundLiteral or BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }) &&
Binder\Binder_InterpolatedString.cs (14)
438private bool TryBindUnconvertedBinaryOperatorToDefaultInterpolatedStringHandler(BoundBinaryOperator binaryOperator, BindingDiagnosticBag diagnostics, [NotNullWhen(true)] out BoundBinaryOperator? convertedBinaryOperator) 515private BoundBinaryOperator UpdateBinaryOperatorWithInterpolatedContents(BoundBinaryOperator originalOperator, ImmutableArray<ImmutableArray<BoundExpression>> appendCalls, InterpolatedStringHandlerData data, SyntaxNode rootSyntax, BindingDiagnosticBag diagnostics) 521Func<BoundBinaryOperator, BoundExpression, BoundExpression, (ImmutableArray<ImmutableArray<BoundExpression>>, TypeSymbol), BoundExpression> binaryOperatorFactory = 524var rewritten = (BoundBinaryOperator)originalOperator.RewriteInterpolatedStringAddition((appendCalls, @string), interpolationFactory, binaryOperatorFactory); 526return rewritten.Update(BoundBinaryOperator.UncommonData.InterpolatedStringHandlerAddition(data)); 540static BoundBinaryOperator createBinaryOperator(BoundBinaryOperator original, BoundExpression left, BoundExpression right, (ImmutableArray<ImmutableArray<BoundExpression>> _, TypeSymbol @string) arg) 570BoundBinaryOperator binary => BindUnconvertedBinaryOperatorToInterpolatedStringHandlerType(binary, interpolatedStringHandlerType, diagnostics, additionalConstructorArguments, additionalConstructorRefKinds), 601private BoundBinaryOperator BindUnconvertedBinaryOperatorToInterpolatedStringHandlerType( 602BoundBinaryOperator binaryOperator, 628var result = UpdateBinaryOperatorWithInterpolatedContents(binaryOperator, appendCalls, data, binaryOperator.Syntax, diagnostics);
Binder\Binder_Operators.cs (9)
554&& left is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true } 555&& right is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }) 559return new BoundBinaryOperator(node, BinaryOperatorKind.StringConcatenation, BoundBinaryOperator.UncommonData.UnconvertedInterpolatedStringAddition(stringConstant), LookupResultKind.Empty, left, right, right.Type); 755private BoundExpression RebindSimpleBinaryOperatorAsConverted(BoundBinaryOperator unconvertedBinaryOperator, BindingDiagnosticBag diagnostics) 757if (TryBindUnconvertedBinaryOperatorToDefaultInterpolatedStringHandler(unconvertedBinaryOperator, diagnostics, out var convertedBinaryOperator)) 765BoundExpression doRebind(BindingDiagnosticBag diagnostics, BoundBinaryOperator? current) 767var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 772current = current.Left as BoundBinaryOperator; 783BoundBinaryOperator b => doRebind(diagnostics, b),
Binder\Binder_TupleOperators.cs (1)
105case BoundBinaryOperator binary:
Binder\RefSafetyAnalysis.cs (2)
265protected override void BeforeVisitingSkippedBoundBinaryOperatorChildren(BoundBinaryOperator node) 665if (arg is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion)
Binder\Semantics\Conversions\Conversions.cs (1)
143if (source is BoundBinaryOperator)
Binder\Semantics\Conversions\ConversionsBase.cs (1)
1106case BoundKind.BinaryOperator when ((BoundBinaryOperator)sourceExpression).IsUnconvertedInterpolatedStringAddition:
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
774return value is BoundUtf8String or BoundBinaryOperator { OperatorKind: BinaryOperatorKind.Utf8Addition };
Binder\Semantics\OverloadResolution\OverloadResolution.cs (3)
2626Debug.Assert(!isInterpolatedStringHandlerConversion || arguments[i] is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }); 2923node is BoundUnconvertedInterpolatedString { ConstantValueOpt: null } or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true, ConstantValueOpt: null }) 4464&& argument is BoundUnconvertedInterpolatedString or BoundBinaryOperator { IsUnconvertedInterpolatedStringAddition: true }
BoundTree\BoundExpression.cs (1)
90return ((BoundBinaryOperator)this).IsUnconvertedInterpolatedStringAddition;
BoundTree\BoundNode_Source.cs (1)
352case BoundBinaryOperator binary:
BoundTree\BoundNodeExtensions.cs (25)
108this BoundBinaryOperator binary, 111Action<BoundBinaryOperator, TArg>? binaryOperatorCallback = null) 114var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 118while (stack.TryPop(out BoundBinaryOperator? current)) 122case BoundBinaryOperator: 136case BoundBinaryOperator rightOperator: 154static void pushLeftNodes(BoundBinaryOperator binary, ArrayBuilder<BoundBinaryOperator> stack, TArg arg, Action<BoundBinaryOperator, TArg>? binaryOperatorCallback) 157BoundBinaryOperator? current = binary; 162current = current.Left as BoundBinaryOperator; 183this BoundBinaryOperator binary, 186Func<BoundBinaryOperator, TResult, TResult, TArg, TResult> binaryOperatorFactory) 196BoundBinaryOperator binary, 199Func<BoundBinaryOperator, TResult, TResult, TArg, TResult> binaryOperatorFactory, 203var originalStack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 213BoundBinaryOperator => result!, 224BoundBinaryOperator binaryOperator => doRewrite(binaryOperator, arg, interpolatedStringFactory, binaryOperatorFactory, ref i), 237static void pushLeftNodes(BoundBinaryOperator binary, ArrayBuilder<BoundBinaryOperator> stack) 239BoundBinaryOperator? current = binary; 244current = current.Left as BoundBinaryOperator; 252BoundBinaryOperator { InterpolatedStringHandlerData: { } d } => d, 254BoundBinaryOperator or BoundInterpolatedString when !throwOnMissing => default, 255BoundBinaryOperator or BoundInterpolatedString => throw ExceptionUtilities.Unreachable(),
BoundTree\BoundTreeRewriter.cs (5)
109public sealed override BoundNode? VisitBinaryOperator(BoundBinaryOperator node) 118var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 121BoundBinaryOperator binary = (BoundBinaryOperator)child; 133binary = (BoundBinaryOperator)child;
BoundTree\BoundTreeVisitors.cs (1)
42return VisitBinaryOperator(node as BoundBinaryOperator, arg);
BoundTree\BoundTreeWalker.cs (4)
105public sealed override BoundNode? VisitBinaryOperator(BoundBinaryOperator node) 107if (node.Left is not BoundBinaryOperator binary) 123binary = (BoundBinaryOperator)current; 141protected virtual void BeforeVisitingSkippedBoundBinaryOperatorChildren(BoundBinaryOperator node)
BoundTree\Constructors.cs (2)
465public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, 478public BoundBinaryOperator Update(UncommonData uncommonData)
BoundTree\NullabilityRewriter.cs (2)
20public override BoundNode? VisitBinaryOperator(BoundBinaryOperator node) 100BoundBinaryOperator binary => binary.Update(
CodeGen\EmitConversion.cs (1)
160(fromPredefTypeKind == Cci.PrimitiveTypeCode.IntPtr && conversion.Operand is BoundBinaryOperator { OperatorKind: BinaryOperatorKind.Division })); // pointer subtraction: see LocalRewriter.RewritePointerSubtraction()
CodeGen\EmitExpression.cs (3)
202EmitBinaryOperatorExpression((BoundBinaryOperator)expression, used); 2153BoundBinaryOperator b = (BoundBinaryOperator)current;
CodeGen\EmitOperators.cs (16)
58private void EmitBinaryOperatorExpression(BoundBinaryOperator expression, bool used) 90private void EmitBinaryOperator(BoundBinaryOperator expression) 100BoundBinaryOperator binary = (BoundBinaryOperator)child; 110var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 123binary = (BoundBinaryOperator)child; 157private void EmitBinaryOperatorSimple(BoundBinaryOperator expression) 175private void EmitBinaryOperatorInstruction(BoundBinaryOperator expression) 249private void EmitShortCircuitingOperator(BoundBinaryOperator condition, bool sense, bool stopSense, bool stopValue) 297private void EmitBinaryCondOperator(BoundBinaryOperator binOp, bool sense) 509var binOp = (BoundBinaryOperator)condition; 540if (condition is BoundBinaryOperator binOp) 620private void EmitConversionToEnumUnderlyingType(BoundBinaryOperator expression, bool @checked) 696private void EmitBinaryCheckedOperatorInstruction(BoundBinaryOperator expression) 776private static bool IsUnsignedBinaryOperator(BoundBinaryOperator op)
CodeGen\EmitStatement.cs (5)
228private static BoundExpression TryReduce(BoundBinaryOperator condition, ref bool sense) 299private static ILOpCode CodeForJump(BoundBinaryOperator op, bool sense, out ILOpCode revOpCode) 420var binOp = (BoundBinaryOperator)condition; 444top.condition is BoundBinaryOperator binary &&
CodeGen\Optimizer.cs (11)
1473public override BoundNode VisitBinaryOperator(BoundBinaryOperator node) 1483var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 1486BoundBinaryOperator binary = (BoundBinaryOperator)child; 1498binary = (BoundBinaryOperator)child; 1546private BoundNode VisitBinaryOperatorSimple(BoundBinaryOperator node) 2067public override BoundNode VisitBinaryOperator(BoundBinaryOperator node) 2077var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 2080BoundBinaryOperator binary = (BoundBinaryOperator)child; 2092binary = (BoundBinaryOperator)child;
Compilation\CSharpSemanticModel.cs (2)
3547GetSymbolsAndResultKind((BoundBinaryOperator)boundNode, out isDynamic, ref resultKind, ref symbols); 3840private static void GetSymbolsAndResultKind(BoundBinaryOperator binaryOperator, out bool isDynamic, ref LookupResultKind resultKind, ref OneOrMany<Symbol> symbols)
Compilation\MemberSemanticModel.NodeMapBuilder.cs (4)
194if (current is BoundBinaryOperator binOp) 200binOp = current as BoundBinaryOperator; 211binOp = current as BoundBinaryOperator; 309public override BoundNode VisitBinaryOperator(BoundBinaryOperator node)
FlowAnalysis\AbstractFlowPass.cs (15)
2384public override BoundNode VisitBinaryOperator(BoundBinaryOperator node) 2423var binOp = (BoundBinaryOperator)child; 2460var binOp = (BoundBinaryOperator)binary; 2531private void VisitBinaryOperatorChildren(BoundBinaryOperator node) 2538var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 2540BoundBinaryOperator binary = node; 2545binary = binary.Left as BoundBinaryOperator; 2555protected virtual void VisitBinaryOperatorChildren(ArrayBuilder<BoundBinaryOperator> stack) 2625static bool canLearnFromOperator(BoundBinaryOperator binary) 2639static bool isEquals(BoundBinaryOperator binary) 2643bool learnFromOperator(BoundBinaryOperator binary) 2684protected void VisitBinaryInterpolatedStringAddition(BoundBinaryOperator node) 2721protected virtual void VisitInterpolatedStringBinaryOperatorNode(BoundBinaryOperator node) { }
FlowAnalysis\NullableWalker.cs (7)
4942protected override void VisitBinaryOperatorChildren(ArrayBuilder<BoundBinaryOperator> stack) 5023static bool isEquals(BoundBinaryOperator binary) 5126BoundBinaryOperator binary) 5270BoundBinaryOperator binary) 5359protected override void VisitInterpolatedStringBinaryOperatorNode(BoundBinaryOperator node) 11425Debug.Assert(!((BoundBinaryOperator)node).OperatorKind.IsUserDefined()); 11476BoundBinaryOperator binary => InferResultNullability(binary.OperatorKind, binary.Method, binary.Type, leftType, rightType),
FlowAnalysis\NullableWalker.DebugVerifier.cs (1)
289public override BoundNode? VisitBinaryOperator(BoundBinaryOperator node)
Generated\BoundNodes.xml.Generated.cs (11)
1661public BoundBinaryOperator(SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type, bool hasErrors = false) 1675public BoundBinaryOperator.UncommonData? Data { get; } 1681public BoundBinaryOperator Update(BinaryOperatorKind operatorKind, BoundBinaryOperator.UncommonData? data, LookupResultKind resultKind, BoundExpression left, BoundExpression right, TypeSymbol type) 1685var result = new BoundBinaryOperator(this.Syntax, operatorKind, data, resultKind, left, right, type, this.HasErrors); 8946return VisitBinaryOperator((BoundBinaryOperator)node, arg); 9379public virtual R VisitBinaryOperator(BoundBinaryOperator node, A arg) => this.DefaultVisit(node, arg); 9615public virtual BoundNode? VisitBinaryOperator(BoundBinaryOperator node) => this.DefaultVisit(node); 9943public override BoundNode? VisitBinaryOperator(BoundBinaryOperator node) 11053public override BoundNode? VisitBinaryOperator(BoundBinaryOperator node) 15327public override TreeDumperNode VisitBinaryOperator(BoundBinaryOperator node, object? arg) => new TreeDumperNode("binaryOperator", null, new TreeDumperNode[]
Lowering\AsyncRewriter\AsyncIteratorMethodToStateMachineRewriter.cs (1)
223protected override BoundBinaryOperator ShouldEnterFinallyBlock()
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (2)
194var binOp = (BoundBinaryOperator)node;
Lowering\DiagnosticsPass_ExpressionTrees.cs (4)
649public override BoundNode VisitBinaryOperator(BoundBinaryOperator node) 659BoundBinaryOperator current = node; 667current = (BoundBinaryOperator)current.Left; 727private void CheckDynamic(BoundBinaryOperator node)
Lowering\DiagnosticsPass_Warnings.cs (6)
250private void CheckBinaryOperator(BoundBinaryOperator node) 304private void CheckRelationals(BoundBinaryOperator node) 381private void CheckSelfComparisons(BoundBinaryOperator node) 392private void CheckVacuousComparisons(BoundBinaryOperator tree, ConstantValue constantValue, BoundNode operand) 749private void CheckNullableNullBinOp(BoundBinaryOperator node) 780private void CheckLiftedBinOp(BoundBinaryOperator node)
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (13)
16public override BoundNode VisitBinaryOperator(BoundBinaryOperator node) 113public BoundExpression VisitBinaryOperator(BoundBinaryOperator node, BoundUnaryOperator? applyParentUnaryOperator) 133var stack = ArrayBuilder<BoundBinaryOperator>.GetInstance(); 135for (BoundBinaryOperator? current = node; current != null && current.ConstantValueOpt == null; current = current.Left as BoundBinaryOperator) 150BoundBinaryOperator original = stack.Pop(); 160private static ImmutableArray<BoundExpression> CollectBinaryOperatorInterpolatedStringParts(BoundBinaryOperator node) 190BoundBinaryOperator? oldNode, 1995private BoundExpression RewriteStringEquality(BoundBinaryOperator? oldNode, SyntaxNode syntax, BinaryOperatorKind operatorKind, BoundExpression loweredLeft, BoundExpression loweredRight, TypeSymbol type, SpecialMember member) 2127BoundBinaryOperator? oldNode, 2189BoundBinaryOperator? oldNode, 2240var result = oldNode == null 2440var multiplication = _factory.Binary(multiplicationKind, multiplicationResultType, numericOperand, sizeOfExpression);
Lowering\LocalRewriter\LocalRewriter_Call.cs (2)
835if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion) 908if (argument is BoundConversion { ConversionKind: ConversionKind.InterpolatedStringHandler, Operand: BoundInterpolatedString or BoundBinaryOperator } conversion)
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (3)
30BoundBinaryOperator { InterpolatedStringHandlerData: { } d } binary => (d, CollectBinaryOperatorInterpolatedStringParts(binary)), 166private BoundExpression VisitUtf8Addition(BoundBinaryOperator node) 195case BoundBinaryOperator utf8Addition:
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
50var binaryOperator = (BoundBinaryOperator)node.Operand;
Lowering\MethodToClassRewriter.cs (1)
265public override BoundNode VisitBinaryOperator(BoundBinaryOperator node)
Lowering\SpillSequenceSpiller.cs (1)
980public override BoundNode VisitBinaryOperator(BoundBinaryOperator node)
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
927protected virtual BoundBinaryOperator ShouldEnterFinallyBlock()
Lowering\SyntheticBoundNodeFactory.cs (11)
629public BoundBinaryOperator Binary(BinaryOperatorKind kind, TypeSymbol type, BoundExpression left, BoundExpression right) 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) 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)
Operations\CSharpOperationFactory.cs (8)
1448if (boundBinaryOperatorBase is BoundBinaryOperator { InterpolatedStringHandlerData: not null } binary) 1462} while (currentBinary is not null and not BoundBinaryOperator { InterpolatedStringHandlerData: not null }); 1473BoundBinaryOperator binaryOp => CreateBoundBinaryOperatorOperation(binaryOp, left, right), 1507private IBinaryOperation CreateBoundBinaryOperatorOperation(BoundBinaryOperator boundBinaryOperator, IOperation left, IOperation right) 1536private IOperation CreateBoundInterpolatedStringBinaryOperator(BoundBinaryOperator boundBinaryOperator) 1542Func<BoundBinaryOperator, IOperation, IOperation, (CSharpOperationFactory, InterpolatedStringHandlerData), IOperation> createBinaryOperator 1554BoundBinaryOperator boundBinaryOperator, 2439case BoundBinaryOperator binaryOperator: