406 references to ControlFlowRegionKind
GenerateDocumentationAndConfigFiles (27)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
318case ControlFlowRegionKind.Catch:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
175if (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) 324case ControlFlowRegionKind.TryAndFinally: 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336case ControlFlowRegionKind.TryAndCatch: 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 384case ControlFlowRegionKind.Catch: 388case ControlFlowRegionKind.FilterAndHandler: 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (6)
385case ControlFlowRegionKind.Catch: 386case ControlFlowRegionKind.Filter: 387case ControlFlowRegionKind.FilterAndHandler: 388case ControlFlowRegionKind.Finally: 402case ControlFlowRegionKind.TryAndCatch: 403case ControlFlowRegionKind.TryAndFinally:
ILLink.RoslynAnalyzer (26)
DataFlow\ControlFlowGraphProxy.cs (26)
40ControlFlowRegionKind.Try => RegionKind.Try, 41ControlFlowRegionKind.Catch => RegionKind.Catch, 42ControlFlowRegionKind.Filter => RegionKind.Filter, 43ControlFlowRegionKind.Finally => RegionKind.Finally, 131while (region != null && region.Kind != ControlFlowRegionKind.Root) 133if (region.Kind is ControlFlowRegionKind.Try or ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter) 149while (region != null && region.Kind != ControlFlowRegionKind.Root) 151if (region.Kind == ControlFlowRegionKind.Finally) 163if (catchOrFilterOrFinallyRegion.Region.Kind is not (ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter or ControlFlowRegionKind.Finally)) 171if (enclosingRegion.Kind == ControlFlowRegionKind.FilterAndHandler) 174Debug.Assert(enclosingRegion.Kind == ControlFlowRegionKind.TryAndCatch); 183if (nested.Kind == ControlFlowRegionKind.Try) 192if (region.Kind is not (ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter)) 196if (region.Kind is ControlFlowRegionKind.Catch && region.EnclosingRegion!.Kind is ControlFlowRegionKind.FilterAndHandler) 207case ControlFlowRegionKind.Catch: 210case ControlFlowRegionKind.FilterAndHandler: 214if (filter.Kind == ControlFlowRegionKind.Filter) 233if (catchOrFilter.Kind == ControlFlowRegionKind.Filter) 241if (catchRegion.Region.Kind is not ControlFlowRegionKind.Catch) 244return catchRegion.Region.EnclosingRegion!.Kind == ControlFlowRegionKind.FilterAndHandler;
Microsoft.CodeAnalysis (152)
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 (2)
46Debug.Assert(root.Kind == ControlFlowRegionKind.Root); 215/// Root (<see cref="ControlFlowRegionKind.Root"/>) region for the graph.
Operations\ControlFlowGraphBuilder.cs (94)
23/// There are different kinds of regions, <see cref="ControlFlowRegionKind"/>. 116var root = new RegionBuilder(ControlFlowRegionKind.Root); 122builder.EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime)); 357Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 360if (region.Kind == ControlFlowRegionKind.Try && enclosing.Kind == ControlFlowRegionKind.TryAndFinally) 363Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 380Debug.Assert(@finally.Kind == ControlFlowRegionKind.Finally); 415ControlFlowRegion? enclosing = fromRegion.Kind == ControlFlowRegionKind.Root ? null : fromRegion.EnclosingRegion; 416if (fromRegion.Kind == ControlFlowRegionKind.Try) 420case ControlFlowRegionKind.TryAndFinally: 422Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 430case ControlFlowRegionKind.TryAndCatch: 439else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 442Debug.Assert(enclosing!.Kind == ControlFlowRegionKind.FilterAndHandler); 445Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 469Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 479case ControlFlowRegionKind.Catch: 483case ControlFlowRegionKind.FilterAndHandler: 485Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter); 538if (r.Kind == ControlFlowRegionKind.LocalLifetime && 549case ControlFlowRegionKind.Root: 550case ControlFlowRegionKind.Filter: 551case ControlFlowRegionKind.Try: 552case ControlFlowRegionKind.Catch: 553case ControlFlowRegionKind.Finally: 554case ControlFlowRegionKind.LocalLifetime: 555case ControlFlowRegionKind.StaticLocalInitializer: 556case ControlFlowRegionKind.ErroneousBody: 561if (subRegion.Kind == ControlFlowRegionKind.LocalLifetime && subRegion.FirstBlock == region.FirstBlock && subRegion.LastBlock == region.LastBlock) 563Debug.Assert(region.Kind != ControlFlowRegionKind.Root); 581if (subRegion.Kind == ControlFlowRegionKind.LocalLifetime && !subRegion.HasLocalFunctions && 607case ControlFlowRegionKind.TryAndCatch: 608case ControlFlowRegionKind.TryAndFinally: 609case ControlFlowRegionKind.FilterAndHandler: 624Debug.Assert(subRegion.Kind != ControlFlowRegionKind.Root); 738Debug.Assert(currentRegion.Kind == ControlFlowRegionKind.Filter || 739currentRegion.Kind == ControlFlowRegionKind.Finally); 760if (currentRegion.Kind == ControlFlowRegionKind.Finally && 767Debug.Assert(tryAndFinally.Kind == ControlFlowRegionKind.TryAndFinally); 771Debug.Assert(@try.Kind == ControlFlowRegionKind.Try); 783@try.Kind = ControlFlowRegionKind.LocalLifetime; 1033case ControlFlowRegionKind.Filter: 1034case ControlFlowRegionKind.Catch: 1035case ControlFlowRegionKind.Finally: 1395EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals)); 1493EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals)); 1533EnterRegion(new RegionBuilder(ControlFlowRegionKind.ErroneousBody)); 1654var resultCaptureRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, isStackSpillRegion: true); 1850frameOpt.RegionBuilderOpt = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, isStackSpillRegion: true); 3586var locals = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals); 3676tryAndFinallyRegion = new RegionBuilder(ControlFlowRegionKind.TryAndFinally); 3678EnterRegion(new RegionBuilder(ControlFlowRegionKind.Try)); 3684EnterRegion(new RegionBuilder(ControlFlowRegionKind.TryAndCatch)); 3685EnterRegion(new RegionBuilder(ControlFlowRegionKind.Try)); 3688Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 3707filterAndHandlerRegion = new RegionBuilder(ControlFlowRegionKind.FilterAndHandler, catchClause.ExceptionType, catchClause.Locals); 3710var filterRegion = new RegionBuilder(ControlFlowRegionKind.Filter, catchClause.ExceptionType); 3726var handlerRegion = new RegionBuilder(ControlFlowRegionKind.Catch, catchClause.ExceptionType, 3765Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndCatch); 3771Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 3774var finallyRegion = new RegionBuilder(ControlFlowRegionKind.Finally); 3968var usingRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: locals); 4088resourceRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime); 4098EnterRegion(new RegionBuilder(ControlFlowRegionKind.TryAndFinally)); 4099EnterRegion(new RegionBuilder(ControlFlowRegionKind.Try)); 4103Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 4110Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4125Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4131var finallyRegion = new RegionBuilder(ControlFlowRegionKind.Finally); 4319var lockRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, 4370EnterRegion(new RegionBuilder(ControlFlowRegionKind.TryAndFinally)); 4371EnterRegion(new RegionBuilder(ControlFlowRegionKind.Try)); 4405Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.Try); 4413EnterRegion(new RegionBuilder(ControlFlowRegionKind.Finally)); 4453Debug.Assert(CurrentRegionRequired.Kind == ControlFlowRegionKind.TryAndFinally); 4468var enumeratorCaptureRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime); 4493regionForCollection = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: ImmutableArray.Create(local)); 4510EnterRegion(new RegionBuilder(ControlFlowRegionKind.TryAndFinally)); 4511EnterRegion(new RegionBuilder(ControlFlowRegionKind.Try)); 4524var localsRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals); 4542Debug.Assert(_currentRegion.Kind == ControlFlowRegionKind.Try); 4559Debug.Assert(_currentRegion.Kind == ControlFlowRegionKind.TryAndFinally); 4759var loopRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: locals); 5481var switchRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: locals); 5746EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals)); 5762EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.ConditionLocals)); 5790EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: operation.Locals)); 5848EnterRegion(new RegionBuilder(ControlFlowRegionKind.StaticLocalInitializer)); 6828var constructorRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime); 6888EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime)); 7312EnterRegion(new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: initializer.Locals)); 7792var armScopeRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime, locals: arm.Locals); 7993var innerCaptureRegion = new RegionBuilder(ControlFlowRegionKind.LocalLifetime);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (25)
17public ControlFlowRegionKind Kind; 31public RegionBuilder(ControlFlowRegionKind kind, ITypeSymbol? exceptionType = null, ImmutableArray<ILocalSymbol> locals = default, bool isStackSpillRegion = false) 33Debug.Assert(!isStackSpillRegion || (kind == ControlFlowRegionKind.LocalLifetime && locals.IsDefaultOrEmpty)); 66Debug.Assert(Kind != ControlFlowRegionKind.Root); 78Debug.Assert(Kind != ControlFlowRegionKind.Root); 97Debug.Assert(Kind != ControlFlowRegionKind.Root); 110Debug.Assert(Kind != ControlFlowRegionKind.Root); 142ControlFlowRegionKind lastKind = Regions.Last().Kind; 145case ControlFlowRegionKind.FilterAndHandler: 147Debug.Assert(lastKind == (Regions.Count < 2 ? ControlFlowRegionKind.Filter : ControlFlowRegionKind.Catch)); 150case ControlFlowRegionKind.TryAndCatch: 153Debug.Assert(lastKind == ControlFlowRegionKind.Try); 157Debug.Assert(lastKind == ControlFlowRegionKind.Catch || lastKind == ControlFlowRegionKind.FilterAndHandler); 161case ControlFlowRegionKind.TryAndFinally: 165Debug.Assert(lastKind == ControlFlowRegionKind.Try); 169Debug.Assert(lastKind == ControlFlowRegionKind.Finally); 174Debug.Assert(lastKind != ControlFlowRegionKind.Filter); 175Debug.Assert(lastKind != ControlFlowRegionKind.Catch); 176Debug.Assert(lastKind != ControlFlowRegionKind.Finally); 177Debug.Assert(lastKind != ControlFlowRegionKind.Try); 251Debug.Assert((Kind != ControlFlowRegionKind.FilterAndHandler && 252Kind != ControlFlowRegionKind.TryAndCatch && 253Kind != ControlFlowRegionKind.TryAndFinally) ||
Operations\ControlFlowRegion.cs (27)
20public ControlFlowRegionKind Kind { get; } 23/// Enclosing region. Null for <see cref="ControlFlowRegionKind.Root"/> 28/// Target exception type for <see cref="ControlFlowRegionKind.Filter"/>, <see cref="ControlFlowRegionKind.Catch"/>, 29/// <see cref="ControlFlowRegionKind.FilterAndHandler "/> 63internal ControlFlowRegion(ControlFlowRegionKind kind, int firstBlockOrdinal, int lastBlockOrdinal, 86Debug.Assert(r.EnclosingRegion == null && r.Kind != ControlFlowRegionKind.Root); 94case ControlFlowRegionKind.TryAndFinally: 95case ControlFlowRegionKind.FilterAndHandler: 97Debug.Assert(NestedRegions[0].Kind == (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Try : ControlFlowRegionKind.Filter)); 98Debug.Assert(NestedRegions[1].Kind == (kind == ControlFlowRegionKind.TryAndFinally ? ControlFlowRegionKind.Finally : ControlFlowRegionKind.Catch)); 104case ControlFlowRegionKind.TryAndCatch: 106Debug.Assert(NestedRegions[0].Kind == ControlFlowRegionKind.Try); 116Debug.Assert(r.Kind == ControlFlowRegionKind.FilterAndHandler || r.Kind == ControlFlowRegionKind.Catch); 122case ControlFlowRegionKind.Root: 123case ControlFlowRegionKind.LocalLifetime: 124case ControlFlowRegionKind.Try: 125case ControlFlowRegionKind.Filter: 126case ControlFlowRegionKind.Catch: 127case ControlFlowRegionKind.Finally: 128case ControlFlowRegionKind.StaticLocalInitializer: 129case ControlFlowRegionKind.ErroneousBody:
Microsoft.CodeAnalysis.Analyzers (27)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
318case ControlFlowRegionKind.Catch:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
175if (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) 324case ControlFlowRegionKind.TryAndFinally: 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336case ControlFlowRegionKind.TryAndCatch: 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 384case ControlFlowRegionKind.Catch: 388case ControlFlowRegionKind.FilterAndHandler: 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (6)
385case ControlFlowRegionKind.Catch: 386case ControlFlowRegionKind.Filter: 387case ControlFlowRegionKind.FilterAndHandler: 388case ControlFlowRegionKind.Finally: 402case ControlFlowRegionKind.TryAndCatch: 403case ControlFlowRegionKind.TryAndFinally:
Microsoft.CodeAnalysis.AnalyzerUtilities (66)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\BasicBlockExtensions.cs (9)
52public static bool IsContainedInRegionOfKind(this BasicBlock basicBlock, ControlFlowRegionKind regionKind) 58public static ControlFlowRegion? GetContainingRegionOfKind(this BasicBlock basicBlock, ControlFlowRegionKind regionKind) 78=> basicBlock.IsFirstBlockOfRegionKind(ControlFlowRegionKind.Finally, out finallyRegion); 84=> basicBlock.IsLastBlockOfRegionKind(ControlFlowRegionKind.Finally, out finallyRegion); 89public static bool IsFirstBlockOfRegionKind(this BasicBlock basicBlock, ControlFlowRegionKind regionKind, [NotNullWhen(returnValue: true)] out ControlFlowRegion? region) 95public static bool IsLastBlockOfRegionKind(this BasicBlock basicBlock, ControlFlowRegionKind regionKind, [NotNullWhen(returnValue: true)] out ControlFlowRegion? region) 98private static bool IsFirstOrLastBlockOfRegionKind(this BasicBlock basicBlock, ControlFlowRegionKind regionKind, bool first, [NotNullWhen(returnValue: true)] out ControlFlowRegion? foundRegion) 128if (!basicBlock.IsFirstBlockOfRegionKind(ControlFlowRegionKind.Finally, out var finallyRegion)) 144internal static ControlFlowRegion? GetInnermostRegionStartedByBlock(this BasicBlock basicBlock, ControlFlowRegionKind regionKind)
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\Extensions\IOperationExtensions_FlowAnalysis.cs (1)
29case ControlFlowRegionKind.Catch:
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowAnalysis.cs (23)
228var finallyRegion = block.GetInnermostRegionStartedByBlock(ControlFlowRegionKind.Finally); 229if (finallyRegion?.EnclosingRegion!.Kind == ControlFlowRegionKind.TryAndFinally) 233Debug.Assert(tryRegion.Kind == ControlFlowRegionKind.Try); 238cfg.Blocks[p].GetInnermostRegionStartedByBlock(ControlFlowRegionKind.Catch) != null); 278Debug.Assert(enclosingTryAndCatchRegion.Kind == ControlFlowRegionKind.TryAndCatch); 279Debug.Assert(block.EnclosingRegion.Kind is ControlFlowRegionKind.Catch or ControlFlowRegionKind.Filter); 298if (block.EnclosingRegion?.Kind == ControlFlowRegionKind.Try && 299block.EnclosingRegion.EnclosingRegion?.Kind == ControlFlowRegionKind.TryAndCatch && 349if (successorBlock.IsFirstBlockOfRegionKind(ControlFlowRegionKind.TryAndFinally, out var tryAndFinally)) 352Debug.Assert(finallyRegion.Kind == ControlFlowRegionKind.Finally); 492Debug.Assert(tryAndCatchRegion.Kind == ControlFlowRegionKind.TryAndCatch); 497var catchRegion = tryAndCatchRegion.NestedRegions.FirstOrDefault(region => region.Kind is ControlFlowRegionKind.Catch or ControlFlowRegionKind.FilterAndHandler); 598case ControlFlowRegionKind.Catch: 599if (block.EnclosingRegion!.EnclosingRegion!.Kind == ControlFlowRegionKind.TryAndCatch) 606case ControlFlowRegionKind.Filter: 607if (block.EnclosingRegion!.EnclosingRegion!.Kind == ControlFlowRegionKind.FilterAndHandler && 608block.EnclosingRegion.EnclosingRegion.EnclosingRegion?.Kind == ControlFlowRegionKind.TryAndCatch) 627Debug.Assert(basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Finally); 689if (region.Kind == ControlFlowRegionKind.TryAndCatch) 729Debug.Assert(finallyRegion.Kind == ControlFlowRegionKind.Finally); 810hasAnyTryBlock |= block.EnclosingRegion.Kind == ControlFlowRegionKind.Try;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\DataFlowOperationVisitor.cs (2)
919CurrentBasicBlock.IsContainedInRegionOfKind(ControlFlowRegionKind.Finally)) 3795var tryFinallyRegion = CurrentBasicBlock.GetContainingRegionOfKind(ControlFlowRegionKind.TryAndFinally)!;
src\roslyn\src\RoslynAnalyzers\Utilities\FlowAnalysis\FlowAnalysis\Framework\DataFlow\ThrownExceptionInfo.cs (4)
25ContainingFinallyRegion = block.GetContainingRegionOfKind(ControlFlowRegionKind.Finally); 48if (enclosingRegion.Kind == ControlFlowRegionKind.TryAndCatch) 50Debug.Assert(enclosingRegion.NestedRegions[0].Kind == ControlFlowRegionKind.Try); 53if (nestedRegion.Kind == ControlFlowRegionKind.Catch &&
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
318case ControlFlowRegionKind.Catch:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
175if (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) 324case ControlFlowRegionKind.TryAndFinally: 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336case ControlFlowRegionKind.TryAndCatch: 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 384case ControlFlowRegionKind.Catch: 388case ControlFlowRegionKind.FilterAndHandler: 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (6)
385case ControlFlowRegionKind.Catch: 386case ControlFlowRegionKind.Filter: 387case ControlFlowRegionKind.FilterAndHandler: 388case ControlFlowRegionKind.Finally: 402case ControlFlowRegionKind.TryAndCatch: 403case ControlFlowRegionKind.TryAndFinally:
Microsoft.CodeAnalysis.CodeStyle (27)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
318case ControlFlowRegionKind.Catch:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
175if (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) 324case ControlFlowRegionKind.TryAndFinally: 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336case ControlFlowRegionKind.TryAndCatch: 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 384case ControlFlowRegionKind.Catch: 388case ControlFlowRegionKind.FilterAndHandler: 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (6)
385case ControlFlowRegionKind.Catch: 386case ControlFlowRegionKind.Filter: 387case ControlFlowRegionKind.FilterAndHandler: 388case ControlFlowRegionKind.Finally: 402case ControlFlowRegionKind.TryAndCatch: 403case ControlFlowRegionKind.TryAndFinally:
Microsoft.CodeAnalysis.ResxSourceGenerator (27)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
318case ControlFlowRegionKind.Catch:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
175if (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) 324case ControlFlowRegionKind.TryAndFinally: 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336case ControlFlowRegionKind.TryAndCatch: 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 384case ControlFlowRegionKind.Catch: 388case ControlFlowRegionKind.FilterAndHandler: 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (6)
385case ControlFlowRegionKind.Catch: 386case ControlFlowRegionKind.Filter: 387case ControlFlowRegionKind.FilterAndHandler: 388case ControlFlowRegionKind.Finally: 402case ControlFlowRegionKind.TryAndCatch: 403case ControlFlowRegionKind.TryAndFinally:
Microsoft.CodeAnalysis.Workspaces (27)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
318case ControlFlowRegionKind.Catch:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
175if (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) 324case ControlFlowRegionKind.TryAndFinally: 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336case ControlFlowRegionKind.TryAndCatch: 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 384case ControlFlowRegionKind.Catch: 388case ControlFlowRegionKind.FilterAndHandler: 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (6)
385case ControlFlowRegionKind.Catch: 386case ControlFlowRegionKind.Filter: 387case ControlFlowRegionKind.FilterAndHandler: 388case ControlFlowRegionKind.Finally: 402case ControlFlowRegionKind.TryAndCatch: 403case ControlFlowRegionKind.TryAndFinally:
Roslyn.Diagnostics.Analyzers (27)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
318case ControlFlowRegionKind.Catch:
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (18)
175if (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) 324case ControlFlowRegionKind.TryAndFinally: 326Debug.Assert(enclosing.NestedRegions[1].Kind == ControlFlowRegionKind.Finally); 336case ControlFlowRegionKind.TryAndCatch: 345else if (fromRegion.Kind == ControlFlowRegionKind.Filter) 348Debug.Assert(enclosing.Kind == ControlFlowRegionKind.FilterAndHandler); 350Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 374Debug.Assert(tryAndCatch.Kind == ControlFlowRegionKind.TryAndCatch); 384case ControlFlowRegionKind.Catch: 388case ControlFlowRegionKind.FilterAndHandler: 390Debug.Assert(@catch.NestedRegions[0].Kind == ControlFlowRegionKind.Filter);
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (2)
169if (basicBlock.EnclosingRegion.Kind == ControlFlowRegionKind.Catch && 189if (region.Kind == ControlFlowRegionKind.TryAndFinally)
src\roslyn\src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (6)
385case ControlFlowRegionKind.Catch: 386case ControlFlowRegionKind.Filter: 387case ControlFlowRegionKind.FilterAndHandler: 388case ControlFlowRegionKind.Finally: 402case ControlFlowRegionKind.TryAndCatch: 403case ControlFlowRegionKind.TryAndFinally: