2 instantiations of Scope
Microsoft.CodeAnalysis.CSharp (2)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (2)
377
var rootScope = new
Scope
(parent: null, boundNode: node, containingFunction: null);
747
var newScope = new
Scope
(parentScope, node, currentFunction);
67 references to Scope
Microsoft.CodeAnalysis.CSharp (67)
Lowering\ClosureConversion\ClosureConversion.Analysis.cs (27)
45
public readonly
Scope
ScopeTree;
53
Scope
scopeTree,
78
var
scopeTree = ScopeTreeBuilder.Build(
153
var
curScope = scope;
361
private PooledDictionary<
Scope
, PooledHashSet<NestedFunction>> CalculateFunctionsCapturingScopeVariables()
363
var closuresCapturingScopeVariables = PooledDictionary<
Scope
, PooledHashSet<NestedFunction>>.GetInstance();
367
var environmentsToScopes = PooledDictionary<ClosureEnvironment,
Scope
>.GetInstance();
566
public static
Scope
GetVariableDeclarationScope(
Scope
startingScope, Symbol variable)
573
var
currentScope = startingScope;
605
/// Find the parent <see cref="
Scope
"/> of the <see cref="
Scope
"/> corresponding to
608
public static
Scope
GetScopeParent(
Scope
treeRoot, BoundNode scopeNode)
610
var
correspondingScope = GetScopeWithMatchingBoundNode(treeRoot, scopeNode);
615
/// Finds a <see cref="
Scope
" /> with a matching <see cref="BoundNode"/>
618
public static
Scope
GetScopeWithMatchingBoundNode(
Scope
treeRoot, BoundNode node)
622
Scope
Helper(
Scope
currentScope)
631
var
found = Helper(nestedScope);
646
/// A tuple of the found <see cref="NestedFunction"/> and the <see cref="
Scope
"/> it was found in.
648
public static (NestedFunction,
Scope
) GetVisibleNestedFunction(
Scope
startingScope, MethodSymbol functionSymbol)
650
var
currentScope = startingScope;
668
public static NestedFunction GetNestedFunctionInTree(
Scope
treeRoot, MethodSymbol functionSymbol)
672
NestedFunction helper(
Scope
scope)
Lowering\ClosureConversion\ClosureConversion.Analysis.Tree.cs (39)
33
public readonly
Scope
Parent;
35
public readonly ArrayBuilder<
Scope
> NestedScopes = ArrayBuilder<
Scope
>.GetInstance();
80
public Scope(
Scope
parent, BoundNode boundNode, NestedFunction containingFunction)
116
/// <see cref="
Scope
"/> tree the only information available is
219
public static void VisitNestedFunctions(
Scope
scope, Action<
Scope
, NestedFunction> action)
236
public static bool CheckNestedFunctions(
Scope
scope, Func<
Scope
, NestedFunction, bool> func)
260
public static void VisitScopeTree(
Scope
treeRoot, Action<
Scope
> action)
271
/// Builds a tree of <see cref="
Scope
"/> nodes corresponding to a given method.
275
/// <see cref="
Scope
"/> tree.
277
/// At the same time it sets <see cref="
Scope
.CanMergeWithParent"/>
280
/// after the beginning of a <see cref="
Scope
"/>, to a <see cref="BoundLabelStatement"/>
281
/// before the start of the scope, but after the start of <see cref="
Scope
.Parent"/>.
294
private
Scope
_currentScope;
307
private readonly SmallDictionary<Symbol,
Scope
> _localToScope = new SmallDictionary<Symbol,
Scope
>();
338
private readonly PooledDictionary<LabelSymbol, ArrayBuilder<
Scope
>> _scopesAfterLabel = PooledDictionary<LabelSymbol, ArrayBuilder<
Scope
>>.GetInstance();
350
Scope
rootScope,
367
public static
Scope
Build(
377
var
rootScope = new Scope(parent: null, boundNode: node, containingFunction: null);
418
var
oldScope = _currentScope;
427
var
oldScope = _currentScope;
436
var
oldScope = _currentScope;
525
_scopesAfterLabel.Add(node.Label, ArrayBuilder<
Scope
>.GetInstance());
544
/// This is where we calculate <see cref="
Scope
.CanMergeWithParent"/>.
545
/// <see cref="
Scope
.CanMergeWithParent"/> is always true unless we jump from after
588
var
oldScope = _currentScope;
639
var
scope = _currentScope;
732
var
scope = CreateNestedScope(_currentScope, _currentFunction);
743
Scope
CreateNestedScope(
Scope
parentScope, NestedFunction currentFunction)
747
var
newScope = new Scope(parentScope, node, currentFunction);
755
/// or is the <see cref="
Scope
.Parent"/> of <see cref="_currentScope"/>.
760
private void PopScope(
Scope
scope)
786
private void DeclareLocals<TSymbol>(
Scope
scope, ImmutableArray<TSymbol> locals, bool declareAsFree = false)
Lowering\ClosureConversion\ClosureConversion.cs (1)
363
SynthesizedClosureEnvironment MakeFrame(Analysis.
Scope
scope, Analysis.ClosureEnvironment env)