1 write to OperatorKind
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
1669
this.
OperatorKind
= operatorKind;
96 references to OperatorKind
Microsoft.CodeAnalysis.CSharp (96)
Binder\Binder.ValueChecks.cs (1)
5194
if (binary.
OperatorKind
== BinaryOperatorKind.Utf8Addition)
Binder\Binder_TupleOperators.cs (1)
111
return new TupleBinaryOperatorInfo.Single(binary.Left.Type, binary.Right.Type, binary.
OperatorKind
, binary.Method, binary.ConstrainedToType,
Binder\Semantics\Operators\BinaryOperatorOverloadResolution.cs (1)
774
return value is BoundUtf8String or BoundBinaryOperator {
OperatorKind
: BinaryOperatorKind.Utf8Addition };
BoundTree\BoundNode_Source.cs (1)
356
append(binary.
OperatorKind
.ToString());
BoundTree\BoundTreeRewriter.cs (1)
145
left = binary.Update(binary.
OperatorKind
, binary.Data, binary.ResultKind, left, right, type);
BoundTree\Constructors.cs (1)
480
return Update(
OperatorKind
, uncommonData, ResultKind, Left, Right, Type);
BoundTree\NullabilityRewriter.cs (1)
101
binary.
OperatorKind
,
CodeGen\EmitConversion.cs (1)
160
(fromPredefTypeKind == Cci.PrimitiveTypeCode.IntPtr && conversion.Operand is BoundBinaryOperator {
OperatorKind
: BinaryOperatorKind.Division })); // pointer subtraction: see LocalRewriter.RewritePointerSubtraction()
CodeGen\EmitExpression.cs (2)
2154
Debug.Assert(!b.
OperatorKind
.IsUserDefined());
2156
if (b.
OperatorKind
.IsUserDefined() || !isSafeToDereferenceReceiverRefAfterEvaluatingArgument(b.Right))
CodeGen\EmitOperators.cs (17)
60
var operatorKind = expression.
OperatorKind
;
101
var operatorKind = binary.
OperatorKind
;
124
operatorKind = binary.
OperatorKind
;
139
bool isChecked = binary.
OperatorKind
.EmitsAsCheckedInstruction();
162
bool isChecked = expression.
OperatorKind
.EmitsAsCheckedInstruction();
177
switch (expression.
OperatorKind
.Operator())
245
throw ExceptionUtilities.UnexpectedValue(expression.
OperatorKind
.Operator());
302
switch (binOp.
OperatorKind
.OperatorWithLogical())
438
throw ExceptionUtilities.UnexpectedValue(binOp.
OperatorKind
.OperatorWithLogical());
445
else if (IsFloat(binOp.
OperatorKind
))
510
if (IsConditional(binOp.
OperatorKind
))
543
if (binOp.
OperatorKind
.IsComparison())
649
switch (expression.
OperatorKind
.Operator() | expression.
OperatorKind
.OperandTypes())
700
switch (expression.
OperatorKind
.Operator())
736
throw ExceptionUtilities.UnexpectedValue(expression.
OperatorKind
.Operator());
778
BinaryOperatorKind opKind = op.
OperatorKind
;
CodeGen\EmitStatement.cs (8)
230
var opKind = condition.
OperatorKind
.Operator();
303
switch (op.
OperatorKind
.Operator())
330
throw ExceptionUtilities.UnexpectedValue(op.
OperatorKind
.Operator());
337
else if (IsFloat(op.
OperatorKind
))
424
if (binOp.
OperatorKind
.OperatorWithLogical() is BinaryOperatorKind.LogicalOr or BinaryOperatorKind.LogicalAnd)
445
binary.
OperatorKind
.OperatorWithLogical() is BinaryOperatorKind.LogicalOr or BinaryOperatorKind.LogicalAnd)
447
if (binary.
OperatorKind
.OperatorWithLogical() is BinaryOperatorKind.LogicalOr ? !top.sense : top.sense)
492
switch (binOp.
OperatorKind
.OperatorWithLogical())
CodeGen\Optimizer.cs (5)
1510
var isLogical = (binary.
OperatorKind
& BinaryOperatorKind.Logical) != 0;
1527
left = binary.Update(binary.
OperatorKind
, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type);
1548
var isLogical = (node.
OperatorKind
& BinaryOperatorKind.Logical) != 0;
1561
return node.Update(node.
OperatorKind
, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type);
2102
left = binary.Update(binary.
OperatorKind
, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type);
Compilation\CSharpSemanticModel.cs (6)
3842
BinaryOperatorKind operandType = binaryOperator.
OperatorKind
.OperandTypes();
3843
BinaryOperatorKind op = binaryOperator.
OperatorKind
.Operator();
3844
isDynamic = binaryOperator.
OperatorKind
.IsDynamic();
3846
if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || binaryOperator.ResultKind != LookupResultKind.Viable || binaryOperator.
OperatorKind
.IsLogical())
3867
OperatorFacts.BinaryOperatorNameFromOperatorKind(op, isChecked: binaryOperator.
OperatorKind
.IsChecked()),
3877
binaryOperator.
OperatorKind
.IsChecked()));
FlowAnalysis\AbstractFlowPass.cs (8)
2386
if (node.
OperatorKind
.IsLogical())
2388
Debug.Assert(!node.
OperatorKind
.IsUserDefined());
2425
if (!binOp.
OperatorKind
.IsLogical())
2430
Debug.Assert(!binOp.
OperatorKind
.IsUserDefined());
2461
kind = binOp.
OperatorKind
;
2546
while (binary != null && !binary.
OperatorKind
.IsLogical() && binary.InterpolatedStringHandlerData is null);
2623
var kind = binary.
OperatorKind
;
2636
=> binary.
OperatorKind
.Operator() == BinaryOperatorKind.Equal;
FlowAnalysis\NullableWalker.cs (5)
4963
=> binary.
OperatorKind
.Operator() == BinaryOperatorKind.Equal;
5067
var inferredResult = ReinferAndVisitBinaryOperator(binary, binary.
OperatorKind
, binary.Method, binary.Type, binary.Left, leftOperand, leftConversion, leftType, binary.Right, rightOperand, rightConversion, rightType);
5220
BinaryOperatorKind op = binary.
OperatorKind
.Operator();
11364
Debug.Assert(!((BoundBinaryOperator)node).
OperatorKind
.IsUserDefined());
11415
BoundBinaryOperator binary => InferResultNullability(binary.
OperatorKind
, binary.Method, binary.Type, leftType, rightType),
Generated\BoundNodes.xml.Generated.cs (3)
1683
if (operatorKind != this.
OperatorKind
|| data != this.Data || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
11022
return node.Update(node.
OperatorKind
, node.Data, node.ResultKind, left, right, type);
15293
new TreeDumperNode("operatorKind", node.
OperatorKind
, null),
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
195
return VisitBinaryOperator(binOp.
OperatorKind
, binOp.Method, binOp.Type, binOp.Left, binOp.Right);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
729
if (_inExpressionLambda && node.
OperatorKind
.IsDynamic())
Lowering\DiagnosticsPass_Warnings.cs (16)
272
CheckForBitwiseOrSignExtend(node, node.
OperatorKind
, node.Left, node.Right);
278
if (_inExpressionLambda && node.
OperatorKind
.Operator() == BinaryOperatorKind.UnsignedRightShift)
308
if (!node.
OperatorKind
.IsComparison())
327
if (node.
OperatorKind
== BinaryOperatorKind.ObjectEqual || node.
OperatorKind
== BinaryOperatorKind.ObjectNotEqual)
330
if (node.Left.Type.SpecialType == SpecialType.System_Object && !IsExplicitCast(node.Left) && !(node.Left.ConstantValueOpt != null && node.Left.ConstantValueOpt.IsNull) && ConvertedHasEqual(node.
OperatorKind
, node.Right, out t))
335
else if (node.Right.Type.SpecialType == SpecialType.System_Object && !IsExplicitCast(node.Right) && !(node.Right.ConstantValueOpt != null && node.Right.ConstantValueOpt.IsNull) && ConvertedHasEqual(node.
OperatorKind
, node.Left, out t))
384
Debug.Assert(node.
OperatorKind
.IsComparison());
751
if (node.
OperatorKind
.OperandTypes() != BinaryOperatorKind.NullableNull)
756
switch (node.
OperatorKind
.Operator())
765
string always = node.
OperatorKind
.Operator() == BinaryOperatorKind.NotEqual ? "true" : "false";
784
if (!node.
OperatorKind
.IsLifted())
789
switch (node.
OperatorKind
.Operator())
814
string always = node.
OperatorKind
.Operator() == BinaryOperatorKind.NotEqual ? "true" : "false";
818
Error(node.
OperatorKind
.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Left.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Right));
822
Error(node.
OperatorKind
.IsUserDefined() ? ErrorCode.WRN_NubExprIsConstBool2 : ErrorCode.WRN_NubExprIsConstBool, node, always, node.Right.Type.GetNullableUnderlyingType(), GetTypeForLiftedComparisonWarning(node.Left));
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (4)
122
if (node.
OperatorKind
is BinaryOperatorKind.Utf8Addition)
138
if (current.InterpolatedStringHandlerData is not null || current.
OperatorKind
is BinaryOperatorKind.Utf8Addition)
152
loweredLeft = MakeBinaryOperator(original, original.Syntax, original.
OperatorKind
, loweredLeft, loweredRight, original.Type, original.Method, original.ConstrainedToType,
162
Debug.Assert(node.
OperatorKind
== BinaryOperatorKind.StringConcatenation);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
168
Debug.Assert(node.
OperatorKind
is BinaryOperatorKind.Utf8Addition);
196
Debug.Assert(utf8Addition.
OperatorKind
is BinaryOperatorKind.Utf8Addition);
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (2)
51
if (node.OperatorKind == UnaryOperatorKind.DynamicTrue && binaryOperator.
OperatorKind
== BinaryOperatorKind.DynamicLogicalOr ||
52
node.OperatorKind == UnaryOperatorKind.DynamicFalse && binaryOperator.
OperatorKind
== BinaryOperatorKind.DynamicLogicalAnd)
Lowering\MethodToClassRewriter.cs (1)
271
node.
OperatorKind
,
Lowering\SpillSequenceSpiller.cs (4)
994
if (node.
OperatorKind
== BinaryOperatorKind.LogicalBoolOr || node.
OperatorKind
== BinaryOperatorKind.LogicalBoolAnd)
1000
node.
OperatorKind
== BinaryOperatorKind.LogicalBoolAnd ? _F.Local(tmp) : _F.Not(_F.Local(tmp)),
1013
return UpdateExpression(builder, node.Update(node.
OperatorKind
, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type));
Operations\CSharpOperationFactory.cs (3)
1509
BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundBinaryOperator.
OperatorKind
);
1525
bool isLifted = boundBinaryOperator.
OperatorKind
.IsLifted();
1526
bool isChecked = boundBinaryOperator.
OperatorKind
.IsChecked() || (boundBinaryOperator.Method is not null && SyntaxFacts.IsCheckedOperator(boundBinaryOperator.Method.Name));