1 write to Kind
Microsoft.CodeAnalysis (1)
Operations\ControlFlowRegion.cs (1)
74Kind = 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)
88Debug.Assert(source.Kind != ControlFlowRegionKind.Root); 142if (leavingRegions[i].Kind == ControlFlowRegionKind.Try && leavingRegions[i + 1].Kind == ControlFlowRegionKind.TryAndFinally) 150Debug.Assert(builder.Last().Kind == ControlFlowRegionKind.Finally);
Operations\ControlFlowGraph.cs (1)
46Debug.Assert(root.Kind == ControlFlowRegionKind.Root);
Operations\ControlFlowGraphBuilder.cs (17)
349Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 352if (region.Kind == ControlFlowRegionKind.Try && enclosing.Kind == ControlFlowRegionKind.TryAndFinally) 355Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 372Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 407ControlFlowRegion? enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion; 408if (fromRegion.Kind == ControlFlowRegionKind.Try) 410switch (enclosing!.Kind) 414Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 428throw ExceptionUtilities.UnexpectedValue(enclosing.Kind); 431else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 434Debug.Assert(enclosing!.Kind == ControlFlowRegionKind.FilterAndHandler); 437Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 461Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 469switch (@catch.Kind) 477Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 484throw ExceptionUtilities.UnexpectedValue(@catch.Kind);
Operations\ControlFlowRegion.cs (6)
86Debug.Assert(r.EnclosingRegion == null && r.Kind != ControlFlowRegionKind.Root); 97Debug.Assert(NestedRegions[0].Kind == (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Try : ControlFlowRegionKind.Filter)); 98Debug.Assert(NestedRegions[1].Kind == (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Finally : ControlFlowRegionKind.Catch)); 106Debug.Assert(NestedRegions[0].Kind == ControlFlowRegionKind.Try); 116Debug.Assert(r.Kind == ControlFlowRegionKind.FilterAndHandler || r.Kind == ControlFlowRegionKind.Catch);
Microsoft.CodeAnalysis.CodeStyle (23)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
313switch (currentRegion.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
176if (current.EnclosingRegion.Kind == ControlFlowRegionKind.Finally && 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 260if (region.Kind == ControlFlowRegionKind.Try && enclosing.Kind == ControlFlowRegionKind.TryAndFinally) 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 319var enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion; 320if (fromRegion.Kind == ControlFlowRegionKind.Try) 322switch (enclosing.Kind) 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 342throw ExceptionUtilities.UnexpectedValue(enclosing.Kind); 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 382switch (@catch.Kind) 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 397throw ExceptionUtilities.UnexpectedValue(@catch.Kind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
367switch (outermostEnclosingRegionStartingBlock.Kind) 384switch (currentRegion.Kind)
Microsoft.CodeAnalysis.Test.Utilities (33)
Compilation\ControlFlowGraphVerifier.cs (15)
151Assert.Equal(ControlFlowRegionKind.Root, currentRegion.Kind); 297Assert.True(block.EnclosingRegion.Kind == ControlFlowRegionKind.Filter || block.EnclosingRegion.Kind == ControlFlowRegionKind.Finally); 734while (region.Kind != ControlFlowRegionKind.Root) 736if (region.Kind == ControlFlowRegionKind.Try && region.EnclosingRegion.Kind == ControlFlowRegionKind.TryAndFinally) 738Debug.Assert(region.EnclosingRegion.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 1431switch (region.Kind) 1453switch (region.EnclosingRegion.Kind) 1463Assert.False(true, $"Unexpected region kind {region.EnclosingRegion.Kind}"); 1493Assert.False(true, $"Unexpected region kind {region.Kind}"); 1529switch (region.Kind) 1542switch (region.EnclosingRegion.Kind) 1549Assert.False(true, $"Unexpected region kind {region.EnclosingRegion.Kind}"); 1562Assert.False(true, $"Unexpected region kind {region.Kind}");
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
176if (current.EnclosingRegion.Kind == ControlFlowRegionKind.Finally && 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 260if (region.Kind == ControlFlowRegionKind.Try && enclosing.Kind == ControlFlowRegionKind.TryAndFinally) 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 319var enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion; 320if (fromRegion.Kind == ControlFlowRegionKind.Try) 322switch (enclosing.Kind) 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 342throw ExceptionUtilities.UnexpectedValue(enclosing.Kind); 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 382switch (@catch.Kind) 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 397throw ExceptionUtilities.UnexpectedValue(@catch.Kind);
Microsoft.CodeAnalysis.Workspaces (23)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
313switch (currentRegion.Kind)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
176if (current.EnclosingRegion.Kind == ControlFlowRegionKind.Finally && 258Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 260if (region.Kind == ControlFlowRegionKind.Try && enclosing.Kind == ControlFlowRegionKind.TryAndFinally) 263Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 280Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 319var enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion; 320if (fromRegion.Kind == ControlFlowRegionKind.Try) 322switch (enclosing.Kind) 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 342throw ExceptionUtilities.UnexpectedValue(enclosing.Kind); 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 382switch (@catch.Kind) 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 397throw ExceptionUtilities.UnexpectedValue(@catch.Kind);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (2)
367switch (outermostEnclosingRegionStartingBlock.Kind) 384switch (currentRegion.Kind)