1 write to Kind
Microsoft.CodeAnalysis (1)
Operations\ControlFlowRegion.cs (1)
74
Kind
= kind;
124 references to Kind
ILLink.RoslynAnalyzer (17)
DataFlow\ControlFlowGraphProxy.cs (17)
38
public RegionKind Kind => Region.
Kind
switch {
125
while (region != null && region.
Kind
!= ControlFlowRegionKind.Root) {
126
if (region.
Kind
is ControlFlowRegionKind.Try or ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter) {
141
while (region != null && region.
Kind
!= ControlFlowRegionKind.Root) {
142
if (region.
Kind
== ControlFlowRegionKind.Finally) {
153
if (catchOrFilterOrFinallyRegion.Region.
Kind
is not (ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter or ControlFlowRegionKind.Finally))
161
if (enclosingRegion.
Kind
== ControlFlowRegionKind.FilterAndHandler) {
163
Debug.Assert (enclosingRegion.
Kind
== ControlFlowRegionKind.TryAndCatch);
171
if (nested.
Kind
== ControlFlowRegionKind.Try)
180
if (region.
Kind
is not (ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter))
184
if (region.
Kind
is ControlFlowRegionKind.Catch && region.EnclosingRegion!.
Kind
is ControlFlowRegionKind.FilterAndHandler)
192
switch (nested.
Kind
) {
199
if (filter.
Kind
== ControlFlowRegionKind.Filter) {
217
if (catchOrFilter.
Kind
== ControlFlowRegionKind.Filter)
225
if (catchRegion.Region.
Kind
is not ControlFlowRegionKind.Catch)
228
return catchRegion.Region.EnclosingRegion!.
Kind
== ControlFlowRegionKind.FilterAndHandler;
Microsoft.CodeAnalysis (28)
Operations\ControlFlowBranch.cs (4)
88
Debug.Assert(source.
Kind
!= ControlFlowRegionKind.Root);
142
if (leavingRegions[i].
Kind
== ControlFlowRegionKind.Try && leavingRegions[i + 1].
Kind
== ControlFlowRegionKind.TryAndFinally)
150
Debug.Assert(builder.Last().
Kind
== ControlFlowRegionKind.Finally);
Operations\ControlFlowGraph.cs (1)
46
Debug.Assert(root.
Kind
== ControlFlowRegionKind.Root);
Operations\ControlFlowGraphBuilder.cs (17)
349
Debug.Assert(region.
Kind
!= ControlFlowRegionKind.Root);
352
if (region.
Kind
== ControlFlowRegionKind.Try && enclosing.
Kind
== ControlFlowRegionKind.TryAndFinally)
355
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
372
Debug.Assert(@finally.
Kind
== ControlFlowRegionKind.Finally);
407
ControlFlowRegion? enclosing = fromRegion.
Kind
== ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
408
if (fromRegion.
Kind
== ControlFlowRegionKind.Try)
410
switch (enclosing!.
Kind
)
414
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
428
throw ExceptionUtilities.UnexpectedValue(enclosing.
Kind
);
431
else if (fromRegion.
Kind
== ControlFlowRegionKind.Filter)
434
Debug.Assert(enclosing!.
Kind
== ControlFlowRegionKind.FilterAndHandler);
437
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
461
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
469
switch (@catch.
Kind
)
477
Debug.Assert(@catch.NestedRegions[0].
Kind
== ControlFlowRegionKind.Filter);
484
throw ExceptionUtilities.UnexpectedValue(@catch.
Kind
);
Operations\ControlFlowRegion.cs (6)
86
Debug.Assert(r.EnclosingRegion == null && r.
Kind
!= ControlFlowRegionKind.Root);
97
Debug.Assert(NestedRegions[0].
Kind
== (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Try : ControlFlowRegionKind.Filter));
98
Debug.Assert(NestedRegions[1].
Kind
== (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Finally : ControlFlowRegionKind.Catch));
106
Debug.Assert(NestedRegions[0].
Kind
== ControlFlowRegionKind.Try);
116
Debug.Assert(r.
Kind
== ControlFlowRegionKind.FilterAndHandler || r.
Kind
== ControlFlowRegionKind.Catch);
Microsoft.CodeAnalysis.CodeStyle (23)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
313
switch (currentRegion.
Kind
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
176
if (current.EnclosingRegion.
Kind
== ControlFlowRegionKind.Finally &&
258
Debug.Assert(region.
Kind
!= ControlFlowRegionKind.Root);
260
if (region.
Kind
== ControlFlowRegionKind.Try && enclosing.
Kind
== ControlFlowRegionKind.TryAndFinally)
263
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
280
Debug.Assert(@finally.
Kind
== ControlFlowRegionKind.Finally);
319
var enclosing = fromRegion.
Kind
== ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
320
if (fromRegion.
Kind
== ControlFlowRegionKind.Try)
322
switch (enclosing.
Kind
)
326
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
342
throw ExceptionUtilities.UnexpectedValue(enclosing.
Kind
);
345
else if (fromRegion.
Kind
== ControlFlowRegionKind.Filter)
348
Debug.Assert(enclosing.
Kind
== ControlFlowRegionKind.FilterAndHandler);
350
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
374
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
382
switch (@catch.
Kind
)
390
Debug.Assert(@catch.NestedRegions[0].
Kind
== ControlFlowRegionKind.Filter);
397
throw ExceptionUtilities.UnexpectedValue(@catch.
Kind
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169
if (basicBlock.EnclosingRegion.
Kind
== ControlFlowRegionKind.Catch &&
189
if (region.
Kind
== ControlFlowRegionKind.TryAndFinally)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
367
switch (outermostEnclosingRegionStartingBlock.
Kind
)
384
switch (currentRegion.
Kind
)
Microsoft.CodeAnalysis.Test.Utilities (33)
Compilation\ControlFlowGraphVerifier.cs (15)
151
Assert.Equal(ControlFlowRegionKind.Root, currentRegion.
Kind
);
297
Assert.True(block.EnclosingRegion.
Kind
== ControlFlowRegionKind.Filter || block.EnclosingRegion.
Kind
== ControlFlowRegionKind.Finally);
734
while (region.
Kind
!= ControlFlowRegionKind.Root)
736
if (region.
Kind
== ControlFlowRegionKind.Try && region.EnclosingRegion.
Kind
== ControlFlowRegionKind.TryAndFinally)
738
Debug.Assert(region.EnclosingRegion.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
1431
switch (region.
Kind
)
1453
switch (region.EnclosingRegion.
Kind
)
1463
Assert.False(true, $"Unexpected region kind {region.EnclosingRegion.
Kind
}");
1493
Assert.False(true, $"Unexpected region kind {region.
Kind
}");
1529
switch (region.
Kind
)
1542
switch (region.EnclosingRegion.
Kind
)
1549
Assert.False(true, $"Unexpected region kind {region.EnclosingRegion.
Kind
}");
1562
Assert.False(true, $"Unexpected region kind {region.
Kind
}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
176
if (current.EnclosingRegion.
Kind
== ControlFlowRegionKind.Finally &&
258
Debug.Assert(region.
Kind
!= ControlFlowRegionKind.Root);
260
if (region.
Kind
== ControlFlowRegionKind.Try && enclosing.
Kind
== ControlFlowRegionKind.TryAndFinally)
263
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
280
Debug.Assert(@finally.
Kind
== ControlFlowRegionKind.Finally);
319
var enclosing = fromRegion.
Kind
== ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
320
if (fromRegion.
Kind
== ControlFlowRegionKind.Try)
322
switch (enclosing.
Kind
)
326
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
342
throw ExceptionUtilities.UnexpectedValue(enclosing.
Kind
);
345
else if (fromRegion.
Kind
== ControlFlowRegionKind.Filter)
348
Debug.Assert(enclosing.
Kind
== ControlFlowRegionKind.FilterAndHandler);
350
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
374
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
382
switch (@catch.
Kind
)
390
Debug.Assert(@catch.NestedRegions[0].
Kind
== ControlFlowRegionKind.Filter);
397
throw ExceptionUtilities.UnexpectedValue(@catch.
Kind
);
Microsoft.CodeAnalysis.Workspaces (23)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
313
switch (currentRegion.
Kind
)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
176
if (current.EnclosingRegion.
Kind
== ControlFlowRegionKind.Finally &&
258
Debug.Assert(region.
Kind
!= ControlFlowRegionKind.Root);
260
if (region.
Kind
== ControlFlowRegionKind.Try && enclosing.
Kind
== ControlFlowRegionKind.TryAndFinally)
263
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
280
Debug.Assert(@finally.
Kind
== ControlFlowRegionKind.Finally);
319
var enclosing = fromRegion.
Kind
== ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion;
320
if (fromRegion.
Kind
== ControlFlowRegionKind.Try)
322
switch (enclosing.
Kind
)
326
Debug.Assert(enclosing.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
342
throw ExceptionUtilities.UnexpectedValue(enclosing.
Kind
);
345
else if (fromRegion.
Kind
== ControlFlowRegionKind.Filter)
348
Debug.Assert(enclosing.
Kind
== ControlFlowRegionKind.FilterAndHandler);
350
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
374
Debug.Assert(tryAndCatch.
Kind
== ControlFlowRegionKind.TryAndCatch);
382
switch (@catch.
Kind
)
390
Debug.Assert(@catch.NestedRegions[0].
Kind
== ControlFlowRegionKind.Filter);
397
throw ExceptionUtilities.UnexpectedValue(@catch.
Kind
);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169
if (basicBlock.EnclosingRegion.
Kind
== ControlFlowRegionKind.Catch &&
189
if (region.
Kind
== ControlFlowRegionKind.TryAndFinally)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
367
switch (outermostEnclosingRegionStartingBlock.
Kind
)
384
switch (currentRegion.
Kind
)