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