1 write to OperatorKind
Microsoft.CodeAnalysis.CSharp (1)
Generated\BoundNodes.xml.Generated.cs (1)
1656
this.
OperatorKind
= operatorKind;
101 references to OperatorKind
Microsoft.CodeAnalysis.CSharp (101)
Binder\Binder.ValueChecks.cs (1)
4211
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)
756
return value is BoundUtf8String or BoundBinaryOperator {
OperatorKind
: BinaryOperatorKind.Utf8Addition };
BoundTree\BoundNode_Source.cs (1)
335
append(binary.
OperatorKind
.ToString());
BoundTree\BoundTreeRewriter.cs (1)
146
left = binary.Update(binary.
OperatorKind
, binary.Data, binary.ResultKind, left, right, type);
BoundTree\Constructors.cs (1)
423
return Update(
OperatorKind
, uncommonData, ResultKind, Left, Right, Type);
BoundTree\NullabilityRewriter.cs (1)
58
binary.
OperatorKind
,
CodeGen\EmitExpression.cs (2)
1934
Debug.Assert(!b.
OperatorKind
.IsUserDefined());
1936
if (b.
OperatorKind
.IsUserDefined() || !isSafeToDereferenceReceiverRefAfterEvaluatingArgument(b.Right))
CodeGen\EmitOperators.cs (16)
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())
418
throw ExceptionUtilities.UnexpectedValue(binOp.
OperatorKind
.OperatorWithLogical());
425
else if (IsFloat(binOp.
OperatorKind
))
496
if (IsConditional(binOp.
OperatorKind
))
577
switch (expression.
OperatorKind
.Operator() | expression.
OperatorKind
.OperandTypes())
628
switch (expression.
OperatorKind
.Operator())
664
throw ExceptionUtilities.UnexpectedValue(expression.
OperatorKind
.Operator());
706
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)
1443
var isLogical = (binary.
OperatorKind
& BinaryOperatorKind.Logical) != 0;
1460
left = binary.Update(binary.
OperatorKind
, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type);
1481
var isLogical = (node.
OperatorKind
& BinaryOperatorKind.Logical) != 0;
1494
return node.Update(node.
OperatorKind
, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type);
2035
left = binary.Update(binary.
OperatorKind
, binary.ConstantValueOpt, binary.Method, binary.ConstrainedToType, binary.ResultKind, left, right, type);
Compilation\CSharpSemanticModel.cs (6)
3830
BinaryOperatorKind operandType = binaryOperator.
OperatorKind
.OperandTypes();
3831
BinaryOperatorKind op = binaryOperator.
OperatorKind
.Operator();
3832
isDynamic = binaryOperator.
OperatorKind
.IsDynamic();
3834
if (operandType == 0 || operandType == BinaryOperatorKind.UserDefined || binaryOperator.ResultKind != LookupResultKind.Viable || binaryOperator.
OperatorKind
.IsLogical())
3855
OperatorFacts.BinaryOperatorNameFromOperatorKind(op, isChecked: binaryOperator.
OperatorKind
.IsChecked()),
3865
binaryOperator.
OperatorKind
.IsChecked()));
FlowAnalysis\AbstractFlowPass.cs (8)
2194
if (node.
OperatorKind
.IsLogical())
2196
Debug.Assert(!node.
OperatorKind
.IsUserDefined());
2233
if (!binOp.
OperatorKind
.IsLogical())
2238
Debug.Assert(!binOp.
OperatorKind
.IsUserDefined());
2269
kind = binOp.
OperatorKind
;
2354
while (binary != null && !binary.
OperatorKind
.IsLogical() && binary.InterpolatedStringHandlerData is null);
2431
var kind = binary.
OperatorKind
;
2444
=> binary.
OperatorKind
.Operator() == BinaryOperatorKind.Equal;
FlowAnalysis\NullableWalker.cs (12)
4465
&& binary.
OperatorKind
.Operator() is BinaryOperatorKind.Equal or BinaryOperatorKind.NotEqual)
4536
=> binary.
OperatorKind
.Operator() == BinaryOperatorKind.Equal;
4568
if (binary.
OperatorKind
.Operator() is not (BinaryOperatorKind.Equal or BinaryOperatorKind.NotEqual))
4592
if (binary.
OperatorKind
.IsUserDefined())
4646
if (binary.
OperatorKind
.IsUserDefined() &&
4651
bool isLifted = binary.
OperatorKind
.IsLifted();
4728
if (binary.
OperatorKind
.IsLifted()
4729
&& binary.
OperatorKind
.Operator() is BinaryOperatorKind.GreaterThan or BinaryOperatorKind.GreaterThanOrEqual or BinaryOperatorKind.LessThan or BinaryOperatorKind.LessThanOrEqual)
4738
var inferredResult = InferResultNullability(binary.
OperatorKind
, method, binary.Type, leftType, rightType);
4774
BinaryOperatorKind op = binary.
OperatorKind
.Operator();
10446
Debug.Assert(!((BoundBinaryOperator)node).
OperatorKind
.IsUserDefined());
10497
BoundBinaryOperator binary => InferResultNullability(binary.
OperatorKind
, binary.Method, binary.Type, leftType, rightType),
Generated\BoundNodes.xml.Generated.cs (3)
1670
if (operatorKind != this.
OperatorKind
|| data != this.Data || resultKind != this.ResultKind || left != this.Left || right != this.Right || !TypeSymbol.Equals(type, this.Type, TypeCompareKind.ConsiderEverything))
10642
return node.Update(node.
OperatorKind
, node.Data, node.ResultKind, left, right, type);
14755
new TreeDumperNode("operatorKind", node.
OperatorKind
, null),
Lowering\ClosureConversion\ExpressionLambdaRewriter.cs (1)
197
return VisitBinaryOperator(binOp.
OperatorKind
, binOp.Method, binOp.Type, binOp.Left, binOp.Right);
Lowering\DiagnosticsPass_ExpressionTrees.cs (1)
664
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)
120
if (node.
OperatorKind
is BinaryOperatorKind.Utf8Addition)
136
if (current.InterpolatedStringHandlerData is not null || current.
OperatorKind
is BinaryOperatorKind.Utf8Addition)
150
loweredLeft = MakeBinaryOperator(original, original.Syntax, original.
OperatorKind
, loweredLeft, loweredRight, original.Type, original.Method, original.ConstrainedToType,
160
Debug.Assert(node.
OperatorKind
== BinaryOperatorKind.StringConcatenation);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (2)
161
Debug.Assert(node.
OperatorKind
is BinaryOperatorKind.Utf8Addition);
189
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)
266
node.
OperatorKind
,
Lowering\SpillSequenceSpiller.cs (4)
923
if (node.
OperatorKind
== BinaryOperatorKind.LogicalBoolOr || node.
OperatorKind
== BinaryOperatorKind.LogicalBoolAnd)
929
node.
OperatorKind
== BinaryOperatorKind.LogicalBoolAnd ? _F.Local(tmp) : _F.Not(_F.Local(tmp)),
942
return UpdateExpression(builder, node.Update(node.
OperatorKind
, node.ConstantValueOpt, node.Method, node.ConstrainedToType, node.ResultKind, left, right, node.Type));
Operations\CSharpOperationFactory.cs (3)
1442
BinaryOperatorKind operatorKind = Helper.DeriveBinaryOperatorKind(boundBinaryOperator.
OperatorKind
);
1458
bool isLifted = boundBinaryOperator.
OperatorKind
.IsLifted();
1459
bool isChecked = boundBinaryOperator.
OperatorKind
.IsChecked() || (boundBinaryOperator.Method is not null && SyntaxFacts.IsCheckedOperator(boundBinaryOperator.Method.Name));