53 writes to CurrentFunction
Microsoft.CodeAnalysis.CSharp (53)
Compiler\MethodBodySynthesizer.Lowered.cs (5)
51
F.
CurrentFunction
= this;
142
F.
CurrentFunction
= this;
243
F.
CurrentFunction
= (MethodSymbol)this.OriginalDefinition;
281
F.
CurrentFunction
= (MethodSymbol)this.OriginalDefinition;
320
F.
CurrentFunction
= this.OriginalDefinition;
Emitter\Model\SynthesizedPrivateImplementationDetailsStaticConstructor.cs (1)
32
factory.
CurrentFunction
= this;
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (5)
39
_F.
CurrentFunction
= containingMethod;
710
_F.
CurrentFunction
= node.Symbol;
715
_F.
CurrentFunction
= oldContainingSymbol;
726
_F.
CurrentFunction
= node.Symbol;
731
_F.
CurrentFunction
= oldContainingSymbol;
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
138
F.
CurrentFunction
= moveNextMethod;
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (1)
162
F.
CurrentFunction
= stateMachineType.Constructor;
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
197
F.
CurrentFunction
= stateMachineType.Constructor;
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (2)
124
methodBodyFactory.
CurrentFunction
= method;
135
methodBodyFactory.
CurrentFunction
= oldMethod;
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (4)
98
F.
CurrentFunction
= moveNextMethod;
158
F.
CurrentFunction
= disposeMethod;
396
F.
CurrentFunction
= finallyMethod;
418
F.
CurrentFunction
= origMethod;
Lowering\IteratorRewriter\IteratorRewriter.cs (1)
279
F.
CurrentFunction
= stateMachineType.Constructor;
Lowering\LocalRewriter\LocalRewriter.cs (5)
70
_factory.
CurrentFunction
= containingMethod;
363
_factory.
CurrentFunction
= lambda;
373
_factory.
CurrentFunction
= oldContainingSymbol;
428
_factory.
CurrentFunction
= localFunction;
447
_factory.
CurrentFunction
= oldContainingSymbol;
Lowering\SpillSequenceSpiller.cs (5)
32
_F.
CurrentFunction
= method;
1397
_F.
CurrentFunction
= node.Symbol;
1399
_F.
CurrentFunction
= oldCurrentFunction;
1406
_F.
CurrentFunction
= node.Symbol;
1408
_F.
CurrentFunction
= oldCurrentFunction;
Lowering\StateMachineRewriter\StateMachineRewriter.cs (4)
289
F.
CurrentFunction
= method;
352
F.
CurrentFunction
= result;
364
F.
CurrentFunction
= getter;
372
F.
CurrentFunction
= result;
Lowering\SyntheticBoundNodeFactory.cs (3)
123
this.
CurrentFunction
= topLevelMethodOpt;
160
CurrentFunction
= null;
578
CurrentFunction
= null;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
226
F.
CurrentFunction
= this;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListConstructor.cs (1)
25
f.
CurrentFunction
= this;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListEnumeratorConstructor.cs (1)
25
f.
CurrentFunction
= this;
Symbols\Synthesized\ReadOnlyListType\SynthesizedReadOnlyListMethod.cs (1)
24
f.
CurrentFunction
= this;
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
178
F.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedHotReloadExceptionConstructorSymbol.cs (1)
41
factory.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInlineArrayAsReadOnlySpanMethod.cs (1)
24
f.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInlineArrayAsSpanMethod.cs (1)
24
f.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInlineArrayElementRefMethod.cs (1)
26
f.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInlineArrayElementRefReadOnlyMethod.cs (1)
26
f.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInlineArrayFirstElementRefMethod.cs (1)
25
f.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInlineArrayFirstElementRefReadOnlyMethod.cs (1)
25
f.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
289
factory.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedParameterlessThrowMethod.cs (1)
27
F.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedThrowSwitchExpressionExceptionMethod.cs (1)
25
F.
CurrentFunction
= this;
73 references to CurrentFunction
Microsoft.CodeAnalysis.CSharp (73)
Compiler\MethodBodySynthesizer.Lowered.cs (3)
459
RoslynDebug.AssertNotNull(F.
CurrentFunction
);
460
foreach (var param in F.
CurrentFunction
.Parameters)
469
return F.
CurrentFunction
.ReturnsVoid
Lowering\AsyncRewriter\AsyncExceptionHandlerRewriter.cs (10)
187
var pendingExceptionLocal = new SynthesizedLocal(_F.
CurrentFunction
, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax);
189
var pendingBranchVar = new SynthesizedLocal(_F.
CurrentFunction
, TypeWithAnnotations.Create(_F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax);
213
if (_F.
CurrentFunction
.IsAsync && _F.
CurrentFunction
.IsIterator)
331
var returnLabel = parent.ProxyReturnIfNeeded(_F.
CurrentFunction
, pendingValue, out returnValue);
378
_F.
CurrentFunction
,
707
var oldContainingSymbol = _F.
CurrentFunction
;
723
var oldContainingSymbol = _F.
CurrentFunction
;
1044
this.pendingCaughtException = new SynthesizedLocal(F.
CurrentFunction
, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Object)), SynthesizedLocalKind.TryAwaitPendingCaughtException, tryStatementSyntax);
1045
this.pendingCatch = new SynthesizedLocal(F.
CurrentFunction
, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingCatch, tryStatementSyntax);
Lowering\AsyncRewriter\AsyncRewriter.AsyncIteratorRewriter.cs (1)
169
bodyBuilder.Add(F.Assignment(F.InstanceField(stateField), F.Parameter(F.
CurrentFunction
.Parameters[0]))); // this.state = state;
Lowering\AsyncRewriter\AsyncRewriter.cs (1)
185
new BoundExpression[] { F.Parameter(F.
CurrentFunction
.Parameters[0]) })),
Lowering\Instrumentation\CodeCoverageInstrumenter.cs (1)
123
var oldMethod = methodBodyFactory.
CurrentFunction
;
Lowering\Instrumentation\LocalStateTracingInstrumenter.cs (7)
299
Debug.Assert(_factory.
CurrentFunction
is not null);
301
var isStateMachine = _factory.
CurrentFunction
.IsAsync || _factory.
CurrentFunction
.IsIterator;
303
var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(_factory.
CurrentFunction
.ParameterCount);
305
foreach (var parameter in _factory.
CurrentFunction
.Parameters)
334
new[] { _factory.MethodDefIndex(_factory.TopLevelMethod), _factory.MethodDefIndex(_factory.
CurrentFunction
) }),
340
new[] { _factory.MethodDefIndex(_factory.TopLevelMethod), _factory.MethodDefIndex(_factory.
CurrentFunction
), _factory.StateMachineInstanceId() }),
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (2)
354
Debug.Assert(node.Label == proxyLabel || !(F.
CurrentFunction
is IteratorFinallyMethodSymbol), "should not be proxying branches in finally");
393
var origMethod = F.
CurrentFunction
;
Lowering\IteratorRewriter\IteratorRewriter.cs (1)
282
bodyBuilder.Add(F.Assignment(F.Field(F.This(), stateField), F.Parameter(F.
CurrentFunction
.Parameters[0]))); // this.state = state;
Lowering\LocalRewriter\DelegateCacheRewriter.cs (2)
65
Debug.Assert(_factory.
CurrentFunction
is { });
93
if (!TryGetOwnerFunction(_factory.
CurrentFunction
, boundDelegateCreation, out var ownerFunction))
Lowering\LocalRewriter\LocalRewriter.cs (3)
354
var oldContainingSymbol = _factory.
CurrentFunction
;
419
var oldContainingSymbol = _factory.
CurrentFunction
;
770
if (_factory.
CurrentFunction
?.IsStatic == false)
Lowering\LocalRewriter\LocalRewriter_AssignmentOperator.cs (1)
286
Debug.Assert(_factory.
CurrentFunction
.IsConstructor());
Lowering\LocalRewriter\LocalRewriter_Call.cs (3)
187
var containingMethod = this._factory.
CurrentFunction
;
291
_factory.
CurrentFunction
,
706
_factory.
CurrentFunction
,
Lowering\LocalRewriter\LocalRewriter_CollectionExpression.cs (1)
1040
if (useKnownLength && elements.Length > 0 && _factory.
CurrentFunction
?.IsAsync == false)
Lowering\LocalRewriter\LocalRewriter_DeconstructionAssignmentOperator.cs (1)
390
var localSymbol = new SynthesizedLocal(_factory.
CurrentFunction
, TypeWithAnnotations.Create(outputPlaceholder.Type), SynthesizedLocalKind.LoweringTemp);
Lowering\LocalRewriter\LocalRewriter_ForEachStatement.cs (3)
337
Debug.Assert(_factory.
CurrentFunction
is { });
338
var conversions = _factory.
CurrentFunction
.ContainingAssembly.CorLibrary.TypeConversions;
347
containingMember: _factory.
CurrentFunction
,
Lowering\LocalRewriter\LocalRewriter_Literal.cs (1)
70
var curMethod = _factory.
CurrentFunction
;
Lowering\LocalRewriter\LocalRewriter_ReturnStatement.cs (2)
29
(node.Syntax.Kind() == SyntaxKind.Block && _factory.
CurrentFunction
?.IsAsync == false))))
41
var method = _factory.
CurrentFunction
;
Lowering\LocalRewriter\LocalRewriter_SwitchExpression.cs (3)
160
var diagnosticSyntax = factory.
CurrentFunction
.GetNonNullSyntaxNode();
175
var diagnosticSyntax = factory.
CurrentFunction
.GetNonNullSyntaxNode();
189
var diagnosticSyntax = factory.
CurrentFunction
.GetNonNullSyntaxNode();
Lowering\LocalRewriter\LocalRewriter_Yield.cs (1)
21
(!node.WasCompilerGenerated || (node.Syntax.Kind() == SyntaxKind.Block && _factory.
CurrentFunction
?.IsAsync == false)))
Lowering\LocalRewriter\LoweredDynamicOperationFactory.cs (3)
552
_factory.
CurrentFunction
,
688
Debug.Assert(factory.
CurrentFunction
is { });
694
var synthesizedContainer = new DynamicSiteContainer(containerName, factory.TopLevelMethod, factory.
CurrentFunction
);
Lowering\SpillSequenceSpiller.cs (2)
1396
var oldCurrentFunction = _F.
CurrentFunction
;
1405
var oldCurrentFunction = _F.
CurrentFunction
;
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
188
get { return F.
CurrentFunction
; }
Lowering\SyntheticBoundNodeFactory.cs (20)
140
Debug.Assert(
CurrentFunction
is null ||
141
CurrentFunction
.MethodKind == MethodKind.AnonymousFunction ||
142
CurrentFunction
.MethodKind == MethodKind.LocalFunction ||
143
TypeSymbol.Equals(
CurrentFunction
.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
216
Debug.Assert(
CurrentFunction
is { IsStatic: false });
217
return new BoundThisReference(Syntax,
CurrentFunction
.ThisParameter.Type) { WasCompilerGenerated = true };
227
Debug.Assert(
CurrentFunction
is { IsStatic: false });
545
Debug.Assert(
CurrentFunction
is { });
556
var conversion = Compilation.Conversions.ClassifyConversionFromType(expression.Type,
CurrentFunction
.ReturnType, isChecked: false, ref useSiteInfo);
561
Debug.Assert(
CurrentFunction
.RefKind == RefKind.None);
562
expression = BoundConversion.Synthesized(Syntax, expression, conversion, false, explicitCastInCode: false, conversionGroupOpt: null, ConstantValue.NotAvailable,
CurrentFunction
.ReturnType);
566
return new BoundReturnStatement(Syntax,
CurrentFunction
.RefKind, expression, @checked: false) { WasCompilerGenerated = true };
571
Debug.Assert(
CurrentFunction
is { });
577
CompilationState.AddSynthesizedMethod(
CurrentFunction
, body);
595
return new SynthesizedLocal(
CurrentFunction
, TypeWithAnnotations.Create(type), kind, syntax, isPinned,
614
CurrentFunction
,
1186
Debug.Assert(
CurrentFunction
is { });
1187
NamedTypeSymbol baseType =
CurrentFunction
.ThisParameter.Type.BaseTypeNoUseSiteDiagnostics;
1644
MethodSymbol? containingMethod = this.
CurrentFunction
;
1721
temp = new SynthesizedLocal(this.
CurrentFunction
, TypeWithAnnotations.Create(node.Type), SynthesizedLocalKind.LoweringTemp);