1 write to F
Microsoft.CodeAnalysis.VisualBasic (1)
Lowering\StateMachineRewriter\StateMachineRewriter.StateMachineMethodToClassRewriter.vb (1)
93
Me.
F
= F
371 references to F
Microsoft.CodeAnalysis.VisualBasic (371)
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Await.vb (83)
35
Dim awaiterTemp As LocalSymbol = Me.
F
.SynthesizedLocal(awaiterType, kind:=SynthesizedLocalKind.Awaiter, syntax:=node.Syntax)
41
PlaceholderReplacementMap.Add(awaiterInstancePlaceholder, Me.
F
.Local(awaiterTemp, True))
77
Me.
F
.If(
78
condition:=Me.
F
.Convert(Me.
F
.SpecialType(SpecialType.System_Boolean), rewrittenIsCompleted),
79
thenClause:=Me.
F
.StatementList(),
84
Me.
F
.If(
85
condition:=Me.
F
.Not(rewrittenIsCompleted),
91
Me.
F
.AssignmentExpression(Me.
F
.Local(awaiterTemp, True), Me.
F
.Null(awaiterTemp.Type))
97
Dim resultTemp As LocalSymbol = Me.
F
.SynthesizedLocal(rewrittenType)
98
onAwaitFinished = Me.
F
.Sequence(resultTemp,
99
Me.
F
.AssignmentExpression(Me.
F
.Local(resultTemp, True), rewrittenGetResult),
101
Me.
F
.Local(resultTemp, False))
106
onAwaitFinished = Me.
F
.Sequence(rewrittenGetResult, clearAwaiterTemp)
109
Return builder.BuildSequenceAndFree(Me.
F
, onAwaitFinished)
120
awaiterFieldType = Me.
F
.SpecialType(SpecialType.System_Object)
128
Me.
F
.Assignment(
129
Me.
F
.Field(Me.
F
.Me(), Me.StateField, True),
130
Me.
F
.AssignmentExpression(Me.
F
.Local(Me.CachedState, True), Me.
F
.Literal(state))))
133
blockBuilder.Add(Me.
F
.NoOp(NoOpStatementFlavor.AwaitYieldPoint))
137
Me.
F
.Assignment(
138
Me.
F
.Field(Me.
F
.Me(), awaiterField, True),
140
DirectCast(Me.
F
.Local(awaiterTemp, False), BoundExpression),
141
Me.
F
.Convert(awaiterFieldType, Me.
F
.Local(awaiterTemp, False)))))
148
Dim builderFieldAsRValue As BoundExpression = Me.
F
.Field(Me.
F
.Me(), Me._builder, False)
150
Dim ICriticalNotifyCompletion = Me.
F
.WellKnownType(WellKnownType.System_Runtime_CompilerServices_ICriticalNotifyCompletion)
161
Dim asCriticalNotifyCompletion As LocalSymbol = Me.
F
.SynthesizedLocal(ICriticalNotifyCompletion)
163
Me.
F
.SynthesizedLocal(Me.
F
.WellKnownType(WellKnownType.System_Runtime_CompilerServices_INotifyCompletion))
165
Dim awaiterTempAsRValue As BoundLocal = Me.
F
.Local(awaiterTemp, False)
166
Dim criticalNotifyCompletionAsLValue As BoundLocal = Me.
F
.Local(asCriticalNotifyCompletion, True)
167
Dim notifyCompletionAsLValue As BoundLocal = Me.
F
.Local(asNotifyCompletion, True)
172
Me.
F
.TryCast(awaiterTempAsRValue, asCriticalNotifyCompletion.Type),
177
Me.
F
.ExpressionStatement(
182
ImmutableArray.Create(Of TypeSymbol)(asCriticalNotifyCompletion.Type, Me.
F
.Me().Type),
183
{criticalNotifyCompletionAsLValue, Me.
F
.ReferenceOrByrefMe()}))
189
Me.
F
.DirectCast(awaiterTempAsRValue, asNotifyCompletion.Type),
194
Me.
F
.ExpressionStatement(
199
ImmutableArray.Create(Of TypeSymbol)(asNotifyCompletion.Type, Me.
F
.Me().Type),
200
{notifyCompletionAsLValue, Me.
F
.ReferenceOrByrefMe()}))
203
Me.
F
.Block(
206
Me.
F
.If(
207
condition:=Me.
F
.Not(Me.
F
.ReferenceIsNothing(Me.
F
.Local(asCriticalNotifyCompletion, False))),
209
elseClause:=Me.
F
.Block(
217
Dim useSiteInfo As New CompoundUseSiteInfo(Of AssemblySymbol)(Me.
F
.Diagnostics, Me.CompilationState.Compilation.Assembly)
225
Me.
F
.Diagnostics.Add(Me.
F
.Syntax, useSiteInfo)
228
Me.
F
.ExpressionStatement(
233
ImmutableArray.Create(Of TypeSymbol)(awaiterType, Me.
F
.Me().Type),
234
{Me.
F
.Local(awaiterTemp, True), Me.
F
.ReferenceOrByrefMe()})))
243
blockBuilder.Add(Me.
F
.Goto(Me._exitLabel))
246
blockBuilder.Add(Me.
F
.Label(resumeLabel))
250
blockBuilder.Add(Me.
F
.NoOp(NoOpStatementFlavor.AwaitResumePoint))
254
Me.
F
.Assignment(
255
Me.
F
.Field(Me.
F
.Me(), Me.StateField, True),
256
Me.
F
.AssignmentExpression(Me.
F
.Local(Me.CachedState, True), Me.
F
.Literal(StateMachineState.NotStartedOrRunningState))))
262
Me.
F
.Assignment(
263
Me.
F
.Local(awaiterTemp, True),
265
DirectCast(Me.
F
.Field(Me.
F
.Me(), awaiterField, False), BoundExpression),
266
Me.
F
.Convert(awaiterTemp.Type, Me.
F
.Field(Me.
F
.Me(), awaiterField, False)))))
272
Me.
F
.Assignment(
273
Me.
F
.Field(Me.
F
.Me(), awaiterField, True),
274
Me.
F
.Null(awaiterField.Type)))
276
Return Me.
F
.Block(blockBuilder.ToImmutableAndFree())
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Expressions.vb (73)
80
Return builder.BuildSequenceAndFree(Me.
F
, valueOpt)
90
Return Me.
F
.ExpressionStatement(expression)
150
spilledReferenceReceiver = referenceReceiverBuilder.BuildSequenceAndFree(Me.
F
, spilledReferenceReceiver)
156
Dim isValueTypeCheck = Me.
F
.ReferenceIsNotNothing(Me.
F
.DirectCast(Me.
F
.DirectCast(Me.
F
.Null(), receiverType),
157
Me.
F
.SpecialType(SpecialType.System_Object)))
161
builder.AddStatement(Me.
F
.If(Me.
F
.Not(isValueTypeCheck), Me.
F
.StatementList(referenceReceiverSpillSequence.Statements)))
177
Return builder.BuildSequenceAndFree(Me.
F
,
201
Return builder.BuildSequenceAndFree(Me.
F
,
246
Dim tempLocal As LocalSymbol = Me.
F
.SynthesizedLocal(rewritten.Type)
251
Me.
F
.If(condition:=spilledLeft,
253
elseClause:=MakeAssignmentStatement(Me.
F
.Literal(False), tempLocal)),
254
Me.
F
.If(condition:=spilledLeft,
255
thenClause:=MakeAssignmentStatement(Me.
F
.Literal(True), tempLocal),
258
Return builder.BuildSequenceAndFree(Me.
F
,
259
Me.
F
.Local(tempLocal, False))
263
Return builder.BuildSequenceAndFree(Me.
F
,
313
Return builder.BuildSequenceAndFree(Me.
F
,
377
Return Me.
F
.Sequence(initializersBuilder.ToArrayAndFree)
504
Dim tempLocal As LocalSymbol = Me.
F
.SynthesizedLocal(rewritten.Type)
509
Me.
F
.If(
514
sequenceValueOpt = Me.
F
.Local(tempLocal, False)
517
Me.
F
.If(
525
Return builder.BuildSequenceAndFree(Me.
F
, sequenceValueOpt)
533
Return RewriteSpillSequenceIntoBlock(spill, False, Me.
F
.Assignment(Me.
F
.Local(temp, True), spill.ValueOpt))
535
Return Me.
F
.Assignment(Me.
F
.Local(temp, True), expression)
541
Return Me.
F
.Assignment(Me.
F
.Local(temp, True), expression)
655
spilledReferenceReceiver = referenceReceiverBuilder.BuildSequenceAndFree(Me.
F
, spilledReferenceReceiver)
661
Dim isValueTypeCheck = Me.
F
.ReferenceIsNotNothing(Me.
F
.DirectCast(Me.
F
.DirectCast(Me.
F
.Null(), receiver.Type),
662
Me.
F
.SpecialType(SpecialType.System_Object)))
666
builder.AddStatement(Me.
F
.If(Me.
F
.Not(isValueTypeCheck), Me.
F
.StatementList(referenceReceiverSpillSequence.Statements)))
672
nullCheckTarget = New BoundComplexConditionalAccessReceiver(Me.
F
.Syntax,
679
receiverLocal = Me.
F
.SynthesizedLocal(receiver.Type)
682
nullCheckTarget = Me.
F
.AssignmentExpression(Me.
F
.Local(receiverLocal, isLValue:=True), receiver.MakeRValue())
683
capturedReceiver = Me.
F
.Local(receiverLocal, isLValue:=True)
697
placeholderReplacement = New BoundComplexConditionalAccessReceiver(Me.
F
.Syntax,
719
condition = Me.
F
.ReferenceIsNotNothing(nullCheckTarget)
728
Dim notReferenceType = Me.
F
.ReferenceIsNotNothing(Me.
F
.DirectCast(Me.
F
.DirectCast(Me.
F
.Null(),
730
Me.
F
.SpecialType(SpecialType.System_Object)))
732
condition = Me.
F
.LogicalOrElse(notReferenceType,
733
Me.
F
.ReferenceIsNotNothing(Me.
F
.DirectCast(nullCheckTarget,
734
Me.
F
.SpecialType(SpecialType.System_Object))))
741
Me.
F
.If(condition:=condition,
744
Return builder.BuildSequenceAndFree(Me.
F
, expression:=Nothing)
747
Dim tempLocal As LocalSymbol = Me.
F
.SynthesizedLocal(type)
751
builder.AddStatement(Me.
F
.If(condition:=condition,
755
Return builder.BuildSequenceAndFree(Me.
F
, expression:=Me.
F
.Local(tempLocal, False))
844
Return builder.BuildSequenceAndFree(Me.
F
,
896
Return builder.BuildSequenceAndFree(Me.
F
,
949
Dim tempLocal As LocalSymbol = Me.
F
.SynthesizedLocal(rewritten.Type)
955
Me.
F
.If(
956
condition:=Me.
F
.ReferenceIsNothing(Me.
F
.Local(tempLocal, False)),
959
Return builder.BuildSequenceAndFree(Me.
F
,
960
Me.
F
.Local(tempLocal, False))
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Spilling.vb (39)
248
builder.AddStatement(Me.
F
.ExpressionStatement(sideEffect))
276
builder.AddStatement(Me.
F
.ExpressionStatement(array))
305
builder.AddStatement(Me.
F
.ExpressionStatement(fieldAccess))
318
spilledValueReceiver = valueReceiverBuilder.BuildSequenceAndFree(Me.
F
, spilledValueReceiver)
323
spilledReferenceReceiver = referenceReceiverBuilder.BuildSequenceAndFree(Me.
F
, spilledReferenceReceiver)
332
Dim isValueTypeCheck = Me.
F
.ReferenceIsNotNothing(Me.
F
.DirectCast(Me.
F
.DirectCast(Me.
F
.Null(), complexReceiver.Type),
333
Me.
F
.SpecialType(SpecialType.System_Object)))
336
builder.AddStatement(Me.
F
.If(Me.
F
.Not(isValueTypeCheck), Me.
F
.StatementList(referenceReceiverSpillSequence.Statements)))
344
Dim isValueTypeCheck = Me.
F
.ReferenceIsNotNothing(Me.
F
.DirectCast(Me.
F
.DirectCast(Me.
F
.Null(), complexReceiver.Type),
345
Me.
F
.SpecialType(SpecialType.System_Object)))
348
builder.AddStatement(Me.
F
.If(isValueTypeCheck, Me.
F
.StatementList(valueReceiverSpillSequence.Statements)))
355
Dim isValueTypeCheck = Me.
F
.ReferenceIsNotNothing(Me.
F
.DirectCast(Me.
F
.DirectCast(Me.
F
.Null(), complexReceiver.Type),
356
Me.
F
.SpecialType(SpecialType.System_Object)))
361
builder.AddStatement(Me.
F
.If(isValueTypeCheck, Me.
F
.StatementList(valueReceiverSpillSequence.Statements), Me.
F
.StatementList(referenceReceiverSpillSequence.Statements)))
414
Dim initialization As BoundStatement = Me.
F
.Assignment(Me.
F
.Field(Me.
F
.Me(), spillField, True), expr)
422
Return Me.
F
.Field(Me.
F
.Me(), spillField, False)
441
newStatements.Add(Me.
F
.ExpressionStatement(spill.ValueOpt))
452
newStatements.Add(
F
.Assignment(
F
.Field(
F
.Me(), field, True),
F
.Null(field.Type)))
458
Return Me.
F
.Block(spill.Locals, newStatements.ToImmutableAndFree())
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.Statements.vb (9)
32
Return Me.
F
.Block(
36
Me.
F
.Assignment(Me.
F
.Local(Me._exprRetValue, True), spill.ValueOpt)),
37
Me.
F
.Goto(Me._exprReturnLabel))
39
Return Me.
F
.Block(
40
Me.
F
.Assignment(
41
Me.
F
.Local(Me._exprRetValue, True), expression),
42
Me.
F
.Goto(Me._exprReturnLabel))
46
Return
F
.Goto(Me._exprReturnLabel)
Lowering\AsyncRewriter\AsyncRewriter.AsyncMethodToClassRewriter.vb (43)
86
Me._exprRetValue = Me.
F
.SynthesizedLocal(Me._owner._resultType, SynthesizedLocalKind.StateMachineReturnValue, F.Syntax)
113
If Me.SlotAllocatorOpt Is Nothing OrElse Not Me.SlotAllocatorOpt.TryGetPreviousAwaiterSlotIndex(
F
.CompilationState.ModuleBuilderOpt.Translate(awaiterType,
F
.Syntax,
F
.Diagnostics.DiagnosticBag),
F
.Diagnostics.DiagnosticBag, slotIndex) Then
119
result = Me.
F
.StateMachineField(awaiterType, Me._method, fieldName, SynthesizedLocalKind.AwaiterField, slotIndex, accessibility:=Accessibility.Friend)
129
Me.
F
.CurrentMethod = moveNextMethod
159
Me.
F
.Assignment(
160
Me.
F
.Local(Me.CachedState, True),
161
Me.
F
.Field(Me.
F
.Me(), Me.StateField, False)))
167
Dim exceptionLocal = Me.
F
.SynthesizedLocal(Me.
F
.WellKnownType(WellKnownType.System_Exception))
169
Me.
F
.Try(
170
Me.
F
.Block(
176
Me.
F
.CatchBlocks(
177
Me.
F
.Catch(
179
Me.
F
.Block(
181
Me.
F
.Assignment(Me.
F
.Field(Me.
F
.Me(), Me.StateField, True), Me.
F
.Literal(StateMachineState.FinishedState)),
182
Me.
F
.ExpressionStatement(
184
Me.
F
.Field(Me.
F
.Me(), Me._builder, False),
187
Me.
F
.Local(exceptionLocal, False))),
188
Me.
F
.Goto(Me._exitLabel)),
192
bodyBuilder.Add(Me.
F
.Label(Me._exprReturnLabel))
195
Dim stateDone = Me.
F
.Assignment(
196
Me.
F
.Field(Me.
F
.Me(), Me.StateField, True),
197
Me.
F
.AssignmentExpression(Me.
F
.Local(Me.CachedState, True), Me.
F
.Literal(StateMachineState.FinishedState)))
202
bodyBuilder.Add(Me.
F
.SequencePointWithSpan(block, block.EndBlockStatement.Span, stateDone))
208
Me.
F
.ExpressionStatement(
210
Me.
F
.Field(Me.
F
.Me(), Me._builder, False),
214
{Me.
F
.Local(Me._exprRetValue, False)}, Array.Empty(Of BoundExpression)()))))
217
bodyBuilder.Add(Me.
F
.Label(Me._exitLabel))
218
bodyBuilder.Add(Me.
F
.Return())
221
Dim newBody = Me.
F
.Block(
241
Return Me.
F
.Goto(Me._exitLabel)
Lowering\AsyncRewriter\AsyncRewriter.CapturedSymbolOrExpression.vb (6)
58
Return New BoundLiteral(rewriter.
F
.Syntax, Me._constValue, Me._type)
73
Dim syntax As SyntaxNode = rewriter.
F
.Syntax
76
Return rewriter.
F
.Field(framePointer, proxyFieldParented, isLValue)
128
rewriter.
F
.AssignmentExpression(
157
Return rewriter.
F
.Field(newReceiverOpt, rewriter.VisitFieldSymbol(Me.Field), isLValue)
194
Return rewriter.
F
.ArrayAccess(arrayPointer, isLValue, indices)
Lowering\IteratorRewriter\IteratorRewriter.IteratorMethodToClassRewriter.vb (76)
59
F
.CurrentMethod = moveNextMethod
64
Me._methodValue = Me.
F
.SynthesizedLocal(
F
.CurrentMethod.ReturnType, SynthesizedLocalKind.StateMachineReturnValue,
F
.Syntax)
79
F
.CloseMethod(
80
F
.Block(
83
F
.Assignment(Me.
F
.Local(Me.CachedState, True),
F
.Field(
F
.Me, Me.StateField, False)),
86
F
.Label(initialLabel),
87
F
.Assignment(
F
.Field(
F
.Me, Me.StateField, True), Me.
F
.AssignmentExpression(Me.
F
.Local(Me.CachedState, True), Me.
F
.Literal(StateMachineState.NotStartedOrRunningState))),
96
F
.CurrentMethod = disposeMethod
97
Dim breakLabel =
F
.GenerateLabel("break")
101
Select
F
.SwitchSection(
103
F
.Assignment(
F
.Field(
F
.Me, Me.StateField, True),
F
.Literal(Value)),
104
F
.Goto(breakLabel))).ToArray()
107
F
.CloseMethod(
F
.Block(
108
F
.Select(
109
F
.Field(
F
.Me, Me.StateField, False),
111
F
.Assignment(
F
.Field(
F
.Me, Me.StateField, True),
F
.Literal(StateMachineState.NotStartedOrRunningState)),
112
F
.Label(breakLabel),
113
F
.ExpressionStatement(
F
.Call(
F
.Me, moveNextMethod)),
114
F
.Return()
117
F
.CloseMethod(
F
.Return())
124
Return
F
.StatementList()
129
Return
F
.Block(
131
F
.Assignment(
F
.Local(Me._methodValue, True),
F
.Literal(True)),
132
F
.Label(Me._exitLabel),
133
F
.Return(Me.
F
.Local(Me._methodValue, False))
139
Dim result =
F
.Literal(Not finished)
143
Return
F
.Return(result)
149
Me._exitLabel =
F
.GenerateLabel("exitLabel")
152
Return Me.
F
.Block(
153
Me.
F
.Assignment(Me.
F
.Local(Me._methodValue, True), result),
154
Me.
F
.Goto(Me._exitLabel)
198
Return
F
.SequencePoint(
200
F
.Block(
201
F
.Assignment(
F
.Field(
F
.Me, Me._current, True), DirectCast(Visit(node.Expression), BoundExpression)),
202
F
.Assignment(
F
.Field(
F
.Me, Me.StateField, True),
F
.AssignmentExpression(
F
.Local(Me.CachedState, True),
F
.Literal(stateNumber))),
204
F
.Label(resumeLabel),
205
F
.Assignment(
F
.Field(
F
.Me, Me.StateField, True),
F
.AssignmentExpression(
F
.Local(Me.CachedState, True),
F
.Literal(StateMachineState.NotStartedOrRunningState)))
218
Dim syntax As SyntaxNode = Me.
F
.Syntax
221
Return Me.
F
.Field(framePointer, proxyFieldParented, origExpression.IsLValue)
Lowering\StateMachineRewriter\StateMachineRewriter.StateMachineMethodToClassRewriter.vb (42)
125
Return Me.
F
.CurrentType.TypeSubstitution
131
Return Me.
F
.CurrentMethod
137
Return Me.
F
.TopLevelMethod
142
Dim oldSyntax As SyntaxNode = Me.
F
.Syntax
143
Me.
F
.Syntax = syntax
144
Dim result = Me.
F
.Me()
146
Me.
F
.Syntax = oldSyntax
191
resumeLabel =
F
.GenerateLabel(ResumeLabelName)
205
Select
F
.SwitchSection(kv.Value,
F
.Goto(kv.Key))
207
Dim result =
F
.Select(
F
.Local(CachedState, isLValue:=False), sections)
218
result =
F
.Block(result, missingStateDispatch)
226
Return _resumableStateAllocator.GenerateThrowMissingStateDispatch(
F
,
F
.Local(CachedState, isLValue:=False), EncMissingStateErrorCode)
236
Dim oldSyntax As SyntaxNode = Me.
F
.Syntax
237
Me.
F
.Syntax = node.Syntax
239
Me.
F
.Syntax = oldSyntax
292
Return Me.
F
.Block(New BoundStateMachineScope(Me.
F
.Syntax, hoistedLocals, statement).MakeCompilerGenerated)
344
Dim tryBlock As BoundBlock = Me.
F
.Block(DirectCast(Me.Visit(node.TryBlock), BoundStatement))
347
dispatchLabel = Me.
F
.GenerateLabel("tryDispatch")
354
Dim finalizer As GeneratedLabelSymbol = Me.
F
.GenerateLabel("finalizer")
357
Dim skipFinalizer As GeneratedLabelSymbol = Me.
F
.GenerateLabel("skipFinalizer")
358
tryBlock = Me.
F
.Block(SyntheticBoundNodeFactory.HiddenSequencePoint(),
360
Me.
F
.Goto(skipFinalizer),
361
Me.
F
.Label(finalizer),
362
Me.
F
.Assignment(
363
F
.Field(
F
.Me(), Me.StateField, True),
364
F
.AssignmentExpression(
F
.Local(Me.CachedState, True),
F
.Literal(StateMachineState.NotStartedOrRunningState))),
366
Me.
F
.Label(skipFinalizer),
370
tryBlock = Me.
F
.Block(SyntheticBoundNodeFactory.HiddenSequencePoint(), Me.Dispatch(isOutermost:=False), tryBlock)
387
Me.
F
.Block(
389
Me.
F
.If(
390
condition:=Me.
F
.IntLessThan(
391
Me.
F
.Local(Me.CachedState, False),
392
Me.
F
.Literal(StateMachineState.FirstUnusedState)),
398
result = Me.
F
.Block(SyntheticBoundNodeFactory.HiddenSequencePoint(), Me.
F
.Label(dispatchLabel), result)