1 instantiation of BasicBlock
Microsoft.CodeAnalysis (1)
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (1)
82
var block = new
BasicBlock
(Kind,
164 references to BasicBlock
ILLink.RoslynAnalyzer (7)
DataFlow\BasicBlockExtensions.cs (1)
12
public static IEnumerable<IOperation> DescendantOperations (this
BasicBlock
basicBlock)
DataFlow\ControlFlowGraphExtensions.cs (4)
15
public static
BasicBlock
EntryBlock (this ControlFlowGraph cfg)
17
var
firstBlock = cfg.Blocks[0];
22
public static
BasicBlock
ExitBlock (this ControlFlowGraph cfg)
24
var
lastBlock = cfg.Blocks.Last ();
DataFlow\ControlFlowGraphProxy.cs (2)
26
public readonly record struct BlockProxy (
BasicBlock
Block) : IBlock<BlockProxy>
51
foreach (
var
block in ControlFlowGraph.Blocks)
Microsoft.CodeAnalysis (40)
Operations\BasicBlockKind.cs (1)
8
/// <see cref="
BasicBlock
"/> kind.
Operations\ControlFlowBranch.cs (5)
23
BasicBlock
source,
24
BasicBlock
? destination,
37
public
BasicBlock
Source { get; }
42
public
BasicBlock
? Destination { get; }
50
/// Indicates if this branch represents <see cref="
BasicBlock
.ConditionalSuccessor"/> of the <see cref="Source"/> basic block.
Operations\ControlFlowConditionKind.cs (13)
8
/// Represents kind of conditional branch from a <see cref="
BasicBlock
"/>.
13
/// Indicates no conditional branch from a <see cref="
BasicBlock
"/>.
14
/// Associated <see cref="
BasicBlock
.ConditionalSuccessor"/> is null.
19
/// Indicates a conditional branch from a <see cref="
BasicBlock
"/>,
20
/// with a non-null <see cref="
BasicBlock
.BranchValue"/> and <see cref="
BasicBlock
.ConditionalSuccessor"/>.
21
/// If <see cref="
BasicBlock
.BranchValue"/> evaluates to <code>false</code>,
22
/// then the branch <see cref="
BasicBlock
.ConditionalSuccessor"/> is taken.
27
/// Indicates a conditional branch from a <see cref="
BasicBlock
"/>,
28
/// with a non-null <see cref="
BasicBlock
.BranchValue"/> and <see cref="
BasicBlock
.ConditionalSuccessor"/>.
29
/// If <see cref="
BasicBlock
.BranchValue"/> evaluates to <code>true</code>,
30
/// then the branch <see cref="
BasicBlock
.ConditionalSuccessor"/> is taken.
Operations\ControlFlowGraph.cs (5)
19
/// This graph contains a set of <see cref="
BasicBlock
"/>s, with an entry block, zero
21
/// Each basic block contains zero or more <see cref="
BasicBlock
.Operations"/> and
35
ImmutableArray<
BasicBlock
> blocks, ControlFlowRegion root,
197
/// Note that <see cref="
BasicBlock
.Operations"/> in the control flow graph are not in the same operation tree as
212
public ImmutableArray<
BasicBlock
> Blocks { get; }
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (5)
79
public
BasicBlock
ToImmutable()
82
var
block = new BasicBlock(Kind,
227
public ImmutableArray<ControlFlowBranch> ConvertPredecessorsToBranches(ArrayBuilder<
BasicBlock
> blocks)
236
BasicBlock
block = blocks[Ordinal];
291
BasicBlock
predecessor = blocks[predecessorBlockBuilder.Ordinal];
Operations\ControlFlowGraphBuilder.cs (2)
172
private static ImmutableArray<
BasicBlock
> ToImmutableBlocks(ArrayBuilder<BasicBlockBuilder> blockBuilders)
174
var builder = ArrayBuilder<
BasicBlock
>.GetInstance(blockBuilders.Count);
Operations\ControlFlowRegion.cs (5)
12
/// Encapsulates information about regions of <see cref="
BasicBlock
"/>s in a <see cref="ControlFlowGraph"/>.
34
/// Ordinal (<see cref="
BasicBlock
.Ordinal"/>) of the first <see cref="
BasicBlock
"/> within the region.
39
/// Ordinal (<see cref="
BasicBlock
.Ordinal"/>) of the last <see cref="
BasicBlock
"/> within the region.
Operations\ControlFlowRegionKind.cs (4)
15
/// A root region encapsulating all <see cref="
BasicBlock
"/>s in a <see cref="ControlFlowGraph"/>
44
/// Doesn't contain any <see cref="
BasicBlock
"/>s directly.
50
/// and <see cref="FilterAndHandler"/> regions. Doesn't contain any <see cref="
BasicBlock
"/>s directly.
61
/// region. Doesn't contain any <see cref="
BasicBlock
"/>s directly.
Microsoft.CodeAnalysis.CodeStyle (40)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\BasicBlockExtensions.cs (1)
12
public static IEnumerable<IOperation> DescendantOperations(this
BasicBlock
basicBlock)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (4)
13
public static
BasicBlock
EntryBlock(this ControlFlowGraph cfg)
15
var
firstBlock = cfg.Blocks[0];
20
public static
BasicBlock
ExitBlock(this ControlFlowGraph cfg)
22
var
lastBlock = cfg.Blocks.Last();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
307
foreach (
var
block in cfg.Blocks)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (10)
39
var unreachableBlocksToVisit = ArrayBuilder<
BasicBlock
>.GetInstance();
68
ImmutableArray<
BasicBlock
> blocks,
73
ArrayBuilder<
BasicBlock
> unreachableBlocksToVisit,
81
var
firstBlock = blocks[firstBlockOrdinal];
85
var processedBlocks = PooledHashSet<
BasicBlock
>.GetInstance();
92
BasicBlock
current;
105
var
unreachableBlock = unreachableBlocksToVisit[index];
203
void FollowBranch(
BasicBlock
current, ControlFlowBranch branch, TBlockAnalysisData currentAnalsisData)
231
var
destination = branch.Destination;
389
var
entryBlock = blocks[@catch.FirstBlockOrdinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\DataFlowAnalyzer.cs (5)
21
public abstract TBlockAnalysisData GetCurrentAnalysisData(
BasicBlock
basicBlock);
31
public abstract void SetCurrentAnalysisData(
BasicBlock
basicBlock, TBlockAnalysisData data, CancellationToken cancellationToken);
36
public abstract TBlockAnalysisData AnalyzeBlock(
BasicBlock
basicBlock, CancellationToken cancellationToken);
42
public abstract TBlockAnalysisData AnalyzeNonConditionalBranch(
BasicBlock
basicBlock, TBlockAnalysisData currentAnalysisData, CancellationToken cancellationToken);
50
BasicBlock
basicBlock, TBlockAnalysisData currentAnalysisData, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (1)
17
/// Analysis data for a particular <see cref="
BasicBlock
"/> for <see cref="ControlFlowGraph"/>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (6)
88
public override BasicBlockAnalysisData AnalyzeBlock(
BasicBlock
basicBlock, CancellationToken cancellationToken)
120
BasicBlock
basicBlock,
126
BasicBlock
basicBlock,
147
BasicBlock
basicBlock,
198
public override BasicBlockAnalysisData GetCurrentAnalysisData(
BasicBlock
basicBlock)
204
public override void SetCurrentAnalysisData(
BasicBlock
basicBlock, BasicBlockAnalysisData data, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (12)
31
private readonly PooledDictionary<
BasicBlock
, BasicBlockAnalysisData> _analysisDataByBasicBlockMap;
76
PooledDictionary<
BasicBlock
, BasicBlockAnalysisData> analysisDataByBasicBlockMap,
164
private static PooledDictionary<
BasicBlock
, BasicBlockAnalysisData> CreateAnalysisDataByBasicBlockMap(
167
var builder = PooledDictionary<
BasicBlock
, BasicBlockAnalysisData>.GetInstance();
168
foreach (
var
block in cfg.Blocks)
202
public BasicBlockAnalysisData GetBlockAnalysisData(
BasicBlock
basicBlock)
205
public BasicBlockAnalysisData GetOrCreateBlockAnalysisData(
BasicBlock
basicBlock, CancellationToken cancellationToken)
345
private void HandleCatchOrFilterOrFinallyInitialization(
BasicBlock
basicBlock, CancellationToken cancellationToken)
398
var
firstBasicBlockInOutermostRegion = ControlFlowGraph.Blocks[containingTryCatchFinallyRegion.FirstBlockOrdinal];
413
public void SetCurrentBlockAnalysisDataFrom(
BasicBlock
basicBlock, CancellationToken cancellationToken)
425
public void SetBlockAnalysisData(
BasicBlock
basicBlock, BasicBlockAnalysisData data)
428
public void SetBlockAnalysisDataFrom(
BasicBlock
basicBlock, BasicBlockAnalysisData data, CancellationToken cancellationToken)
Microsoft.CodeAnalysis.Test.Utilities (37)
Compilation\ControlFlowGraphVerifier.cs (18)
111
ImmutableArray<
BasicBlock
> blocks = graph.Blocks;
124
var
block = blocks[i];
194
var
predecessor = predecessorBranch.Source;
368
foreach (
var
block in blocks)
389
BasicBlock
block = blocks[i];
457
void verifyLeftRegions(
BasicBlock
block, PooledHashSet<CaptureId> longLivedIds, PooledHashSet<CaptureId> referencedIds, ArrayBuilder<ControlFlowRegion> regions, Func<string> finalGraph)
534
bool isWithStatementTargetCapture(ControlFlowRegion region,
BasicBlock
block, CaptureId id)
561
bool isConditionalXMLAccessReceiverCapture(ControlFlowRegion region,
BasicBlock
block, CaptureId id)
600
bool isSwitchTargetCapture(ControlFlowRegion region,
BasicBlock
block, CaptureId id)
643
bool isForEachEnumeratorCapture(ControlFlowRegion region,
BasicBlock
block, CaptureId id)
681
bool isAggregateGroupCapture(IOperation operation, ControlFlowRegion region,
BasicBlock
block, CaptureId id)
752
PooledHashSet<CaptureId> adjustAndGetEntryState(ArrayBuilder<PooledHashSet<CaptureId>> entryStates,
BasicBlock
block, PooledHashSet<CaptureId> state)
770
PooledHashSet<CaptureId> state, IOperation operation,
BasicBlock
block, int operationIndex,
1038
bool isConditionalAccessCaptureUsedAfterNullCheck(IOperation operation, ControlFlowRegion region,
BasicBlock
block, CaptureId id)
1323
BasicBlock
block = blocks[i];
1569
void validateBranch(
BasicBlock
fromBlock, ControlFlowBranch branch)
1646
void validateLifetimeOfReferences(
BasicBlock
block, Func<string> finalGraph)
1769
string getBlockId(
BasicBlock
block)
Compilation\FlowAnalysis\BasicBlockReachabilityDataFlowAnalyzer.cs (5)
29
public override bool AnalyzeBlock(
BasicBlock
basicBlock, CancellationToken cancellationToken)
35
public override bool AnalyzeNonConditionalBranch(
BasicBlock
basicBlock, bool currentIsReachable, CancellationToken cancellationToken)
47
BasicBlock
basicBlock,
61
public override void SetCurrentAnalysisData(
BasicBlock
basicBlock, bool isReachable, CancellationToken cancellationToken)
66
public override bool GetCurrentAnalysisData(
BasicBlock
basicBlock) => _visited[basicBlock.Ordinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (9)
39
var unreachableBlocksToVisit = ArrayBuilder<
BasicBlock
>.GetInstance();
68
ImmutableArray<
BasicBlock
> blocks,
73
ArrayBuilder<
BasicBlock
> unreachableBlocksToVisit,
81
var
firstBlock = blocks[firstBlockOrdinal];
85
var processedBlocks = PooledHashSet<
BasicBlock
>.GetInstance();
92
BasicBlock
current;
203
void FollowBranch(
BasicBlock
current, ControlFlowBranch branch, TBlockAnalysisData currentAnalsisData)
231
var
destination = branch.Destination;
389
var
entryBlock = blocks[@catch.FirstBlockOrdinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\DataFlowAnalyzer.cs (5)
21
public abstract TBlockAnalysisData GetCurrentAnalysisData(
BasicBlock
basicBlock);
31
public abstract void SetCurrentAnalysisData(
BasicBlock
basicBlock, TBlockAnalysisData data, CancellationToken cancellationToken);
36
public abstract TBlockAnalysisData AnalyzeBlock(
BasicBlock
basicBlock, CancellationToken cancellationToken);
42
public abstract TBlockAnalysisData AnalyzeNonConditionalBranch(
BasicBlock
basicBlock, TBlockAnalysisData currentAnalysisData, CancellationToken cancellationToken);
50
BasicBlock
basicBlock, TBlockAnalysisData currentAnalysisData, CancellationToken cancellationToken);
Microsoft.CodeAnalysis.Workspaces (40)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\BasicBlockExtensions.cs (1)
12
public static IEnumerable<IOperation> DescendantOperations(this
BasicBlock
basicBlock)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\ControlFlowGraphExtensions.cs (4)
13
public static
BasicBlock
EntryBlock(this ControlFlowGraph cfg)
15
var
firstBlock = cfg.Blocks[0];
20
public static
BasicBlock
ExitBlock(this ControlFlowGraph cfg)
22
var
lastBlock = cfg.Blocks.Last();
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\Extensions\OperationExtensions.cs (1)
307
foreach (
var
block in cfg.Blocks)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\CustomDataFlowAnalysis.cs (10)
39
var unreachableBlocksToVisit = ArrayBuilder<
BasicBlock
>.GetInstance();
68
ImmutableArray<
BasicBlock
> blocks,
73
ArrayBuilder<
BasicBlock
> unreachableBlocksToVisit,
81
var
firstBlock = blocks[firstBlockOrdinal];
85
var processedBlocks = PooledHashSet<
BasicBlock
>.GetInstance();
92
BasicBlock
current;
105
var
unreachableBlock = unreachableBlocksToVisit[index];
203
void FollowBranch(
BasicBlock
current, ControlFlowBranch branch, TBlockAnalysisData currentAnalsisData)
231
var
destination = branch.Destination;
389
var
entryBlock = blocks[@catch.FirstBlockOrdinal];
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\DataFlowAnalyzer.cs (5)
21
public abstract TBlockAnalysisData GetCurrentAnalysisData(
BasicBlock
basicBlock);
31
public abstract void SetCurrentAnalysisData(
BasicBlock
basicBlock, TBlockAnalysisData data, CancellationToken cancellationToken);
36
public abstract TBlockAnalysisData AnalyzeBlock(
BasicBlock
basicBlock, CancellationToken cancellationToken);
42
public abstract TBlockAnalysisData AnalyzeNonConditionalBranch(
BasicBlock
basicBlock, TBlockAnalysisData currentAnalysisData, CancellationToken cancellationToken);
50
BasicBlock
basicBlock, TBlockAnalysisData currentAnalysisData, CancellationToken cancellationToken);
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.BasicBlockAnalysisData.cs (1)
17
/// Analysis data for a particular <see cref="
BasicBlock
"/> for <see cref="ControlFlowGraph"/>
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.cs (6)
88
public override BasicBlockAnalysisData AnalyzeBlock(
BasicBlock
basicBlock, CancellationToken cancellationToken)
120
BasicBlock
basicBlock,
126
BasicBlock
basicBlock,
147
BasicBlock
basicBlock,
198
public override BasicBlockAnalysisData GetCurrentAnalysisData(
BasicBlock
basicBlock)
204
public override void SetCurrentAnalysisData(
BasicBlock
basicBlock, BasicBlockAnalysisData data, CancellationToken cancellationToken)
src\Workspaces\SharedUtilitiesAndExtensions\Compiler\Core\FlowAnalysis\SymbolUsageAnalysis\SymbolUsageAnalysis.DataFlowAnalyzer.FlowGraphAnalysisData.cs (12)
31
private readonly PooledDictionary<
BasicBlock
, BasicBlockAnalysisData> _analysisDataByBasicBlockMap;
76
PooledDictionary<
BasicBlock
, BasicBlockAnalysisData> analysisDataByBasicBlockMap,
164
private static PooledDictionary<
BasicBlock
, BasicBlockAnalysisData> CreateAnalysisDataByBasicBlockMap(
167
var builder = PooledDictionary<
BasicBlock
, BasicBlockAnalysisData>.GetInstance();
168
foreach (
var
block in cfg.Blocks)
202
public BasicBlockAnalysisData GetBlockAnalysisData(
BasicBlock
basicBlock)
205
public BasicBlockAnalysisData GetOrCreateBlockAnalysisData(
BasicBlock
basicBlock, CancellationToken cancellationToken)
345
private void HandleCatchOrFilterOrFinallyInitialization(
BasicBlock
basicBlock, CancellationToken cancellationToken)
398
var
firstBasicBlockInOutermostRegion = ControlFlowGraph.Blocks[containingTryCatchFinallyRegion.FirstBlockOrdinal];
413
public void SetCurrentBlockAnalysisDataFrom(
BasicBlock
basicBlock, CancellationToken cancellationToken)
425
public void SetBlockAnalysisData(
BasicBlock
basicBlock, BasicBlockAnalysisData data)
428
public void SetBlockAnalysisDataFrom(
BasicBlock
basicBlock, BasicBlockAnalysisData data, CancellationToken cancellationToken)