2 instantiations of NestedFunction
Microsoft.CodeAnalysis.CSharp (2)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
576_currentScope.NestedFunctions.Add(new NestedFunction(functionSymbol, blockSyntax: null)); 582var function = new NestedFunction(functionSymbol, body.Syntax.GetReference());
25 references to NestedFunction
Microsoft.CodeAnalysis.CSharp (25)
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (11)
134/// Must be called only after <see cref="NestedFunction.CapturedEnvironments"/> 312var closures = new SetWithInsertionOrder<NestedFunction>(); 361private PooledDictionary<Scope, PooledHashSet<NestedFunction>> CalculateFunctionsCapturingScopeVariables() 363var closuresCapturingScopeVariables = PooledDictionary<Scope, PooledHashSet<NestedFunction>>.GetInstance(); 373closuresCapturingScopeVariables[scope] = PooledHashSet<NestedFunction>.GetInstance(); 646/// A tuple of the found <see cref="NestedFunction"/> and the <see cref="Scope"/> it was found in. 648public static (NestedFunction, Scope) GetVisibleNestedFunction(Scope startingScope, MethodSymbol functionSymbol) 666/// Finds a <see cref="NestedFunction"/> with a matching original symbol somewhere in the given scope or nested scopes. 668public static NestedFunction GetNestedFunctionInTree(Scope treeRoot, MethodSymbol functionSymbol) 672NestedFunction helper(Scope scope) 684var found = helper(nestedScope);
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (11)
40public readonly ArrayBuilder<NestedFunction> NestedFunctions = ArrayBuilder<NestedFunction>.GetInstance(); 67public readonly NestedFunction ContainingFunctionOpt; 80public Scope(Scope parent, BoundNode boundNode, NestedFunction containingFunction) 219public static void VisitNestedFunctions(Scope scope, Action<Scope, NestedFunction> action) 236public static bool CheckNestedFunctions(Scope scope, Func<Scope, NestedFunction, bool> func) 299private NestedFunction _currentFunction = null; 582var function = new NestedFunction(functionSymbol, body.Syntax.GetReference()); 585var oldFunction = _currentFunction; 640var function = _currentFunction; 743Scope CreateNestedScope(Scope parentScope, NestedFunction currentFunction)
Lowering\ClosureConversion\ClosureConversion.cs (3)
479static ImmutableArray<SynthesizedClosureEnvironment> getStructEnvironments(Analysis.NestedFunction function) 878var function = Analysis.GetNestedFunctionInTree(_analysis.ScopeTree, localFunc.OriginalDefinition); 1520Analysis.NestedFunction function = Analysis.GetNestedFunctionInTree(_analysis.ScopeTree, node.Symbol);