45 writes to CurrentFunction
Microsoft.CodeAnalysis.CSharp (45)
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)
37
_F.
CurrentFunction
= containingMethod;
677
_F.
CurrentFunction
= node.Symbol;
682
_F.
CurrentFunction
= oldContainingSymbol;
693
_F.
CurrentFunction
= node.Symbol;
698
_F.
CurrentFunction
= oldContainingSymbol;
Lowering\AsyncRewriter\AsyncMethodToStateMachineRewriter.cs (1)
136
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)
96
F.
CurrentFunction
= moveNextMethod;
164
F.
CurrentFunction
= disposeMethod;
397
F.
CurrentFunction
= finallyMethod;
419
F.
CurrentFunction
= origMethod;
Lowering\IteratorRewriter\IteratorRewriter.cs (1)
279
F.
CurrentFunction
= stateMachineType.Constructor;
Lowering\LocalRewriter\LocalRewriter.cs (5)
63
_factory.
CurrentFunction
= containingMethod;
302
_factory.
CurrentFunction
= lambda;
312
_factory.
CurrentFunction
= oldContainingSymbol;
364
_factory.
CurrentFunction
= localFunction;
383
_factory.
CurrentFunction
= oldContainingSymbol;
Lowering\SpillSequenceSpiller.cs (5)
33
_F.
CurrentFunction
= method;
1305
_F.
CurrentFunction
= node.Symbol;
1307
_F.
CurrentFunction
= oldCurrentFunction;
1314
_F.
CurrentFunction
= node.Symbol;
1316
_F.
CurrentFunction
= oldCurrentFunction;
Lowering\StateMachineRewriter\StateMachineRewriter.cs (4)
284
F.
CurrentFunction
= method;
338
F.
CurrentFunction
= result;
350
F.
CurrentFunction
= getter;
358
F.
CurrentFunction
= result;
Lowering\SyntheticBoundNodeFactory.cs (3)
170
this.
CurrentFunction
= topLevelMethodOpt;
207
CurrentFunction
= null;
546
CurrentFunction
= null;
Symbols\AnonymousTypes\SynthesizedSymbols\AnonymousType.SynthesizedMethodBase.cs (1)
226
F.
CurrentFunction
= this;
Symbols\Synthesized\Records\SynthesizedRecordEqualityContractProperty.cs (1)
172
F.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedInstanceConstructor.cs (1)
289
factory.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedParameterlessThrowMethod.cs (1)
27
F.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedThrowIfNullMethod.cs (1)
29
F.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedThrowMethod.cs (1)
24
F.
CurrentFunction
= this;
Symbols\Synthesized\SynthesizedThrowSwitchExpressionExceptionMethod.cs (1)
25
F.
CurrentFunction
= this;
69 references to CurrentFunction
Microsoft.CodeAnalysis.CSharp (69)
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)
175
var pendingExceptionLocal = new SynthesizedLocal(_F.
CurrentFunction
, TypeWithAnnotations.Create(exceptionType), SynthesizedLocalKind.TryAwaitPendingException, tryStatementSyntax);
177
var pendingBranchVar = new SynthesizedLocal(_F.
CurrentFunction
, TypeWithAnnotations.Create(_F.SpecialType(SpecialType.System_Int32)), SynthesizedLocalKind.TryAwaitPendingBranch, tryStatementSyntax);
201
if (_F.
CurrentFunction
.IsAsync && _F.
CurrentFunction
.IsIterator)
318
var returnLabel = parent.ProxyReturnIfNeeded(_F.
CurrentFunction
, pendingValue, out returnValue);
365
_F.
CurrentFunction
,
674
var oldContainingSymbol = _F.
CurrentFunction
;
690
var oldContainingSymbol = _F.
CurrentFunction
;
1009
this.pendingCaughtException = new SynthesizedLocal(F.
CurrentFunction
, TypeWithAnnotations.Create(F.SpecialType(SpecialType.System_Object)), SynthesizedLocalKind.TryAwaitPendingCaughtException, tryStatementSyntax);
1010
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)
294
Debug.Assert(_factory.
CurrentFunction
is not null);
296
var isStateMachine = _factory.
CurrentFunction
.IsAsync || _factory.
CurrentFunction
.IsIterator;
298
var prologueBuilder = ArrayBuilder<BoundStatement>.GetInstance(_factory.
CurrentFunction
.ParameterCount);
300
foreach (var parameter in _factory.
CurrentFunction
.Parameters)
329
new[] { _factory.MethodDefIndex(_factory.TopLevelMethod), _factory.MethodDefIndex(_factory.
CurrentFunction
) }),
335
new[] { _factory.MethodDefIndex(_factory.TopLevelMethod), _factory.MethodDefIndex(_factory.
CurrentFunction
), _factory.StateMachineInstanceId() }),
Lowering\IteratorRewriter\IteratorMethodToStateMachineRewriter.cs (2)
355
Debug.Assert(node.Label == proxyLabel || !(F.
CurrentFunction
is IteratorFinallyMethodSymbol), "should not be proxying branches in finally");
394
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)
295
var oldContainingSymbol = _factory.
CurrentFunction
;
357
var oldContainingSymbol = _factory.
CurrentFunction
;
647
if (_factory.
CurrentFunction
?.IsStatic == false)
Lowering\LocalRewriter\LocalRewriter_Call.cs (1)
467
_factory.
CurrentFunction
,
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)
272
Debug.Assert(_factory.
CurrentFunction
is { });
273
var conversions = new TypeConversions(_factory.
CurrentFunction
.ContainingAssembly.CorLibrary);
282
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 (2)
703
Debug.Assert(factory.
CurrentFunction
is { });
709
var synthesizedContainer = new DynamicSiteContainer(containerName, factory.TopLevelMethod, factory.
CurrentFunction
);
Lowering\SpillSequenceSpiller.cs (2)
1304
var oldCurrentFunction = _F.
CurrentFunction
;
1313
var oldCurrentFunction = _F.
CurrentFunction
;
Lowering\StateMachineRewriter\MethodToStateMachineRewriter.cs (1)
183
get { return F.
CurrentFunction
; }
Lowering\SyntheticBoundNodeFactory.cs (21)
134
internal override Symbol? ContainingMemberOrLambda { get { return _factory.
CurrentFunction
; } }
187
Debug.Assert(
CurrentFunction
is null ||
188
CurrentFunction
.MethodKind == MethodKind.AnonymousFunction ||
189
CurrentFunction
.MethodKind == MethodKind.LocalFunction ||
190
TypeSymbol.Equals(
CurrentFunction
.ContainingType, CurrentType, TypeCompareKind.ConsiderEverything2));
263
Debug.Assert(
CurrentFunction
is { IsStatic: false });
264
return new BoundThisReference(Syntax,
CurrentFunction
.ThisParameter.Type) { WasCompilerGenerated = true };
274
Debug.Assert(
CurrentFunction
is { IsStatic: false });
513
Debug.Assert(
CurrentFunction
is { });
524
var conversion = Compilation.Conversions.ClassifyConversionFromType(expression.Type,
CurrentFunction
.ReturnType, isChecked: false, ref useSiteInfo);
529
Debug.Assert(
CurrentFunction
.RefKind == RefKind.None);
530
expression = BoundConversion.Synthesized(Syntax, expression, conversion, false, explicitCastInCode: false, conversionGroupOpt: null, ConstantValue.NotAvailable,
CurrentFunction
.ReturnType);
534
return new BoundReturnStatement(Syntax,
CurrentFunction
.RefKind, expression, @checked: false) { WasCompilerGenerated = true };
539
Debug.Assert(
CurrentFunction
is { });
545
CompilationState.AddSynthesizedMethod(
CurrentFunction
, body);
563
return new SynthesizedLocal(
CurrentFunction
, TypeWithAnnotations.Create(type), kind, syntax, isPinned,
582
CurrentFunction
,
1123
Debug.Assert(
CurrentFunction
is { });
1124
NamedTypeSymbol baseType =
CurrentFunction
.ThisParameter.Type.BaseTypeNoUseSiteDiagnostics;
1520
MethodSymbol? containingMethod = this.
CurrentFunction
;
1597
temp = new SynthesizedLocal(this.
CurrentFunction
, TypeWithAnnotations.Create(node.Type), SynthesizedLocalKind.LoweringTemp);