41 instantiations of RegionBuilder
Microsoft.CodeAnalysis (41)
Operations\ControlFlowGraphBuilder.cs (41)
116
var root = new
RegionBuilder
(ControlFlowRegionKind.Root);
122
builder.EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime));
1386
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals));
1484
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals));
1524
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.ErroneousBody));
1645
var resultCaptureRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, isStackSpillRegion: true);
1841
frameOpt.RegionBuilderOpt = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, isStackSpillRegion: true);
3576
var locals = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals);
3666
tryAndFinallyRegion = new
RegionBuilder
(ControlFlowRegionKind.TryAndFinally);
3668
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.Try));
3674
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.TryAndCatch));
3675
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.Try));
3697
filterAndHandlerRegion = new
RegionBuilder
(ControlFlowRegionKind.FilterAndHandler, catchClause.ExceptionType, catchClause.Locals);
3700
var filterRegion = new
RegionBuilder
(ControlFlowRegionKind.Filter, catchClause.ExceptionType);
3716
var handlerRegion = new
RegionBuilder
(ControlFlowRegionKind.Catch, catchClause.ExceptionType,
3764
var finallyRegion = new
RegionBuilder
(ControlFlowRegionKind.Finally);
3958
var usingRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: locals);
4077
resourceRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime);
4087
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.TryAndFinally));
4088
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.Try));
4120
var finallyRegion = new
RegionBuilder
(ControlFlowRegionKind.Finally);
4308
var lockRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime,
4359
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.TryAndFinally));
4360
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.Try));
4402
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.Finally));
4457
var enumeratorCaptureRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime);
4482
regionForCollection = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: ImmutableArray.Create(local));
4499
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.TryAndFinally));
4500
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.Try));
4513
var localsRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals);
4748
var loopRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: locals);
5470
var switchRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: locals);
5735
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals));
5751
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: operation.ConditionLocals));
5779
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals));
5837
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.StaticLocalInitializer));
6795
var constructorRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime);
6855
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime));
7276
EnterRegion(new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: initializer.Locals));
7750
var armScopeRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime, locals: arm.Locals);
7951
var innerCaptureRegion = new
RegionBuilder
(ControlFlowRegionKind.LocalLifetime);
96 references to RegionBuilder
Microsoft.CodeAnalysis (96)
Operations\ControlFlowGraphBuilder.cs (86)
34
private readonly PooledDictionary<BasicBlockBuilder,
RegionBuilder
> _regionMap;
36
private
RegionBuilder
? _currentRegion;
69
_regionMap = PooledDictionary<BasicBlockBuilder,
RegionBuilder
>.GetInstance();
73
private
RegionBuilder
CurrentRegionRequired
116
var
root = new RegionBuilder(ControlFlowRegionKind.Root);
494
private static void Pack(ArrayBuilder<BasicBlockBuilder> blocks,
RegionBuilder
root, PooledDictionary<BasicBlockBuilder,
RegionBuilder
> regionMap)
511
private static bool PackRegions(
RegionBuilder
root, ArrayBuilder<BasicBlockBuilder> blocks, PooledDictionary<BasicBlockBuilder,
RegionBuilder
> regionMap)
515
bool PackRegion(
RegionBuilder
region)
524
RegionBuilder
r = region.Regions[i];
552
RegionBuilder
subRegion = region.Regions[0];
571
RegionBuilder
subRegion = region.Regions[i];
614
private static void MergeSubRegionAndFree(
RegionBuilder
subRegion, ArrayBuilder<BasicBlockBuilder> blocks, PooledDictionary<BasicBlockBuilder,
RegionBuilder
> regionMap, bool canHaveEmptyRegion = false)
618
RegionBuilder
enclosing = subRegion.Enclosing;
638
foreach (
RegionBuilder
r in subRegion.Regions)
670
private static bool PackBlocks(ArrayBuilder<BasicBlockBuilder> blocks, PooledDictionary<BasicBlockBuilder,
RegionBuilder
> regionMap)
672
ArrayBuilder<
RegionBuilder
>? fromCurrent = null;
673
ArrayBuilder<
RegionBuilder
>? fromDestination = null;
674
ArrayBuilder<
RegionBuilder
>? fromPredecessor = null;
729
RegionBuilder
currentRegion = regionMap[block];
743
RegionBuilder
currentRegion = regionMap[block];
758
RegionBuilder
tryAndFinally = currentRegion.Enclosing;
762
RegionBuilder
@try = tryAndFinally.Regions.First();
782
RegionBuilder
tryAndFinallyEnclosing = tryAndFinally.Enclosing;
838
RegionBuilder
? implicitEntryRegion = tryGetImplicitEntryRegion(block, currentRegion);
887
RegionBuilder
? destinationRegionOpt = next.Destination == null ? null : regionMap[next.Destination];
963
RegionBuilder
currentRegion = regionMap[block];
1014
RegionBuilder
? tryGetImplicitEntryRegion(BasicBlockBuilder block, [DisallowNull]
RegionBuilder
? currentRegion)
1038
void removeBlock(BasicBlockBuilder block,
RegionBuilder
region)
1051
RegionBuilder
enclosing = region.Enclosing;
1064
RegionBuilder
enclosing = region.Enclosing;
1101
bool checkBranchesFromPredecessors(ArrayBuilder<BasicBlockBuilder> predecessors,
RegionBuilder
currentRegion,
RegionBuilder
? destinationRegionOpt)
1105
RegionBuilder
predecessorRegion = regionMap[predecessor];
1148
void collectAncestorsAndSelf([DisallowNull]
RegionBuilder
? from, [NotNull] ref ArrayBuilder<
RegionBuilder
>? builder)
1152
builder = ArrayBuilder<
RegionBuilder
>.GetInstance();
1170
int getIndexOfLastLeftRegion(ArrayBuilder<
RegionBuilder
> from, ArrayBuilder<
RegionBuilder
> to)
1322
private void EnterRegion(
RegionBuilder
region, bool spillingStack = false)
1348
RegionBuilder
enclosed = _currentRegion;
1645
var
resultCaptureRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, isStackSpillRegion: true);
1697
/// and corresponding <see cref="
RegionBuilder
"/> if one was allocated to
1705
private
RegionBuilder
? _lazyRegionBuilder;
1707
public
RegionBuilder
? RegionBuilderOpt
1749
RegionBuilder
toMerge = _currentRegion;
1778
RegionBuilder
? toLeave = frame.RegionBuilderOpt;
1797
private void LeaveRegionsUpTo(
RegionBuilder
resultCaptureRegion)
1805
private int GetNextCaptureId(
RegionBuilder
owner)
1863
RegionBuilder
? currentSpillRegion = currentFrame.RegionBuilderOpt;
1892
RegionBuilder
candidate = CurrentRegionRequired;
2347
var
resultCaptureRegion = CurrentRegionRequired;
2430
var
resultCaptureRegion = CurrentRegionRequired;
2467
var
resultCaptureRegion = CurrentRegionRequired;
2568
var
resultCaptureRegion = CurrentRegionRequired;
2676
var
resultCaptureRegion = CurrentRegionRequired;
2762
RegionBuilder
? current = _currentRegion;
3047
RegionBuilder
resultCaptureRegion = CurrentRegionRequired;
3107
RegionBuilder
resultCaptureRegion = CurrentRegionRequired;
3364
RegionBuilder
resultCaptureRegion = CurrentRegionRequired;
3576
var
locals = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals);
3662
RegionBuilder
? tryAndFinallyRegion = null;
3688
RegionBuilder
? filterAndHandlerRegion = null;
3700
var
filterRegion = new RegionBuilder(ControlFlowRegionKind.Filter, catchClause.ExceptionType);
3716
var
handlerRegion = new RegionBuilder(ControlFlowRegionKind.Catch, catchClause.ExceptionType,
3764
var
finallyRegion = new RegionBuilder(ControlFlowRegionKind.Finally);
3958
var
usingRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: locals);
4073
RegionBuilder
? resourceRegion = null;
4120
var
finallyRegion = new RegionBuilder(ControlFlowRegionKind.Finally);
4308
var
lockRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime,
4457
var
enumeratorCaptureRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime);
4462
RegionBuilder
? regionForCollection = null;
4513
var
localsRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals);
4748
var
loopRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: locals);
4882
RegionBuilder
currentRegion = CurrentRegionRequired;
5470
var
switchRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: locals);
6440
RegionBuilder
owner = CurrentRegionRequired;
6792
RegionBuilder
resultRegion = CurrentRegionRequired;
6795
var
constructorRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime);
7742
RegionBuilder
resultCaptureRegion = CurrentRegionRequired;
7750
var
armScopeRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: arm.Locals);
7948
var
outerCaptureRegion = CurrentRegionRequired;
7951
var
innerCaptureRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (10)
18
public
RegionBuilder
? Enclosing { get; private set; } = null;
22
public ArrayBuilder<
RegionBuilder
>? Regions = null;
128
public void Add(
RegionBuilder
region)
132
Regions = ArrayBuilder<
RegionBuilder
>.GetInstance();
183
public void Remove(
RegionBuilder
region)
201
public void ReplaceRegion(
RegionBuilder
toReplace, ArrayBuilder<
RegionBuilder
> replaceWith)
223
RegionBuilder
single = replaceWith[0];
237
foreach (
RegionBuilder
region in replaceWith)
323
foreach (
RegionBuilder
region in Regions)