385 references to BinaryOperatorKind
Microsoft.CodeAnalysis (46)
Generated\Operations.Generated.cs (20)
1031BinaryOperatorKind OperatorKind { get; }
1409BinaryOperatorKind OperatorKind { get; }
2563BinaryOperatorKind Relation { get; }
2750BinaryOperatorKind OperatorKind { get; }
3269/// Kind of binary pattern; either <see cref="BinaryOperatorKind.And" /> or <see cref="BinaryOperatorKind.Or" />.
3271BinaryOperatorKind OperatorKind { get; }
3323BinaryOperatorKind OperatorKind { get; }
5269internal BinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, bool isLifted, bool isChecked, bool isCompareText, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IMethodSymbol? unaryOperatorMethod, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, ConstantValue? constantValue, bool isImplicit)
5284public BinaryOperatorKind OperatorKind { get; }
5933internal CompoundAssignmentOperation(IConvertibleConversion inConversion, IConvertibleConversion outConversion, BinaryOperatorKind operatorKind, bool isLifted, bool isChecked, IMethodSymbol? operatorMethod, ITypeSymbol? constrainedToType, IOperation target, IOperation value, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
5949public BinaryOperatorKind OperatorKind { get; }
7902internal RelationalCaseClauseOperation(IOperation value, BinaryOperatorKind relation, ILabelSymbol? label, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit)
7909public BinaryOperatorKind Relation { get; }
8219internal TupleBinaryOperation(BinaryOperatorKind operatorKind, IOperation leftOperand, IOperation rightOperand, SemanticModel? semanticModel, SyntaxNode syntax, ITypeSymbol? type, bool isImplicit)
8227public BinaryOperatorKind OperatorKind { get; }
9516internal BinaryPatternOperation(BinaryOperatorKind operatorKind, IPatternOperation leftPattern, IPatternOperation rightPattern, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit)
9523public BinaryOperatorKind OperatorKind { get; }
9598internal RelationalPatternOperation(BinaryOperatorKind operatorKind, IOperation value, ITypeSymbol inputType, ITypeSymbol narrowedType, SemanticModel? semanticModel, SyntaxNode syntax, bool isImplicit)
9604public BinaryOperatorKind OperatorKind { get; }
Operations\ControlFlowGraphBuilder.cs (26)
2139case BinaryOperatorKind.ConditionalOr:
2140case BinaryOperatorKind.ConditionalAnd:
2256case BinaryOperatorKind.ConditionalOr:
2260case BinaryOperatorKind.ConditionalAnd:
2522new BinaryOperation(isAndAlso ? BinaryOperatorKind.And : BinaryOperatorKind.Or,
2612new BinaryOperation(isAndAlso ? BinaryOperatorKind.And : BinaryOperatorKind.Or,
4863isUp = new BinaryOperation(BinaryOperatorKind.GreaterThanOrEqual,
4983var comparisonKind = BinaryOperatorKind.None;
4988comparisonKind = BinaryOperatorKind.LessThanOrEqual;
4995comparisonKind = BinaryOperatorKind.GreaterThanOrEqual;
4999comparisonKind = BinaryOperatorKind.LessThanOrEqual;
5006if (comparisonKind == BinaryOperatorKind.None && ITypeSymbolHelpers.IsSignedIntegralType(stepEnumUnderlyingTypeOrSelf))
5008comparisonKind = BinaryOperatorKind.LessThanOrEqual;
5015if (comparisonKind != BinaryOperatorKind.None)
5054eitherLimitOrControlVariableIsNull = new BinaryOperation(BinaryOperatorKind.Or,
5095condition = new BinaryOperation(BinaryOperatorKind.LessThanOrEqual,
5115condition = new BinaryOperation(BinaryOperatorKind.GreaterThanOrEqual,
5149var shiftedStep = new BinaryOperation(BinaryOperatorKind.RightShift,
5164return new BinaryOperation(BinaryOperatorKind.ExclusiveOr,
5236IOperation condition = new BinaryOperation(BinaryOperatorKind.Or,
5288IOperation increment = new BinaryOperation(BinaryOperatorKind.Add,
5482condition = new BinaryOperation(BinaryOperatorKind.Equals,
5532if (relationalValueClause.Relation == BinaryOperatorKind.Equals)
Microsoft.CodeAnalysis.CodeStyle (13)
Microsoft.CodeAnalysis.CodeStyle.Fixes (48)
SyntaxGeneratorExtensions_Negate.cs (47)
19private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
20new Dictionary<BinaryOperatorKind, BinaryOperatorKind>
22{ BinaryOperatorKind.Equals, BinaryOperatorKind.NotEquals },
23{ BinaryOperatorKind.NotEquals, BinaryOperatorKind.Equals },
24{ BinaryOperatorKind.LessThan, BinaryOperatorKind.GreaterThanOrEqual },
25{ BinaryOperatorKind.GreaterThan, BinaryOperatorKind.LessThanOrEqual },
26{ BinaryOperatorKind.LessThanOrEqual, BinaryOperatorKind.GreaterThan },
27{ BinaryOperatorKind.GreaterThanOrEqual, BinaryOperatorKind.LessThan },
28{ BinaryOperatorKind.Or, BinaryOperatorKind.And },
29{ BinaryOperatorKind.And, BinaryOperatorKind.Or },
30{ BinaryOperatorKind.ConditionalOr, BinaryOperatorKind.ConditionalAnd },
31{ BinaryOperatorKind.ConditionalAnd, BinaryOperatorKind.ConditionalOr },
170if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind))
176&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or
177BinaryOperatorKind.LessThanOrEqual or
178BinaryOperatorKind.GreaterThan or
179BinaryOperatorKind.GreaterThanOrEqual)
184if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
185BinaryOperatorKind.And or
186BinaryOperatorKind.ConditionalAnd or
187BinaryOperatorKind.ConditionalOr)
193var newBinaryExpressionSyntax = negatedKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals
356BinaryOperatorKind operationKind,
361BinaryOperatorKind.LessThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind)
364BinaryOperatorKind.GreaterThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind)
367BinaryOperatorKind.LessThan => generator.LessThanExpression(leftOperand, rightOperand),
368BinaryOperatorKind.GreaterThan => generator.GreaterThanExpression(leftOperand, rightOperand),
369BinaryOperatorKind.Or => generator.BitwiseOrExpression(leftOperand, rightOperand),
370BinaryOperatorKind.And => generator.BitwiseAndExpression(leftOperand, rightOperand),
371BinaryOperatorKind.ConditionalOr => generator.LogicalOrExpression(leftOperand, rightOperand),
372BinaryOperatorKind.ConditionalAnd => generator.LogicalAndExpression(leftOperand, rightOperand),
384BinaryOperatorKind operationKind)
394BinaryOperatorKind.LessThanOrEqual when rightOperand.IsNumericLiteral()
396BinaryOperatorKind.GreaterThanOrEqual when leftOperand.IsNumericLiteral()
Microsoft.CodeAnalysis.CSharp (30)
Microsoft.CodeAnalysis.CSharp.CodeStyle (20)
Microsoft.CodeAnalysis.CSharp.CodeStyle.Fixes (18)
Microsoft.CodeAnalysis.CSharp.Features (39)
ConvertIfToSwitch\CSharpConvertIfToSwitchCodeRefactoringProvider.Rewriting.cs (6)
22private static readonly Dictionary<BinaryOperatorKind, SyntaxKind> s_operatorMap = new Dictionary<BinaryOperatorKind, SyntaxKind>
24{ BinaryOperatorKind.LessThan, SyntaxKind.LessThanToken },
25{ BinaryOperatorKind.GreaterThan, SyntaxKind.GreaterThanToken },
26{ BinaryOperatorKind.LessThanOrEqual, SyntaxKind.LessThanEqualsToken },
27{ BinaryOperatorKind.GreaterThanOrEqual, SyntaxKind.GreaterThanEqualsToken },
Microsoft.CodeAnalysis.CSharp.Workspaces (5)
Microsoft.CodeAnalysis.Features (16)
Microsoft.CodeAnalysis.Test.Utilities (45)
Microsoft.CodeAnalysis.VisualBasic (36)
Microsoft.CodeAnalysis.VisualBasic.CodeStyle.Fixes (3)
Microsoft.CodeAnalysis.VisualBasic.Features (7)
ConvertIfToSwitch\VisualBasicConvertIfToSwitchCodeRefactoringProvider.Rewriting.vb (7)
12Private Shared ReadOnly s_operatorMap As Dictionary(Of BinaryOperatorKind, (CaseClauseKind As SyntaxKind, OperatorTokenKind As SyntaxKind)) =
13New Dictionary(Of BinaryOperatorKind, (SyntaxKind, SyntaxKind))() From
15{BinaryOperatorKind.NotEquals, (SyntaxKind.CaseNotEqualsClause, SyntaxKind.LessThanGreaterThanToken)},
16{BinaryOperatorKind.LessThan, (SyntaxKind.CaseLessThanClause, SyntaxKind.LessThanToken)},
17{BinaryOperatorKind.GreaterThan, (SyntaxKind.CaseGreaterThanClause, SyntaxKind.GreaterThanToken)},
18{BinaryOperatorKind.LessThanOrEqual, (SyntaxKind.CaseLessThanOrEqualClause, SyntaxKind.LessThanEqualsToken)},
19{BinaryOperatorKind.GreaterThanOrEqual, (SyntaxKind.CaseGreaterThanOrEqualClause, SyntaxKind.GreaterThanEqualsToken)}
Microsoft.CodeAnalysis.VisualBasic.Workspaces (3)
Microsoft.CodeAnalysis.Workspaces (52)
SyntaxGeneratorExtensions_Negate.cs (47)
19private static readonly ImmutableDictionary<BinaryOperatorKind, BinaryOperatorKind> s_negatedBinaryMap =
20new Dictionary<BinaryOperatorKind, BinaryOperatorKind>
22{ BinaryOperatorKind.Equals, BinaryOperatorKind.NotEquals },
23{ BinaryOperatorKind.NotEquals, BinaryOperatorKind.Equals },
24{ BinaryOperatorKind.LessThan, BinaryOperatorKind.GreaterThanOrEqual },
25{ BinaryOperatorKind.GreaterThan, BinaryOperatorKind.LessThanOrEqual },
26{ BinaryOperatorKind.LessThanOrEqual, BinaryOperatorKind.GreaterThan },
27{ BinaryOperatorKind.GreaterThanOrEqual, BinaryOperatorKind.LessThan },
28{ BinaryOperatorKind.Or, BinaryOperatorKind.And },
29{ BinaryOperatorKind.And, BinaryOperatorKind.Or },
30{ BinaryOperatorKind.ConditionalOr, BinaryOperatorKind.ConditionalAnd },
31{ BinaryOperatorKind.ConditionalAnd, BinaryOperatorKind.ConditionalOr },
170if (!s_negatedBinaryMap.TryGetValue(binaryOperation.OperatorKind, out var negatedKind))
176&& binaryOperation.OperatorKind is BinaryOperatorKind.LessThan or
177BinaryOperatorKind.LessThanOrEqual or
178BinaryOperatorKind.GreaterThan or
179BinaryOperatorKind.GreaterThanOrEqual)
184if (binaryOperation.OperatorKind is BinaryOperatorKind.Or or
185BinaryOperatorKind.And or
186BinaryOperatorKind.ConditionalAnd or
187BinaryOperatorKind.ConditionalOr)
193var newBinaryExpressionSyntax = negatedKind is BinaryOperatorKind.Equals or BinaryOperatorKind.NotEquals
356BinaryOperatorKind operationKind,
361BinaryOperatorKind.LessThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind)
364BinaryOperatorKind.GreaterThanOrEqual => IsSpecialCaseBinaryExpression(binaryOperation, operationKind)
367BinaryOperatorKind.LessThan => generator.LessThanExpression(leftOperand, rightOperand),
368BinaryOperatorKind.GreaterThan => generator.GreaterThanExpression(leftOperand, rightOperand),
369BinaryOperatorKind.Or => generator.BitwiseOrExpression(leftOperand, rightOperand),
370BinaryOperatorKind.And => generator.BitwiseAndExpression(leftOperand, rightOperand),
371BinaryOperatorKind.ConditionalOr => generator.LogicalOrExpression(leftOperand, rightOperand),
372BinaryOperatorKind.ConditionalAnd => generator.LogicalAndExpression(leftOperand, rightOperand),
384BinaryOperatorKind operationKind)
394BinaryOperatorKind.LessThanOrEqual when rightOperand.IsNumericLiteral()
396BinaryOperatorKind.GreaterThanOrEqual when leftOperand.IsNumericLiteral()
Roslyn.Compilers.VisualBasic.IOperation.UnitTests (4)