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