1 write to _factory
Microsoft.CodeAnalysis.CSharp (1)
Lowering\LocalRewriter\LocalRewriter.cs (1)
69
_factory
= factory;
500 references to _factory
Microsoft.CodeAnalysis.CSharp (500)
Lowering\LocalRewriter\LocalRewriter.cs (18)
70
_factory
.CurrentFunction = containingMethod;
178
=>
_factory
;
187
=>
_factory
.InstrumentationState!;
197
get { return
_factory
.CompilationState.ModuleBuilderOpt; }
328
Debug.Assert(
_factory
.ModuleBuilderOpt is { });
346
_factory
.ModuleBuilderOpt.EnsureParamCollectionAttributeExists(_diagnostics, location);
354
var oldContainingSymbol =
_factory
.CurrentFunction;
363
_factory
.CurrentFunction = lambda;
373
_factory
.CurrentFunction = oldContainingSymbol;
387
if (
_factory
.CompilationState.ModuleBuilderOpt is { } moduleBuilder)
404
if (
_factory
.CompilationState.Compilation.ShouldEmitNullableAttributes(localFunction))
419
var oldContainingSymbol =
_factory
.CurrentFunction;
428
_factory
.CurrentFunction = localFunction;
440
_dynamicFactory = new LoweredDynamicOperationFactory(
_factory
, _dynamicFactory.MethodOrdinal, localFunctionOrdinal);
447
_factory
.CurrentFunction = oldContainingSymbol;
770
if (
_factory
.CurrentFunction?.IsStatic == false)
832
var F =
_factory
;
1130
_factory
.CompilationState.ModuleBuilderOpt?.EnsureIsReadOnlyAttributeExists();
Lowering\LocalRewriter\LocalRewriter.PatternLocalRewriter.cs (1)
33
_factory = localRewriter.
_factory
;
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (6)
223
return
_factory
.AssignmentExpression(
259
return
_factory
.AssignmentExpression(
286
Debug.Assert(
_factory
.CurrentFunction.IsConstructor());
290
return
_factory
.AssignmentExpression(
291
_factory
.Field(rewrittenReceiver, backingField),
325
LocalSymbol rhsTemp =
_factory
.SynthesizedLocal(exprType);
Lowering\LocalRewriter\LocalRewriter_Await.cs (1)
48
var tempAccess =
_factory
.StoreToTemp(rewrittenAwait, out BoundAssignmentOperator tempAssignment, syntaxOpt: rewrittenAwait.Syntax,
Lowering\LocalRewriter\LocalRewriter_BinaryOperator.cs (62)
84
var boundTemp =
_factory
.StoreToTemp(loweredLeft, out tempAssignment);
254
return
_factory
.RewriteNullableNullEquality(syntax, operatorKind, loweredLeft, loweredRight, type);
315
return
_factory
.MakeSequence(loweredRight, loweredLeft);
319
return
_factory
.MakeSequence(loweredLeft, loweredRight);
465
return
_factory
.MakeSequence(loweredRight, loweredLeft);
469
return
_factory
.MakeSequence(loweredLeft, loweredRight);
570
whenNullOpt = RewriteLiftedBinaryOperator(syntax, operatorKind,
_factory
.Default(loweredLeft.Type), loweredRight, type, method, constrainedToTypeOpt);
592
return arrLength.Update(arrLength.Expression,
_factory
.SpecialType(SpecialType.System_UIntPtr));
635
return
_factory
.Literal(true);
655
var local =
_factory
.StoreToTemp(loweredLeft, out assignment);
681
result =
_factory
.Binary(BinaryOperatorKind.LogicalOr, boolean, leftTest, result);
698
result =
_factory
.Conditional(leftTest, convertedLeft, op, type);
705
return
_factory
.Sequence(ImmutableArray.Create(temp.LocalSymbol), ImmutableArray.Create<BoundExpression>(tempAssignment), result);
872
BoundExpression callHasValue =
_factory
.MakeNullableHasValue(syntax, maybeNull);
881
return
_factory
.MakeSequence(maybeNull, falseExpr);
919
return
_factory
.MakeNullableHasValue(syntax, expression);
1029
BoundLocal boundTempX =
_factory
.StoreToTemp(xNonNull ?? loweredLeft, out BoundAssignmentOperator tempAssignmentX);
1030
BoundLocal boundTempY =
_factory
.StoreToTemp(yNonNull ?? loweredRight, out BoundAssignmentOperator tempAssignmentY);
1089
binaryExpression =
_factory
.Not(binaryExpression);
1201
BoundLocal boundTempX =
_factory
.StoreToTemp(xNonNull ?? loweredLeft, out tempAssignmentX);
1203
BoundLocal boundTempY =
_factory
.StoreToTemp(yNonNull ?? loweredRight, out tempAssignmentY);
1495
var tempAccess =
_factory
.StoreToTemp(operand, out tempAssignment, kind: kind);
1719
BoundLocal boundTemp =
_factory
.StoreToTemp(notAlwaysNull, out tempAssignment);
1776
BoundLocal boundTempX =
_factory
.StoreToTemp(leftNonNull ?? left, out tempAssignmentX);
1778
BoundLocal boundTempY =
_factory
.StoreToTemp(rightNonNull ?? right, out tempAssignmentY);
1830
BoundLocal boundTempX =
_factory
.StoreToTemp(loweredLeft, out tempAssignmentX);
1832
BoundLocal boundTempY =
_factory
.StoreToTemp(loweredRight, out tempAssignmentY);
1844
BoundExpression callX_HasValue =
_factory
.MakeNullableHasValue(syntax, boundTempX);
2213
var oldSyntax =
_factory
.Syntax;
2214
_factory
.Syntax = loweredRight.Syntax;
2227
loweredRight =
_factory
.Literal(shiftAmount);
2234
loweredRight =
_factory
.Binary(andOperatorKind, rightType,
2236
_factory
.IntSubtract(
_factory
.IntMultiply(
_factory
.Sizeof(leftType),
_factory
.Literal(8)),
_factory
.Literal(1)));
2239
_factory
.Syntax = syntax;
2241
?
_factory
.Binary(operatorKind, type, loweredLeft, loweredRight)
2245
_factory
.Syntax = oldSyntax;
2304
var sizeOfExpression =
_factory
.Sizeof(pointerType.PointedAtType);
2370
:
_factory
.Convert(
_factory
.SpecialType(destinationType), numericOperand, Conversion.IntegerToPointer);
2381
TypeSymbol nativeIntType =
_factory
.SpecialType(SpecialType.System_IntPtr);
2387
numericOperand =
_factory
.Convert(nativeIntType, numericOperand, Conversion.IntegerToPointer, isChecked);
2395
TypeSymbol longType =
_factory
.SpecialType(SpecialType.System_Int64);
2396
TypeSymbol nativeIntType =
_factory
.SpecialType(SpecialType.System_IntPtr);
2399
numericOperand =
_factory
.Convert(longType, numericOperand, Conversion.ExplicitNumeric, isChecked);
2400
sizeOfExpression =
_factory
.Convert(longType, sizeOfExpression, Conversion.ExplicitNumeric, isChecked);
2408
TypeSymbol longType =
_factory
.SpecialType(SpecialType.System_Int64);
2409
TypeSymbol nativeIntType =
_factory
.SpecialType(SpecialType.System_IntPtr);
2412
sizeOfExpression =
_factory
.Convert(longType, sizeOfExpression, Conversion.ExplicitNumeric, isChecked);
2420
TypeSymbol ulongType =
_factory
.SpecialType(SpecialType.System_UInt64);
2421
TypeSymbol nativeUIntType =
_factory
.SpecialType(SpecialType.System_UIntPtr);
2424
sizeOfExpression =
_factory
.Convert(ulongType, sizeOfExpression, Conversion.ExplicitNumeric, isChecked);
2440
var multiplication =
_factory
.Binary(multiplicationKind, multiplicationResultType, numericOperand, sizeOfExpression);
2443
:
_factory
.Convert(convertedMultiplicationResultType, multiplication, Conversion.IntegerToPointer); // NOTE: for some reason, dev10 doesn't check this conversion.
2457
var sizeOfExpression =
_factory
.Sizeof(pointerType.PointedAtType);
2462
return
_factory
.Convert(
2464
_factory
.Binary(
2466
_factory
.SpecialType(SpecialType.System_IntPtr),
2467
_factory
.Binary(
Lowering\LocalRewriter\LocalRewriter_Call.cs (23)
53
else if (hasImplicitReceiver &&
_factory
.TopLevelMethod is { RequiresInstanceReceiver: false })
56
Debug.Assert(
_factory
.CurrentType is { });
57
loweredReceiver = new BoundTypeExpression(node.Syntax, null,
_factory
.CurrentType);
187
var containingMethod = this.
_factory
.CurrentFunction;
291
_factory
.CurrentFunction,
295
var receiverTemp =
_factory
.StoreToTemp(receiverOpt, out var assignmentToTemp);
297
receiverOpt =
_factory
.Sequence(locals: [], sideEffects: [assignmentToTemp], receiverTemp);
706
_factory
.CurrentFunction,
715
receiverTemp =
_factory
.StoreToTemp(rewrittenReceiver, out assignmentToTemp, refKind);
743
visitedArgumentsBuilder.Add(
_factory
.MakeTempForDiscard(discard, tempsOpt));
806
rewrittenReceiver =
_factory
.Sequence(
882
local =
_factory
.StoreToTemp(visitedArgument, out var store, refKind: paramRefKind is RefKind.In or RefKind.RefReadOnlyParameter ? RefKind.In : argRefKind);
884
visitedArgumentsBuilder[argIndex] =
_factory
.Sequence(ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create<BoundExpression>(store), local);
944
BoundLocal cache =
_factory
.Local(
_factory
.SynthesizedLocal(receiverType));
951
var intermediateRef =
_factory
.Local(
_factory
.SynthesizedLocal(receiverType, refKind: RefKind.Ref));
964
_factory
.Sequence(new BoundExpression[] {
_factory
.AssignmentExpression(cache, intermediateRef) }, cache),
982
_factory
.Sequence(new BoundExpression[] {
_factory
.AssignmentExpression(cache, assignmentToTemp.Right) }, cache),
1384
var temp =
_factory
.StoreToTemp(
1639
BoundLocal boundTemp =
_factory
.StoreToTemp(argument, out boundAssignmentToTemp);
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (90)
38
var previousSyntax =
_factory
.Syntax;
39
_factory
.Syntax = node.Syntax;
73
return
_factory
.Field(receiver: null, immutableArrayOfTargetCollectionTypeEmpty);
94
_factory
.Syntax = previousSyntax;
184
result =
_factory
.Call(receiver: null, toListOfElementType, rewrittenSpreadExpression);
243
return
_factory
.StaticCall(asImmutableArray.Construct(ImmutableArray.Create(elementType)), ImmutableArray.Create(arrayCreation));
271
return
_factory
.Default(collectionType);
279
var constructor = ((MethodSymbol)
_factory
.WellKnownMember(WellKnownMember.System_ReadOnlySpan_T__ctor_Array)).AsMember(spanType);
281
return
_factory
.New(constructor,
_factory
.Array(elementType.Type, rewrittenElements));
297
spanConstructor = ((MethodSymbol)
_factory
.WellKnownMember(
319
var listToArray = ((MethodSymbol)
_factory
.WellKnownMember(WellKnownMember.System_Collections_Generic_List_T__ToArray)).AsMember((NamedTypeSymbol)list.Type);
320
array =
_factory
.Call(list, listToArray);
343
BoundLocal temp =
_factory
.StoreToTemp(rewrittenReceiver, out assignmentToTemp);
397
Debug.Assert(
_factory
.ModuleBuilderOpt is { });
431
var synthesizedType =
_factory
.ModuleBuilderOpt.EnsureReadOnlyListTypeExists(syntax, kind: kind, _diagnostics.DiagnosticBag).Construct(typeArgs);
457
return
_factory
.Convert(collectionType, arrayOrList);
548
Debug.Assert(
_factory
.ModuleBuilderOpt is { });
555
&&
_factory
.WellKnownMember(asReadOnlySpan
560
var spanType =
_factory
565
var temp =
_factory
.StoreToTemp(element, out var assignment);
567
var call =
_factory
.New(constructor, arguments: [temp], argumentRefKinds: [asReadOnlySpan ? RefKindExtensions.StrictIn : RefKind.Ref]);
568
return
_factory
.Sequence([assignment], call);
571
var inlineArrayType =
_factory
.ModuleBuilderOpt.EnsureInlineArrayTypeExists(syntax,
_factory
, arrayLength, _diagnostics.DiagnosticBag).Construct(ImmutableArray.Create(elementType));
574
var intType =
_factory
.SpecialType(SpecialType.System_Int32);
575
MethodSymbol elementRef =
_factory
.ModuleBuilderOpt.EnsureInlineArrayElementRefExists(syntax, intType, _diagnostics.DiagnosticBag).
581
BoundLocal inlineArrayLocal =
_factory
.StoreToTemp(new BoundDefaultExpression(syntax, inlineArrayType), out assignmentToTemp);
593
var call =
_factory
.Call(null, elementRef, inlineArrayLocal,
_factory
.Literal(i), useStrictArgumentRefKinds: true);
603
_factory
.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(syntax,
_factory
.WellKnownType(WellKnownType.System_ReadOnlySpan_T), intType, _diagnostics.DiagnosticBag) :
604
_factory
.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(syntax,
_factory
.WellKnownType(WellKnownType.System_Span_T), intType, _diagnostics.DiagnosticBag);
606
var span =
_factory
.Call(
610
_factory
.Literal(arrayLength),
671
return
_factory
.Call(rewrittenSpreadExpression, listToArrayMethod.AsMember((NamedTypeSymbol)spreadExpression.Type!));
675
if (
_factory
.WellKnownMethod(WellKnownMember.System_Linq_Enumerable__ToArray, isOptional: true) is { } linqToArrayMethodGeneric)
683
return
_factory
.Call(receiver: null, linqToArrayMethod, VisitExpression(spreadExpression));
695
return
_factory
.Call(rewrittenSpreadExpression, toArrayMethod.AsMember((NamedTypeSymbol)rewrittenSpreadExpression.Type!));
703
toArrayMethod =
_factory
.WellKnownMethod(wellKnownMember, isOptional: true);
765
BoundLocal indexTemp =
_factory
.StoreToTemp(
766
_factory
.Literal(0),
772
BoundLocal arrayTemp =
_factory
.StoreToTemp(
799
_factory
.ArrayAccess(arrayTemp, indexTemp),
810
_factory
.Binary(BinaryOperatorKind.Addition, indexTemp.Type, indexTemp,
_factory
.Literal(1)),
859
&&
_factory
.WellKnownMethod(writableOnly ? WellKnownMember.System_Span_T__ctor_Array : WellKnownMember.System_ReadOnlySpan_T__ctor_Array, isOptional: true) is { } spanCtorArray)
884
&&
_factory
.WellKnownMethod(WellKnownMember.System_Collections_Immutable_ImmutableArray_T__AsSpan, isOptional: true) is { } immutableArrayAsSpanMethod)
891
&&
_factory
.WellKnownMethod(WellKnownMember.System_Runtime_InteropServices_CollectionsMarshal__AsSpan_T, isOptional: true) is { } collectionsMarshalAsSpanMethod)
924
return
_factory
.New(constructor, spreadExpression);
928
return
_factory
.Call(receiver: null, asSpanMethod, spreadExpression);
932
return
_factory
.Call(spreadExpression, asSpanMethod);
949
if (
_factory
.WellKnownMethod(WellKnownMember.System_Span_T__Slice_Int_Int, isOptional: true) is not { } spanSliceMethod)
971
&&
_factory
.WellKnownMethod(getLengthMember, isOptional: true) is { } getLengthMethod
972
&&
_factory
.WellKnownMethod(copyToMember, isOptional: true) is { } copyToMethod)
1003
spreadOperandAsSpan =
_factory
.StoreToTemp(spreadOperandAsSpan, out var assignmentToTemp);
1009
var spreadLength =
_factory
.Call(spreadOperandAsSpan, getLengthMethod.AsMember((NamedTypeSymbol)spreadOperandAsSpan.Type!));
1010
var targetSlice =
_factory
.Call(spanTemp, spanSliceMethod.AsMember((NamedTypeSymbol)spanTemp.Type!), indexTemp, spreadLength);
1011
sideEffects.Add(
_factory
.Call(spreadOperandAsSpan, copyToMethod.AsMember((NamedTypeSymbol)spreadOperandAsSpan.Type!), targetSlice));
1014
sideEffects.Add(new BoundAssignmentOperator(rewrittenSpreadOperand.Syntax, indexTemp,
_factory
.Binary(BinaryOperatorKind.Addition, indexTemp.Type, indexTemp, spreadLength), isRef: false, indexTemp.Type));
1026
var collectionType =
_factory
.WellKnownType(WellKnownType.System_Collections_Generic_List_T).Construct(typeArguments);
1040
if (useKnownLength && elements.Length > 0 &&
_factory
.CurrentFunction?.IsAsync == false)
1058
var constructor = ((MethodSymbol)
_factory
.WellKnownMember(WellKnownMember.System_Collections_Generic_List_T__ctorInt32)).AsMember(collectionType);
1066
knownLengthTemp =
_factory
.StoreToTemp(knownLengthExpression, out assignmentToTemp);
1071
rewrittenReceiver =
_factory
.New(constructor, ImmutableArray.Create<BoundExpression>(knownLengthTemp));
1076
rewrittenReceiver =
_factory
.New(constructor, ImmutableArray.Create(knownLengthExpression));
1082
var constructor = ((MethodSymbol)
_factory
.WellKnownMember(WellKnownMember.System_Collections_Generic_List_T__ctor)).AsMember(collectionType);
1083
rewrittenReceiver =
_factory
.New(constructor, ImmutableArray<BoundExpression>.Empty);
1087
BoundLocal listTemp =
_factory
.StoreToTemp(rewrittenReceiver, out assignmentToTemp);
1100
sideEffects.Add(
_factory
.Call(receiver: null, setCount, listTemp, knownLengthTemp));
1103
BoundLocal spanTemp =
_factory
.StoreToTemp(
_factory
.Call(receiver: null, asSpan, listTemp), out assignmentToTemp);
1108
var spanGetItem = ((MethodSymbol)
_factory
.WellKnownMember(WellKnownMember.System_Span_T__get_Item)).AsMember((NamedTypeSymbol)spanTemp.Type);
1111
BoundLocal indexTemp =
_factory
.StoreToTemp(
1112
_factory
.Literal(0),
1135
_factory
.Call(spanTemp, spanGetItem, indexTemp),
1146
_factory
.Binary(BinaryOperatorKind.Addition, indexTemp.Type, indexTemp,
_factory
.Literal(1)),
1162
var addMethod =
_factory
.WellKnownMethod(WellKnownMember.System_Collections_Generic_List_T__Add).AsMember(collectionType);
1163
var addRangeMethod =
_factory
.WellKnownMethod(WellKnownMember.System_Collections_Generic_List_T__AddRange, isOptional: true)?.AsMember(collectionType);
1174
_factory
.Call(listTemp, addMethod, rewrittenValue));
1188
sideEffects.Add(
_factory
.Call(listTemp, addRangeMethod, rewrittenSpreadOperand));
1222
BoundLocal temp =
_factory
.StoreToTemp(rewrittenExpression, out assignmentToTemp);
1305
var otherElements =
_factory
.Literal(initialLength);
1318
_factory
.Binary(BinaryOperatorKind.Addition, sum.Type!, sum, value);
1341
var iterationVariable =
_factory
.SynthesizedLocal(enumeratorInfo.ElementType, node.Syntax);
1342
var iterationLocal =
_factory
.Local(iterationVariable);
1419
return
_factory
.SpillSequence(
1422
result:
_factory
.Literal(0)); // result is unused
Lowering\LocalRewriter\LocalRewriter_CompoundAssignmentOperator.cs (19)
65
var isEvent =
_factory
.StoreToTemp(_dynamicFactory.MakeDynamicIsEventTest(memberAccess.Name, memberAccess.Receiver).ToExpression(), out BoundAssignmentOperator isEventAssignment);
70
lhsRead =
_factory
.StoreToTemp(lhsRead, out BoundAssignmentOperator receiverAssignment);
72
var storeNonEvent =
_factory
.StoreToTemp(
_factory
.Conditional(
_factory
.Not(isEvent), receiverAssignment,
_factory
.Null(receiverAssignment.Type), receiverAssignment.Type), out BoundAssignmentOperator nonEventStore);
79
loweredRight =
_factory
.StoreToTemp(loweredRight, out BoundAssignmentOperator possibleHandlerAssignment);
95
var condition =
_factory
.Conditional(isEvent, invokeEventAccessor.ToExpression(), rewrittenAssignment, rewrittenAssignment.Type);
205
var receiverTemp =
_factory
.StoreToTemp(rewrittenReceiver, out assignmentToTemp, refKind: variableRepresentsLocation ? RefKind.Ref : RefKind.None);
237
var receiverTemp =
_factory
.StoreToTemp(rewrittenReceiver, out assignmentToTemp);
357
var boundTemp =
_factory
.StoreToTemp(array, out storeToTemp);
448
var variableTemp =
_factory
.StoreToTemp(arrayAccess, out assignmentToTemp, refKind: RefKind.Ref);
495
var receiverTemp =
_factory
.StoreToTemp(rewrittenReceiver, out assignmentToTemp);
508
var temp =
_factory
.StoreToTemp(VisitExpression(indexerAccess.Receiver), out assignmentToTemp);
526
var temp =
_factory
.StoreToTemp(VisitExpression(arguments[i]), out assignmentToTemp, indexerAccess.ArgumentRefKindsOpt.RefKinds(i) != RefKind.None ? RefKind.Ref : RefKind.None);
754
var variableTemp =
_factory
.StoreToTemp(rewrittenVariable, out assignmentToTemp2, refKind: RefKind.Ref);
783
var arrayTemp =
_factory
.StoreToTemp(loweredExpression, out assignmentToArrayTemp);
794
var temp =
_factory
.StoreToTemp(loweredIndices[i], out assignmentToTemp);
805
return
_factory
.ArrayAccess(boundTempArray, boundTempIndices);
Lowering\LocalRewriter\LocalRewriter_ConditionalAccess.cs (11)
50
return
_factory
.Default(node.Type);
96
temp =
_factory
.SynthesizedLocal(receiverType);
97
_currentConditionalAccessTarget =
_factory
.Local(temp);
136
loweredAccessExpression =
_factory
.New((NamedTypeSymbol)nodeType, loweredAccessExpression);
167
loweredReceiver =
_factory
.MakeSequence(
168
_factory
.AssignmentExpression(
_factory
.Local(temp), loweredReceiver),
169
_factory
.Local(temp));
176
var condition =
_factory
.IsNotNullReference(loweredReceiver);
183
_factory
.Default(nodeType),
190
result =
_factory
.MakeSequence(temp, result);
Lowering\LocalRewriter\LocalRewriter_Conversion.cs (41)
99
var save_Syntax =
_factory
.Syntax;
100
_factory
.Syntax = node.Syntax;
115
result = new BoundObjectCreationExpression(node.Syntax, ctor.AsMember((NamedTypeSymbol)node.Type), utf8Bytes,
_factory
.Literal(0),
_factory
.Literal(length));
118
_factory
.Syntax = save_Syntax;
150
builder.Add(
_factory
.Literal(b));
156
builder.Add(
_factory
.Literal((byte)0));
160
ImmutableArray.Create<BoundExpression>(
_factory
.Literal(builder.Count)),
309
Debug.Assert(
_factory
.ModuleBuilderOpt is { });
454
return
_factory
.ThrowExpression(operand.Expression, rewrittenType);
568
var oldSyntax =
_factory
.Syntax;
569
_factory
.Syntax = (mg.ReceiverOpt ?? mg).Syntax;
570
var receiver = (!method.RequiresInstanceReceiver && !oldNodeOpt.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ?
_factory
.Type(method.ContainingType) : mg.ReceiverOpt;
572
_factory
.Syntax = oldSyntax;
578
Debug.Assert(
_factory
.TopLevelMethod is { });
580
if (
_factory
.Compilation.LanguageVersion >= MessageID.IDS_FeatureCacheStaticMethodGroupConversion.RequiredVersion()
582
&&
_factory
.TopLevelMethod.MethodKind != MethodKind.StaticConstructor // Avoid caching twice if people do it manually.
585
var rewriter = _lazyDelegateCacheRewriter ??= new DelegateCacheRewriter(
_factory
, _topLevelMethodOrdinal);
603
createSpan =
_factory
.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(syntax, spanType.OriginalDefinition,
_factory
.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag);
608
createSpan =
_factory
.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(syntax, spanType.OriginalDefinition,
_factory
.SpecialType(SpecialType.System_Int32), _diagnostics.DiagnosticBag);
614
return
_factory
.Call(null, createSpan, rewrittenOperand,
_factory
.Literal(length), useStrictArgumentRefKinds: true);
635
rewrittenOperand =
_factory
.Convert(method.ParameterTypesWithAnnotations[0].Type, rewrittenOperand);
642
return
_factory
.Call(null, method, rewrittenOperand);
658
rewrittenOperand =
_factory
.Convert(implicitOperator.ParameterTypesWithAnnotations[0].Type, rewrittenOperand);
659
rewrittenOperand =
_factory
.Call(null, implicitOperator, rewrittenOperand);
671
return
_factory
.Call(null, castUpMethod, rewrittenOperand);
692
rewrittenOperand =
_factory
.Convert(method.ParameterTypesWithAnnotations[0].Type, rewrittenOperand);
693
return
_factory
.Call(null, method, rewrittenOperand);
707
rewrittenOperand =
_factory
.Convert(method.ParameterTypesWithAnnotations[0].Type, rewrittenOperand);
708
return
_factory
.Call(null, method, rewrittenOperand);
742
Debug.Assert(
_factory
.ModuleBuilderOpt is { });
748
_factory
.ModuleBuilderOpt.EnsureParamCollectionAttributeExists(_diagnostics, node.Location);
792
return
_factory
.NullOrDefault(rewrittenType);
963
var savedTuple =
_factory
.StoreToTemp(rewrittenOperand, out assignmentToTemp);
975
return
_factory
.MakeSequence(savedTuple.LocalSymbol, assignmentToTemp, result);
1166
var boundTemp =
_factory
.StoreToTemp(operand, out tempAssignment);
1434
BoundLocal boundTemp =
_factory
.StoreToTemp(rewrittenOperand, out tempAssignment);
1438
BoundExpression condition =
_factory
.MakeNullableHasValue(syntax, boundTemp);
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (6)
52
return
_factory
.Sequence(lhsTemps.ToImmutableAndFree(), lhsEffects.ToImmutableAndFree(), result);
97
return
_factory
.Sequence(temps.ToImmutableAndFree(), effects.ToImmutableAndFree(), last);
106
return
_factory
.Sequence(temps.ToImmutableAndFree(), effects.ToImmutableAndFree(), returnValue);
349
BoundLocal savedTuple =
_factory
.StoreToTemp(expression, out assignmentToTemp);
390
var localSymbol = new SynthesizedLocal(
_factory
.CurrentFunction, TypeWithAnnotations.Create(outputPlaceholder.Type), SynthesizedLocalKind.LoweringTemp);
427
var temp =
_factory
.StoreToTemp(loweredArg, out store);
Lowering\LocalRewriter\LocalRewriter_DelegateCreationExpression.cs (4)
33
var oldSyntax =
_factory
.Syntax;
34
_factory
.Syntax = (mg.ReceiverOpt ?? mg).Syntax;
35
var receiver = (!method.RequiresInstanceReceiver && !node.IsExtensionMethod && !method.IsAbstract && !method.IsVirtual) ?
_factory
.Type(method.ContainingType) : VisitExpression(mg.ReceiverOpt)!;
36
_factory
.Syntax = oldSyntax;
Lowering\LocalRewriter\LocalRewriter_DoStatement.cs (1)
30
rewrittenCondition = Instrumenter.InstrumentDoStatementCondition(node, rewrittenCondition,
_factory
);
Lowering\LocalRewriter\LocalRewriter_Event.cs (18)
94
boundTemp =
_factory
.StoreToTemp(rewrittenReceiverOpt!, out tempAssignment);
97
NamedTypeSymbol tokenType =
_factory
.WellKnownType(WellKnownType.System_Runtime_InteropServices_WindowsRuntime_EventRegistrationToken);
98
NamedTypeSymbol marshalType =
_factory
.WellKnownType(WellKnownType.System_Runtime_InteropServices_WindowsRuntime_WindowsRuntimeMarshal);
100
NamedTypeSymbol actionType =
_factory
.WellKnownType(WellKnownType.System_Action_T).Construct(tokenType);
104
BoundExpression delegateCreationArgument = boundTemp ?? rewrittenReceiverOpt ??
_factory
.Type(eventType);
141
NamedTypeSymbol func2Type =
_factory
.WellKnownType(WellKnownType.System_Func_T2).Construct(eventType, tokenType);
283
return
_factory
.Call(getOrCreateCall, invocationListAccessor);
298
SyntaxNode oldSyntax =
_factory
.Syntax;
299
_factory
.Syntax = node.Syntax;
301
var ctor =
_factory
.WellKnownMethod(WellKnownMember.System_Runtime_InteropServices_ComAwareEventInfo__ctor);
305
var addRemove =
_factory
.WellKnownMethod(node.IsAddition ? WellKnownMember.System_Runtime_InteropServices_ComAwareEventInfo__AddEventHandler :
310
BoundExpression eventInfo =
_factory
.New(ctor,
_factory
.Typeof(node.Event.ContainingType, ctor.Parameters[0].Type),
_factory
.Literal(node.Event.MetadataName));
311
result =
_factory
.Call(eventInfo, addRemove,
312
_factory
.Convert(addRemove.Parameters[0].Type, rewrittenReceiver),
313
_factory
.Convert(addRemove.Parameters[1].Type, rewrittenArgument));
317
_factory
.Syntax = oldSyntax;
Lowering\LocalRewriter\LocalRewriter_Field.cs (4)
63
return
_factory
.BadExpression(tupleField.Type);
80
return
_factory
.BadExpression(tupleField.Type);
87
rewrittenReceiver =
_factory
.Field(rewrittenReceiver, nestedFieldSymbol);
95
return
_factory
.Field(rewrittenReceiver, underlyingField);
Lowering\LocalRewriter\LocalRewriter_FixedStatement.cs (16)
32
statementBuilder.Add(InitializeFixedStatementLocal(localDecl,
_factory
, out pinnedTemp));
39
cleanup[i] =
_factory
.Assignment(
_factory
.Local(pinnedTemp),
_factory
.Null(pinnedTemp.Type));
44
cleanup[i] =
_factory
.Assignment(
_factory
.Local(pinnedTemp),
_factory
.NullRef(pinnedTemp.TypeWithAnnotations), isRef: true);
51
statementBuilder.Add(
_factory
.HiddenSequencePoint());
62
return
_factory
.Block(
65
_factory
.Syntax,
66
_factory
.Block(statementBuilder.ToImmutableAndFree()),
68
_factory
.Block(cleanup)));
73
return
_factory
.Block(localBuilder.ToImmutableAndFree(), statementBuilder.ToImmutableAndFree());
395
rewrittenAlternative:
_factory
.Default(localType),
473
BoundExpression notNullCheck =
_factory
.MakeNullCheck(factory.Syntax, factory.Local(localSymbol), BinaryOperatorKind.NotEqual);
527
BoundExpression notNullCheck =
_factory
.MakeNullCheck(factory.Syntax, arrayTempInit, BinaryOperatorKind.NotEqual);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (27)
83
lengthGet = (MethodSymbol?)
_factory
.WellKnownMember(WellKnownMember.System_Span_T__get_Length, isOptional: true)?.SymbolAsMember(spanType);
84
indexerGet = (MethodSymbol?)
_factory
.WellKnownMember(WellKnownMember.System_Span_T__get_Item, isOptional: true)?.SymbolAsMember(spanType);
89
lengthGet = (MethodSymbol?)
_factory
.WellKnownMember(WellKnownMember.System_ReadOnlySpan_T__get_Length, isOptional: true)?.SymbolAsMember(spanType);
90
indexerGet = (MethodSymbol?)
_factory
.WellKnownMember(WellKnownMember.System_ReadOnlySpan_T__get_Item, isOptional: true)?.SymbolAsMember(spanType);
157
LocalSymbol enumeratorVar =
_factory
.SynthesizedLocal(enumeratorType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachEnumerator);
337
Debug.Assert(
_factory
.CurrentFunction is { });
338
var conversions =
_factory
.CurrentFunction.ContainingAssembly.CorLibrary.TypeConversions;
347
containingMember:
_factory
.CurrentFunction,
348
containingType:
_factory
.CurrentType,
402
var objectType =
_factory
.SpecialType(SpecialType.System_Object);
405
rewrittenCondition:
_factory
.IsNotNullReference(boundEnumeratorVar),
424
LocalSymbol disposableVar =
_factory
.SynthesizedLocal(idisposableTypeSymbol);
623
LocalSymbol collectionTemp =
_factory
.SynthesizedLocal(collectionType, forEachSyntax, kind: SynthesizedLocalKind.ForEachArray, refKind: collectionTempRefKind);
639
LocalSymbol positionVar =
_factory
.SynthesizedLocal(intType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArrayIndex);
754
BoundLocal boundLocal = rewriter.
_factory
.StoreToTemp(rewrittenExpression, out BoundAssignmentOperator? valueStore);
756
collectionVarInitializationPreamble = rewriter.
_factory
.ExpressionStatement(valueStore);
770
Debug.Assert(rewriter.
_factory
.ModuleBuilderOpt is { });
773
NamedTypeSymbol intType = rewriter.
_factory
.SpecialType(SpecialType.System_Int32);
776
elementRef = rewriter.
_factory
.ModuleBuilderOpt.EnsureInlineArrayElementRefExists(syntax, intType, rewriter._diagnostics.DiagnosticBag);
781
elementRef = rewriter.
_factory
.ModuleBuilderOpt.EnsureInlineArrayElementRefReadOnlyExists(syntax, intType, rewriter._diagnostics.DiagnosticBag);
787
return rewriter.
_factory
.Call(null, elementRef, boundArrayVar, boundPositionVar, useStrictArgumentRefKinds: true);
797
BoundExpression arrayLength = rewriter.
_factory
.Literal(length);
917
LocalSymbol arrayVar =
_factory
.SynthesizedLocal(arrayType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArray);
928
LocalSymbol positionVar =
_factory
.SynthesizedLocal(intType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArrayIndex);
1073
LocalSymbol arrayVar =
_factory
.SynthesizedLocal(arrayType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArray);
1093
upperVar[dimension] =
_factory
.SynthesizedLocal(intType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArrayLimit);
1113
positionVar[dimension] =
_factory
.SynthesizedLocal(intType, syntax: forEachSyntax, kind: SynthesizedLocalKind.ForEachArrayIndex);
Lowering\LocalRewriter\LocalRewriter_ForStatement.cs (1)
29
rewrittenCondition = Instrumenter.InstrumentForStatementCondition(node, rewrittenCondition,
_factory
);
Lowering\LocalRewriter\LocalRewriter_HostObjectMemberReference.cs (3)
14
Debug.Assert(
_factory
.TopLevelMethod is { IsStatic: false });
15
Debug.Assert(
_factory
.CurrentType is { });
19
var thisReference = new BoundThisReference(syntax,
_factory
.CurrentType);
Lowering\LocalRewriter\LocalRewriter_IfStatement.cs (1)
31
rewrittenCondition = Instrumenter.InstrumentIfStatementCondition(node, rewrittenCondition,
_factory
);
Lowering\LocalRewriter\LocalRewriter_IndexerAccess.cs (32)
201
Debug.Assert(
_factory
.ModuleBuilderOpt is { });
212
rewrittenReceiver =
_factory
.StoreToTemp(rewrittenReceiver, out receiverStore);
266
DeconstructRange(rewrittenRangeArg,
_factory
.Literal(length), localsBuilder, sideEffectsBuilder, out startExpr, out rangeSizeExpr);
273
possiblyRefCapturedReceiver =
_factory
.StoreToTemp(possiblyRefCapturedReceiver, out var refCapture, createSpan.Parameters[0].RefKind == RefKind.In ? RefKindExtensions.StrictIn : RefKind.Ref);
283
result =
_factory
.Call(null, createSpan, possiblyRefCapturedReceiver, rangeSizeExpr, useStrictArgumentRefKinds: true);
287
result =
_factory
.Call(
_factory
.Call(null, createSpan, possiblyRefCapturedReceiver,
_factory
.Literal(length), useStrictArgumentRefKinds: true),
291
result =
_factory
.Sequence(localsBuilder.ToImmutableAndFree(), sideEffectsBuilder.ToImmutableAndFree(), result);
297
result =
_factory
.Sequence(ImmutableArray.Create(((BoundLocal)rewrittenReceiver).LocalSymbol),
311
integerArgument =
_factory
.Literal(length - offset);
315
integerArgument = MakePatternIndexOffsetExpression(makeOffsetInput,
_factory
.Literal(length), strategy);
328
createSpan =
_factory
.ModuleBuilderOpt.EnsureInlineArrayAsReadOnlySpanExists(node.Syntax, spanType, intType, _diagnostics.DiagnosticBag);
332
createSpan =
_factory
.ModuleBuilderOpt.EnsureInlineArrayAsSpanExists(node.Syntax, spanType, intType, _diagnostics.DiagnosticBag);
354
elementRef =
_factory
.ModuleBuilderOpt.EnsureInlineArrayFirstElementRefExists(node.Syntax, _diagnostics.DiagnosticBag);
359
elementRef =
_factory
.ModuleBuilderOpt.EnsureInlineArrayFirstElementRefReadOnlyExists(node.Syntax, _diagnostics.DiagnosticBag);
364
return
_factory
.Call(null, elementRef, rewrittenReceiver, useStrictArgumentRefKinds: true);
373
elementRef =
_factory
.ModuleBuilderOpt.EnsureInlineArrayElementRefExists(node.Syntax, intType, _diagnostics.DiagnosticBag);
378
elementRef =
_factory
.ModuleBuilderOpt.EnsureInlineArrayElementRefReadOnlyExists(node.Syntax, intType, _diagnostics.DiagnosticBag);
383
return
_factory
.Call(null, elementRef, rewrittenReceiver, index, useStrictArgumentRefKinds: true);
394
return
_factory
.Call(
_factory
.Call(null, createSpan, rewrittenReceiver,
_factory
.Literal(length), useStrictArgumentRefKinds: true), getItemOrSliceHelper, index);
465
return
_factory
.Sequence(
487
var F =
_factory
;
650
return
_factory
.Literal(0);
666
return
_factory
.IntSubtract(lengthAccess, loweredExpr);
681
return
_factory
.Call(
757
var F =
_factory
;
787
var F =
_factory
;
998
var F =
_factory
;
1029
var F =
_factory
;
Lowering\LocalRewriter\LocalRewriter_IsOperator.cs (1)
73
return
_factory
.MakeNullCheck(syntax, rewrittenOperand, BinaryOperatorKind.NotEqual);
Lowering\LocalRewriter\LocalRewriter_IsPatternOperator.cs (2)
17
BoundDecisionDag decisionDag = node.GetDecisionDagForLowering(
_factory
.Compilation);
48
result = this.
_factory
.Not(result);
Lowering\LocalRewriter\LocalRewriter_Literal.cs (1)
70
var curMethod =
_factory
.CurrentFunction;
Lowering\LocalRewriter\LocalRewriter_LocalDeclaration.cs (1)
57
_factory
.AssignmentExpression(
Lowering\LocalRewriter\LocalRewriter_LockStatement.cs (3)
62
BoundLocal boundTemp =
_factory
.StoreToTemp(enterScopeCall,
100
BoundLocal boundLockTemp =
_factory
.StoreToTemp(rewrittenArgument, out assignmentToLockTemp, syntaxOpt: lockSyntax, kind: SynthesizedLocalKind.Lock);
144
BoundLocal boundLockTakenTemp =
_factory
.StoreToTemp(
Lowering\LocalRewriter\LocalRewriter_NullCoalescingAssignmentOperator.cs (5)
96
var lhsTemp =
_factory
.StoreToTemp(lhsRead, out var store);
103
var tmp =
_factory
.StoreToTemp(BoundCall.Synthesized(leftOperand.Syntax, lhsRead, initialBindingReceiverIsSubjectToCloning: ThreeState.Unknown, getValueOrDefault),
129
var alternative =
_factory
.Sequence(ImmutableArray<LocalSymbol>.Empty, ImmutableArray.Create(tmpAssignment, transformedLhsAssignment), tmp);
132
var ternary =
_factory
.Conditional(lhsReadHasValue, tmp, alternative, tmp.Type);
134
return
_factory
.Sequence(temps.ToImmutableAndFree(), stores.ToImmutableAndFree(), ternary);
Lowering\LocalRewriter\LocalRewriter_NullCoalescingOperator.cs (2)
160
BoundLocal boundTemp =
_factory
.StoreToTemp(rewrittenLeft, out tempAssignment);
163
BoundExpression nullCheck =
_factory
.MakeNullCheck(syntax, boundTemp, BinaryOperatorKind.NotEqual);
Lowering\LocalRewriter\LocalRewriter_ObjectCreationExpression.cs (19)
167
BoundLocal oldValue =
_factory
.StoreToTemp(rewrittenReceiver, out BoundAssignmentOperator boundAssignmentToTemp);
171
BoundExpression value =
_factory
.New(anonymousType, getAnonymousTypeValues(withExpr, oldValue, anonymousType, sideEffects, temps));
186
expression =
_factory
.Convert(
188
_factory
.Call(
213
BoundLocal valueTemp =
_factory
.StoreToTemp(rewrittenRight, out BoundAssignmentOperator boundAssignmentToTemp);
232
builder.Add(
_factory
.Property(oldValue, property));
266
BoundLocal value =
_factory
.StoreToTemp(rewrittenExpression, out boundAssignmentToTemp, isKnownToReferToTempIfReferenceType: true);
376
SyntaxNode oldSyntax =
_factory
.Syntax;
377
_factory
.Syntax = node.Syntax;
379
var ctor =
_factory
.WellKnownMethod(WellKnownMember.System_Guid__ctor);
385
newGuid =
_factory
.New(ctor,
_factory
.Literal(node.GuidString));
392
var getTypeFromCLSID =
_factory
.WellKnownMethod(WellKnownMember.System_Runtime_InteropServices_Marshal__GetTypeFromCLSID, isOptional: true);
396
getTypeFromCLSID =
_factory
.WellKnownMethod(WellKnownMember.System_Type__GetTypeFromCLSID);
403
callGetTypeFromCLSID =
_factory
.Call(null, getTypeFromCLSID, newGuid);
410
var createInstance =
_factory
.WellKnownMethod(WellKnownMember.System_Activator__CreateInstance);
415
rewrittenObjectCreation =
_factory
.Convert(node.Type,
_factory
.Call(null, createInstance, callGetTypeFromCLSID));
422
_factory
.Syntax = oldSyntax;
Lowering\LocalRewriter\LocalRewriter_ObjectOrCollectionInitializerExpression.cs (3)
423
var rangeTemp =
_factory
.StoreToTemp(rangeArgument, out BoundAssignmentOperator rangeStore);
455
var temp =
_factory
.StoreToTemp(rewrittenIndex, out store);
642
var temp =
_factory
.StoreToTemp(arg, out store, refKind);
Lowering\LocalRewriter\LocalRewriter_PreviousSubmissionReference.cs (3)
16
Debug.Assert(
_factory
.TopLevelMethod is { IsStatic: false });
17
Debug.Assert(
_factory
.CurrentType is { });
23
var thisReference = new BoundThisReference(syntax,
_factory
.CurrentType);
Lowering\LocalRewriter\LocalRewriter_Range.cs (2)
22
var F =
_factory
;
161
var F =
_factory
;
Lowering\LocalRewriter\LocalRewriter_ReturnStatement.cs (2)
29
(node.Syntax.Kind() == SyntaxKind.Block &&
_factory
.CurrentFunction?.IsAsync == false))))
41
var method =
_factory
.CurrentFunction;
Lowering\LocalRewriter\LocalRewriter_StackAlloc.cs (11)
34
return
_factory
.Default(type);
63
constructorCall =
_factory
.New((MethodSymbol)spanConstructor.SymbolAsMember(spanType), stackAllocNode, countTemp);
81
var tempAccess =
_factory
.StoreToTemp(constructorCall, out BoundAssignmentOperator tempAssignment, syntaxOpt: stackAllocNode.Syntax);
109
TypeSymbol uintType =
_factory
.SpecialType(SpecialType.System_UInt32);
110
TypeSymbol uintPtrType =
_factory
.SpecialType(SpecialType.System_UIntPtr);
117
BoundExpression sizeOfExpression =
_factory
.Sizeof(elementType);
134
return
_factory
.Convert(uintPtrType,
_factory
.Literal((uint)folded), Conversion.IntegerToPointer);
139
BoundExpression convertedCount =
_factory
.Convert(uintType, countExpression, Conversion.ExplicitNumeric);
140
convertedCount =
_factory
.Convert(uintPtrType, convertedCount, Conversion.IntegerToPointer);
149
BoundExpression product =
_factory
.Binary(multiplicationKind, uintPtrType, convertedCount, sizeOfExpression);
Lowering\LocalRewriter\LocalRewriter_StringConcat.cs (11)
88
result =
_factory
.StringLiteral(string.Empty);
298
return
_factory
.StringLiteral(concatenated);
307
return
_factory
.Literal(string.Empty);
365
return
_factory
.Coalesce(loweredOperand,
_factory
.Literal(""));
413
var array =
_factory
.ArrayOrEmpty(
_factory
.SpecialType(SpecialType.System_String), loweredArgs);
481
_factory
,
640
return
_factory
.StringLiteral(cv.CharValue.ToString());
727
var temp =
_factory
.StoreToTemp(expr, out var store);
728
return
_factory
.Sequence(
Lowering\LocalRewriter\LocalRewriter_StringInterpolation.cs (15)
34
var builderTempSymbol =
_factory
.InterpolatedStringHandlerLocal(data.BuilderType, syntax);
35
BoundLocal builderTemp =
_factory
.Local(builderTempSymbol);
59
var outLocal =
_factory
.SynthesizedLocal(localType);
60
appendShouldProceedLocal =
_factory
.Local(outLocal);
65
var handlerConstructionAssignment =
_factory
.AssignmentExpression(builderTemp, (BoundExpression)VisitObjectCreationExpression(construction));
115
:
_factory
.LogicalAnd(currentExpression, actualCall);
131
var resultIf =
_factory
.If(appendShouldProceedLocal,
_factory
.StatementList(appendCallsStatements));
133
return new InterpolationHandlerResult(ImmutableArray.Create(
_factory
.ExpressionStatement(handlerConstructionAssignment), resultIf), builderTemp, appendShouldProceedLocal.LocalSymbol, this);
162
return
_factory
.StringLiteral("");
178
part =
_factory
.StringLiteral(part.ConstantValueOpt.StringValue);
183
_factory
.Binary(BinaryOperatorKind.StringConcatenation, node.Type, result, part);
197
result = new BoundNullCoalescingOperator(result.Syntax, result,
_factory
.StringLiteral(""), leftPlaceholder: placeholder, leftConversion: placeholder, BoundNullCoalescingOperatorResultKind.LeftType, @checked: false, result.Type) { WasCompilerGenerated = true };
291
return _rewriter.
_factory
.Sequence(locals, _expressions, result);
296
return _rewriter.
_factory
.SpillSequence(locals, _statements, result);
Lowering\LocalRewriter\LocalRewriter_TryStatement.cs (1)
101
_factory
);
Lowering\LocalRewriter\LocalRewriter_TupleBinaryOperator.cs (16)
38
BoundExpression result =
_factory
.Sequence(temps.ToImmutableAndFree(), initEffects.ToImmutableAndFree(), returnValue);
308
BoundExpression innerSequence =
_factory
.Sequence(locals: ImmutableArray<LocalSymbol>.Empty, innerEffects.ToImmutableAndFree(), logicalExpression);
322
return
_factory
.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(),
323
result: boolValue ?
_factory
.Not(leftHasValue) : leftHasValue);
330
return
_factory
.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(),
331
result: boolValue ?
_factory
.Not(rightHasValue) : rightHasValue);
339
_factory
.Sequence(ImmutableArray<LocalSymbol>.Empty, outerEffects.ToImmutableAndFree(),
340
_factory
.Conditional(
341
_factory
.Binary(BinaryOperatorKind.Equal, boolType, leftHasValue, rightHasValue),
342
_factory
.Conditional(leftHasValue, innerSequence, MakeBooleanConstant(right.Syntax, boolValue), boolType),
411
return
_factory
.MakeNullableHasValue(expr.Syntax, expr);
418
BoundLocal temp =
_factory
.StoreToTemp(loweredExpression, out BoundAssignmentOperator assignmentToTemp);
503
currentResult =
_factory
.Binary(logicalOperator, type, currentResult, nextLogicalOperand);
558
return
_factory
.Not(MakeUnaryOperator(UnaryOperatorKind.DynamicFalse, left.Syntax, method: null, constrainedToTypeOpt: null, dynamicResult, boolType));
572
BoundExpression binary = MakeBinaryOperator(
_factory
.Syntax, single.Kind, left, right, single.MethodSymbolOpt?.ReturnType ?? boolType, single.MethodSymbolOpt, single.ConstrainedToTypeOpt);
588
result =
_factory
.Not(result);
Lowering\LocalRewriter\LocalRewriter_TupleCreationExpression.cs (2)
63
return
_factory
.BadExpression(type);
80
return
_factory
.BadExpression(type);
Lowering\LocalRewriter\LocalRewriter_UnaryOperator.cs (8)
95
return
_factory
.Literal(constant.BooleanValue);
97
return MakeConversionNode(
_factory
.Literal(!constant.BooleanValue), type, @checked: false);
203
BoundLocal boundTemp =
_factory
.StoreToTemp(loweredOperand, out tempAssignment);
207
BoundExpression condition =
_factory
.MakeNullableHasValue(syntax, boundTemp);
443
LocalSymbol tempSymbol =
_factory
.SynthesizedLocal(operandType);
669
BoundLocal boundTemp =
_factory
.StoreToTemp(rewrittenArgument, out tempAssignment);
675
BoundExpression condition =
_factory
.MakeNullableHasValue(node.Syntax, boundTemp);
841
BoundExpression condition =
_factory
.MakeNullableHasValue(syntax, operand);
Lowering\LocalRewriter\LocalRewriter_UsingStatement.cs (5)
176
boundTemp =
_factory
.StoreToTemp(tempInit, out tempAssignment, kind: SynthesizedLocalKind.Using);
181
boundTemp =
_factory
.StoreToTemp(rewrittenExpression, out tempAssignment, syntaxOpt: usingSyntax, kind: SynthesizedLocalKind.Using);
252
BoundLocal boundTemp =
_factory
.StoreToTemp(tempInit, out tempAssignment, kind: SynthesizedLocalKind.Using);
383
ifCondition =
_factory
.MakeNullableHasValue(resourceSyntax, local);
392
ifCondition =
_factory
.MakeNullCheck(resourceSyntax, local, BinaryOperatorKind.NotEqual);
Lowering\LocalRewriter\LocalRewriter_WhileStatement.cs (1)
28
rewrittenCondition = Instrumenter.InstrumentWhileStatementCondition(node, rewrittenCondition,
_factory
);
Lowering\LocalRewriter\LocalRewriter_Yield.cs (1)
21
(!node.WasCompilerGenerated || (node.Syntax.Kind() == SyntaxKind.Block &&
_factory
.CurrentFunction?.IsAsync == false)))