1 instantiation of ControlFlowRegion
Microsoft.CodeAnalysis (1)
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (1)
337
var result = new
ControlFlowRegion
(Kind, FirstBlock.Ordinal, LastBlock.Ordinal, subRegions,
161 references to ControlFlowRegion
Microsoft.CodeAnalysis (73)
Operations\BasicBlock.cs (2)
35
ControlFlowRegion
region)
132
public
ControlFlowRegion
EnclosingRegion { get; }
Operations\ControlFlowBranch.cs (18)
18
private ImmutableArray<
ControlFlowRegion
> _lazyLeavingRegions;
19
private ImmutableArray<
ControlFlowRegion
> _lazyFinallyRegions;
20
private ImmutableArray<
ControlFlowRegion
> _lazyEnteringRegions;
58
public ImmutableArray<
ControlFlowRegion
> LeavingRegions
64
ImmutableArray<
ControlFlowRegion
> result;
68
result = ImmutableArray<
ControlFlowRegion
>.Empty;
82
private static ArrayBuilder<
ControlFlowRegion
> CollectRegions(int destinationOrdinal,
ControlFlowRegion
source)
84
var builder = ArrayBuilder<
ControlFlowRegion
>.GetInstance();
101
public ImmutableArray<
ControlFlowRegion
> EnteringRegions
107
ImmutableArray<
ControlFlowRegion
> result;
111
result = ImmutableArray<
ControlFlowRegion
>.Empty;
115
ArrayBuilder<
ControlFlowRegion
> builder = CollectRegions(Source.Ordinal, Destination.EnclosingRegion);
131
public ImmutableArray<
ControlFlowRegion
> FinallyRegions
137
ArrayBuilder<
ControlFlowRegion
>? builder = null;
138
ImmutableArray<
ControlFlowRegion
> leavingRegions = LeavingRegions;
146
builder = ArrayBuilder<
ControlFlowRegion
>.GetInstance();
154
var result = builder == null ? ImmutableArray<
ControlFlowRegion
>.Empty : builder.ToImmutableAndFree();
Operations\ControlFlowGraph.cs (8)
27
private readonly ImmutableDictionary<IMethodSymbol, (
ControlFlowRegion
region, ILocalFunctionOperation operation, int ordinal)> _localFunctionsMap;
29
private readonly ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)> _anonymousFunctionsMap;
35
ImmutableArray<BasicBlock> blocks,
ControlFlowRegion
root,
37
ImmutableDictionary<IMethodSymbol, (
ControlFlowRegion
region, ILocalFunctionOperation operation, int ordinal)> localFunctionsMap,
38
ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)> anonymousFunctionsMap)
217
public
ControlFlowRegion
Root { get; }
246
if (!_localFunctionsMap.TryGetValue(localFunction, out (
ControlFlowRegion
enclosing, ILocalFunctionOperation operation, int ordinal) info))
295
if (!_anonymousFunctionsMap.TryGetValue(anonymousFunction, out (
ControlFlowRegion
enclosing, int ordinal) info))
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (1)
33
public
ControlFlowRegion
? Region;
Operations\ControlFlowGraphBuilder.cs (18)
87
public static ControlFlowGraph Create(IOperation body, ControlFlowGraph? parent = null,
ControlFlowRegion
? enclosing = null, CaptureIdDispenser? captureIdDispenser = null, in Context context = default)
150
var localFunctionsMap = ImmutableDictionary.CreateBuilder<IMethodSymbol, (
ControlFlowRegion
, ILocalFunctionOperation, int)>();
151
ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
, int)>.Builder? anonymousFunctionsMapOpt = null;
155
anonymousFunctionsMapOpt = ImmutableDictionary.CreateBuilder<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
, int)>();
158
ControlFlowRegion
region = root.ToImmutableRegionAndFree(blocks, localFunctions, localFunctionsMap, anonymousFunctionsMapOpt, enclosing);
169
anonymousFunctionsMapOpt?.ToImmutable() ?? ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
, int)>.Empty);
228
var continueDispatchAfterFinally = PooledDictionary<
ControlFlowRegion
, bool>.GetInstance();
229
var dispatchedExceptionsFromRegions = PooledHashSet<
ControlFlowRegion
>.GetInstance();
244
PooledDictionary<
ControlFlowRegion
, bool> continueDispatchAfterFinally,
245
PooledHashSet<
ControlFlowRegion
> dispatchedExceptionsFromRegions,
344
bool stepThroughFinally(
ControlFlowRegion
region, BasicBlockBuilder destination)
351
ControlFlowRegion
enclosing = region.EnclosingRegion;
370
bool stepThroughSingleFinally(
ControlFlowRegion
@finally)
398
void dispatchException([DisallowNull]
ControlFlowRegion
? fromRegion)
407
ControlFlowRegion
? enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
436
ControlFlowRegion
tryAndCatch = enclosing.EnclosingRegion;
456
void dispatchExceptionThroughCatches(
ControlFlowRegion
tryAndCatch, int startAt)
467
ControlFlowRegion
@catch = tryAndCatch.NestedRegions[i];
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (19)
296
public
ControlFlowRegion
ToImmutableRegionAndFree(ArrayBuilder<BasicBlockBuilder> blocks,
298
ImmutableDictionary<IMethodSymbol, (
ControlFlowRegion
region, ILocalFunctionOperation operation, int ordinal)>.Builder localFunctionsMap,
299
ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)>.Builder? anonymousFunctionsMapOpt,
300
ControlFlowRegion
? enclosing)
317
ImmutableArray<
ControlFlowRegion
> subRegions;
321
var builder = ArrayBuilder<
ControlFlowRegion
>.GetInstance(Regions.Count);
332
subRegions = ImmutableArray<
ControlFlowRegion
>.Empty;
337
var
result = new ControlFlowRegion(Kind, FirstBlock.Ordinal, LastBlock.Ordinal, subRegions,
354
foreach (
ControlFlowRegion
region in subRegions)
383
(ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)>.Builder map,
ControlFlowRegion
region) argument = (anonymousFunctionsMapOpt, result);
399
OperationVisitor<(ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)>.Builder map,
ControlFlowRegion
region), IOperation>
405
(ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)>.Builder map,
ControlFlowRegion
region) argument)
411
internal override IOperation? VisitNoneOperation(IOperation operation, (ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)>.Builder map,
ControlFlowRegion
region) argument)
418
(ImmutableDictionary<IFlowAnonymousFunctionOperation, (
ControlFlowRegion
region, int ordinal)>.Builder map,
ControlFlowRegion
region) argument)
Operations\ControlFlowRegion.cs (7)
25
public
ControlFlowRegion
? EnclosingRegion { get; private set; }
46
public ImmutableArray<
ControlFlowRegion
> NestedRegions { get; }
64
ImmutableArray<
ControlFlowRegion
> nestedRegions,
69
ControlFlowRegion
? enclosingRegion)
84
foreach (
ControlFlowRegion
r in NestedRegions)
112
ControlFlowRegion
r = NestedRegions[i];
132
foreach (
ControlFlowRegion
r in NestedRegions)
Microsoft.CodeAnalysis.CodeStyle (18)
ControlFlowRegionExtensions.cs (1)
9
internal static bool ContainsBlock(this
ControlFlowRegion
region, int destinationOrdinal)
CustomDataFlowAnalysis.cs (12)
34
var continueDispatchAfterFinally = PooledDictionary<
ControlFlowRegion
, bool>.GetInstance();
35
var dispatchedExceptionsFromRegions = PooledHashSet<
ControlFlowRegion
>.GetInstance();
75
PooledDictionary<
ControlFlowRegion
, bool> continueDispatchAfterFinally,
76
PooledHashSet<
ControlFlowRegion
> dispatchedExceptionsFromRegions,
254
bool StepThroughFinally(
ControlFlowRegion
region, int destinationOrdinal, ref TBlockAnalysisData currentAnalysisData)
259
var
enclosing = region.EnclosingRegion;
278
bool StepThroughSingleFinally(
ControlFlowRegion
@finally, ref TBlockAnalysisData currentAnalysisData)
310
void DispatchException(
ControlFlowRegion
fromRegion)
319
var
enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
349
var
tryAndCatch = enclosing.EnclosingRegion;
369
void DispatchExceptionThroughCatches(
ControlFlowRegion
tryAndCatch, int startAt)
380
var
@catch = tryAndCatch.NestedRegions[i];
OperationExtensions.cs (1)
304
var
currentRegion = block.EnclosingRegion;
SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
177
foreach (
var
region in branch.LeavingRegions)
SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (3)
361
var
outermostEnclosingRegionStartingBlock = basicBlock.EnclosingRegion;
381
ControlFlowRegion
containingTryCatchFinallyRegion = null;
382
var
currentRegion = outermostEnclosingRegionStartingBlock;
Microsoft.CodeAnalysis.Test.Utilities (52)
Compilation\ControlFlowGraphVerifier.cs (39)
109
ControlFlowRegion
enclosing, string idSuffix, int indent, ISymbol associatedSymbol)
114
ControlFlowRegion
currentRegion = graph.Root;
116
PooledDictionary<
ControlFlowRegion
, int> regionMap = buildRegionMap();
385
var regions = ArrayBuilder<
ControlFlowRegion
>.GetInstance();
397
foreach (
ControlFlowRegion
region in predecessor.EnteringRegions)
457
void verifyLeftRegions(BasicBlock block, PooledHashSet<CaptureId> longLivedIds, PooledHashSet<CaptureId> referencedIds, ArrayBuilder<
ControlFlowRegion
> regions, Func<string> finalGraph)
462
ControlFlowRegion
region = block.EnclosingRegion;
501
foreach (
ControlFlowRegion
region in regions)
535
bool isCSharpEmptyObjectInitializerCapture(
ControlFlowRegion
region, BasicBlock block, CaptureId id)
572
bool isWithStatementTargetCapture(
ControlFlowRegion
region, BasicBlock block, CaptureId id)
599
bool isConditionalXMLAccessReceiverCapture(
ControlFlowRegion
region, BasicBlock block, CaptureId id)
638
bool isSwitchTargetCapture(
ControlFlowRegion
region, BasicBlock block, CaptureId id)
681
bool isForEachEnumeratorCapture(
ControlFlowRegion
region, BasicBlock block, CaptureId id)
719
bool isAggregateGroupCapture(IOperation operation,
ControlFlowRegion
region, BasicBlock block, CaptureId id)
759
foreach (
ControlFlowRegion
region in branch.LeavingRegions)
770
ControlFlowRegion
region = branch.Source.EnclosingRegion;
784
foreach (
ControlFlowRegion
@finally in branch.FinallyRegions)
1049
bool isLongLivedCaptureReference(IFlowCaptureReferenceOperation reference,
ControlFlowRegion
region)
1061
ControlFlowRegion
region = graph.Root.EnclosingRegion;
1076
bool isConditionalAccessCaptureUsedAfterNullCheck(IOperation operation,
ControlFlowRegion
region, BasicBlock block, CaptureId id)
1328
IEnumerable<IFlowCaptureOperation> getFlowCaptureOperationsFromBlocksInRegion(
ControlFlowRegion
region, int lastBlockOrdinal)
1343
IEnumerable<IFlowCaptureReferenceOperation> getFlowCaptureReferenceOperationsInRegion(
ControlFlowRegion
region, int firstBlockOrdinal)
1372
PooledObjects.PooledDictionary<
ControlFlowRegion
, int> buildRegionMap()
1374
var result = PooledObjects.PooledDictionary<
ControlFlowRegion
, int>.GetInstance();
1378
void visit(
ControlFlowRegion
region)
1382
foreach (
ControlFlowRegion
r in region.NestedRegions)
1402
void printLocals(
ControlFlowRegion
region)
1438
void enterRegions(
ControlFlowRegion
region, int firstBlockOrdinal)
1531
void leaveRegions(
ControlFlowRegion
region, int lastBlockOrdinal)
1615
ControlFlowRegion
remainedIn1 = fromBlock.EnclosingRegion;
1619
foreach (
ControlFlowRegion
r in branch.LeavingRegions)
1626
ControlFlowRegion
remainedIn2 = branch.Destination.EnclosingRegion;
1632
ControlFlowRegion
r = branch.EnteringRegions[j];
1640
string buildList(ImmutableArray<
ControlFlowRegion
> list)
1644
foreach (
ControlFlowRegion
r in list)
1686
ControlFlowRegion
region = block.EnclosingRegion;
1799
string getRegionId(
ControlFlowRegion
region)
1823
private readonly
ControlFlowRegion
_region;
1828
public OperationTreeSerializer(ControlFlowGraph graph,
ControlFlowRegion
region, string idSuffix,
ControlFlowRegionExtensions.cs (1)
9
internal static bool ContainsBlock(this
ControlFlowRegion
region, int destinationOrdinal)
CustomDataFlowAnalysis.cs (12)
34
var continueDispatchAfterFinally = PooledDictionary<
ControlFlowRegion
, bool>.GetInstance();
35
var dispatchedExceptionsFromRegions = PooledHashSet<
ControlFlowRegion
>.GetInstance();
75
PooledDictionary<
ControlFlowRegion
, bool> continueDispatchAfterFinally,
76
PooledHashSet<
ControlFlowRegion
> dispatchedExceptionsFromRegions,
254
bool StepThroughFinally(
ControlFlowRegion
region, int destinationOrdinal, ref TBlockAnalysisData currentAnalysisData)
259
var
enclosing = region.EnclosingRegion;
278
bool StepThroughSingleFinally(
ControlFlowRegion
@finally, ref TBlockAnalysisData currentAnalysisData)
310
void DispatchException(
ControlFlowRegion
fromRegion)
319
var
enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
349
var
tryAndCatch = enclosing.EnclosingRegion;
369
void DispatchExceptionThroughCatches(
ControlFlowRegion
tryAndCatch, int startAt)
380
var
@catch = tryAndCatch.NestedRegions[i];
Microsoft.CodeAnalysis.Workspaces (18)
ControlFlowRegionExtensions.cs (1)
9
internal static bool ContainsBlock(this
ControlFlowRegion
region, int destinationOrdinal)
CustomDataFlowAnalysis.cs (12)
34
var continueDispatchAfterFinally = PooledDictionary<
ControlFlowRegion
, bool>.GetInstance();
35
var dispatchedExceptionsFromRegions = PooledHashSet<
ControlFlowRegion
>.GetInstance();
75
PooledDictionary<
ControlFlowRegion
, bool> continueDispatchAfterFinally,
76
PooledHashSet<
ControlFlowRegion
> dispatchedExceptionsFromRegions,
254
bool StepThroughFinally(
ControlFlowRegion
region, int destinationOrdinal, ref TBlockAnalysisData currentAnalysisData)
259
var
enclosing = region.EnclosingRegion;
278
bool StepThroughSingleFinally(
ControlFlowRegion
@finally, ref TBlockAnalysisData currentAnalysisData)
310
void DispatchException(
ControlFlowRegion
fromRegion)
319
var
enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
349
var
tryAndCatch = enclosing.EnclosingRegion;
369
void DispatchExceptionThroughCatches(
ControlFlowRegion
tryAndCatch, int startAt)
380
var
@catch = tryAndCatch.NestedRegions[i];
OperationExtensions.cs (1)
304
var
currentRegion = block.EnclosingRegion;
SymbolUsageAnalysis.DataFlowAnalyzer.cs (1)
177
foreach (
var
region in branch.LeavingRegions)
SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (3)
361
var
outermostEnclosingRegionStartingBlock = basicBlock.EnclosingRegion;
381
ControlFlowRegion
containingTryCatchFinallyRegion = null;
382
var
currentRegion = outermostEnclosingRegionStartingBlock;