1 write to Kind
Microsoft.CodeAnalysis (1)
Operations\ControlFlowRegion.cs (1)
74
Kind
= kind;
107 references to Kind
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)
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
);
OperationExtensions.cs (1)
307
switch (currentRegion.
Kind
)
SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169
if (basicBlock.EnclosingRegion.
Kind
== ControlFlowRegionKind.Catch &&
189
if (region.
Kind
== ControlFlowRegionKind.TryAndFinally)
SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
368
switch (outermostEnclosingRegionStartingBlock.
Kind
)
385
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);
772
while (region.
Kind
!= ControlFlowRegionKind.Root)
774
if (region.
Kind
== ControlFlowRegionKind.Try && region.EnclosingRegion.
Kind
== ControlFlowRegionKind.TryAndFinally)
776
Debug.Assert(region.EnclosingRegion.NestedRegions[1].
Kind
== ControlFlowRegionKind.Finally);
1456
switch (region.
Kind
)
1478
switch (region.EnclosingRegion.
Kind
)
1488
Assert.False(true, $"Unexpected region kind {region.EnclosingRegion.
Kind
}");
1518
Assert.False(true, $"Unexpected region kind {region.
Kind
}");
1554
switch (region.
Kind
)
1567
switch (region.EnclosingRegion.
Kind
)
1574
Assert.False(true, $"Unexpected region kind {region.EnclosingRegion.
Kind
}");
1587
Assert.False(true, $"Unexpected region kind {region.
Kind
}");
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)
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
);
OperationExtensions.cs (1)
307
switch (currentRegion.
Kind
)
SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169
if (basicBlock.EnclosingRegion.
Kind
== ControlFlowRegionKind.Catch &&
189
if (region.
Kind
== ControlFlowRegionKind.TryAndFinally)
SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
368
switch (outermostEnclosingRegionStartingBlock.
Kind
)
385
switch (currentRegion.
Kind
)