2 writes to Regions
Microsoft.CodeAnalysis (2)
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (2)
132
Regions
= ArrayBuilder<RegionBuilder>.GetInstance();
289
Regions
= null;
52 references to Regions
Microsoft.CodeAnalysis (52)
Operations\ControlFlowGraphBuilder.cs (16)
522
for (int i = region.
Regions
.Count - 1; i >= 0; i--)
524
RegionBuilder r = region.
Regions
[i];
550
if (region.
Regions
?.Count == 1)
552
RegionBuilder subRegion = region.
Regions
[0];
569
for (int i = region.
Regions
.Count - 1; i >= 0; i--)
571
RegionBuilder subRegion = region.
Regions
[i];
590
region.
Regions
.RemoveAt(i);
638
foreach (RegionBuilder r in subRegion.
Regions
)
650
enclosing.ReplaceRegion(subRegion, subRegion.
Regions
);
760
Debug.Assert(tryAndFinally.
Regions
!.Count == 2);
762
RegionBuilder @try = tryAndFinally.
Regions
.First();
764
Debug.Assert(tryAndFinally.
Regions
.Last() == currentRegion);
3738
Debug.Assert(filterAndHandlerRegion.
Regions
![0].LastBlock!.FallThrough.Destination == null);
3743
Debug.Assert(predecessors.All(p => filterAndHandlerRegion.
Regions
[0].FirstBlock!.Ordinal <= p.Ordinal &&
3744
filterAndHandlerRegion.
Regions
[0].LastBlock!.Ordinal >= p.Ordinal));
3780
Debug.Assert(tryAndFinallyRegion?.
Regions
![1].LastBlock!.FallThrough.Destination == null);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (36)
52
[MemberNotNullWhen(true, nameof(
Regions
))]
53
public bool HasRegions =>
Regions
?.Count > 0;
127
[MemberNotNull(nameof(
Regions
))]
130
if (
Regions
== null)
139
Regions
.Add(region);
142
ControlFlowRegionKind lastKind =
Regions
.Last().Kind;
146
Debug.Assert(
Regions
.Count <= 2);
147
Debug.Assert(lastKind == (
Regions
.Count < 2 ? ControlFlowRegionKind.Filter : ControlFlowRegionKind.Catch));
151
if (
Regions
.Count == 1)
162
Debug.Assert(
Regions
.Count <= 2);
163
if (
Regions
.Count == 1)
186
Debug.Assert(
Regions
!= null);
188
if (
Regions
.Count == 1)
190
Debug.Assert(
Regions
[0] == region);
191
Regions
.Clear();
195
Regions
.RemoveAt(
Regions
.IndexOf(region));
206
Debug.Assert(
Regions
!= null);
210
if (
Regions
.Count == 1)
212
Debug.Assert(
Regions
[0] == toReplace);
217
insertAt =
Regions
.IndexOf(toReplace);
225
Regions
[insertAt] = single;
229
int originalCount =
Regions
.Count;
230
Regions
.Count = replaceWithCount - 1 + originalCount;
232
for (int i = originalCount - 1, j =
Regions
.Count - 1; i > insertAt; i--, j--)
234
Regions
[j] =
Regions
[i];
240
Regions
[insertAt++] = region;
254
Regions
!.Last().LastBlock == block);
267
FirstBlock =
Regions
.First().FirstBlock;
269
Debug.Assert(
Regions
.Count == 1 &&
Regions
.First().LastBlock == block);
274
Debug.Assert(!HasRegions ||
Regions
.Last().LastBlock!.Ordinal <= block.Ordinal);
288
Regions
?.Free();
321
var builder = ArrayBuilder<ControlFlowRegion>.GetInstance(
Regions
.Count);
323
foreach (RegionBuilder region in
Regions
)