2 instantiations of NestedFunction
Microsoft.CodeAnalysis.CSharp (2)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
557
_currentScope.NestedFunctions.Add(new
NestedFunction
(functionSymbol, blockSyntax: null));
563
var function = new
NestedFunction
(functionSymbol, body.Syntax.GetReference());
34 references to NestedFunction
Microsoft.CodeAnalysis.CSharp (34)
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (17)
131
/// Must be called only after <see cref="
NestedFunction
.CapturedEnvironments"/>
308
var closures = new SetWithInsertionOrder<
NestedFunction
>();
342
foreach (
var
closure in closures)
357
private PooledDictionary<Scope, PooledHashSet<
NestedFunction
>> CalculateFunctionsCapturingScopeVariables()
359
var closuresCapturingScopeVariables = PooledDictionary<Scope, PooledHashSet<
NestedFunction
>>.GetInstance();
369
closuresCapturingScopeVariables[scope] = PooledHashSet<
NestedFunction
>.GetInstance();
373
foreach (
var
closure in scope.NestedFunctions)
493
foreach (
var
closure in closuresCapturingScope)
568
foreach (
var
function in currentScope.NestedFunctions)
627
/// A tuple of the found <see cref="
NestedFunction
"/> and the <see cref="Scope"/> it was found in.
629
public static (
NestedFunction
, Scope) GetVisibleNestedFunction(Scope startingScope, MethodSymbol functionSymbol)
634
foreach (
var
function in currentScope.NestedFunctions)
647
/// Finds a <see cref="
NestedFunction
"/> with a matching original symbol somewhere in the given scope or nested scopes.
649
public static
NestedFunction
GetNestedFunctionInTree(Scope treeRoot, MethodSymbol functionSymbol)
653
NestedFunction
helper(Scope scope)
655
foreach (
var
function in scope.NestedFunctions)
665
var
found = helper(nestedScope);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (14)
39
public readonly ArrayBuilder<
NestedFunction
> NestedFunctions = ArrayBuilder<
NestedFunction
>.GetInstance();
66
public readonly
NestedFunction
ContainingFunctionOpt;
79
public Scope(Scope parent, BoundNode boundNode,
NestedFunction
containingFunction)
102
foreach (
var
function in NestedFunctions)
201
public static void VisitNestedFunctions(Scope scope, Action<Scope,
NestedFunction
> action)
203
foreach (
var
function in scope.NestedFunctions)
218
public static bool CheckNestedFunctions(Scope scope, Func<Scope,
NestedFunction
, bool> func)
220
foreach (
var
function in scope.NestedFunctions)
281
private
NestedFunction
_currentFunction = null;
563
var
function = new NestedFunction(functionSymbol, body.Syntax.GetReference());
566
var
oldFunction = _currentFunction;
621
var
function = _currentFunction;
723
Scope CreateNestedScope(Scope parentScope,
NestedFunction
currentFunction)
Lowering\ClosureConversion\ClosureConversion.cs (3)
471
static ImmutableArray<SynthesizedClosureEnvironment> getStructEnvironments(Analysis.
NestedFunction
function)
863
var
function = Analysis.GetNestedFunctionInTree(_analysis.ScopeTree, localFunc.OriginalDefinition);
1492
Analysis.
NestedFunction
function = Analysis.GetNestedFunctionInTree(_analysis.ScopeTree, node.Symbol);