65 instantiations of BasicBlockBuilder
Microsoft.CodeAnalysis (65)
Operations\ControlFlowGraphBuilder.cs (65)
30private readonly BasicBlockBuilder _entry = new BasicBlockBuilder(BasicBlockKind.Entry); 31private readonly BasicBlockBuilder _exit = new BasicBlockBuilder(BasicBlockKind.Exit); 1263AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block)); 1345AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block)); 1562var afterIf = new BasicBlockBuilder(BasicBlockKind.Block); 1614var afterIf = new BasicBlockBuilder(BasicBlockKind.Block); 2349var done = new BasicBlockBuilder(BasicBlockKind.Block); 2350var checkRight = new BasicBlockBuilder(BasicBlockKind.Block); 2351var resultIsLeft = new BasicBlockBuilder(BasicBlockKind.Block); 2418var done = new BasicBlockBuilder(BasicBlockKind.Block); 2419var checkRight = new BasicBlockBuilder(BasicBlockKind.Block); 2481var done = new BasicBlockBuilder(BasicBlockKind.Block); 2482var doBitWise = new BasicBlockBuilder(BasicBlockKind.Block); 2578var done = new BasicBlockBuilder(BasicBlockKind.Block); 2579var doBitWise = new BasicBlockBuilder(BasicBlockKind.Block); 2687var labEnd = new BasicBlockBuilder(BasicBlockKind.Block); 2793dest ??= new BasicBlockBuilder(BasicBlockKind.Block); 2814BasicBlockBuilder? fallThrough = new BasicBlockBuilder(BasicBlockKind.Block); 2878var afterIf = new BasicBlockBuilder(BasicBlockKind.Block); 2897var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 2903dest ??= new BasicBlockBuilder(BasicBlockKind.Block); 2907var afterCoalesce = new BasicBlockBuilder(BasicBlockKind.Block); 2931dest ??= new BasicBlockBuilder(BasicBlockKind.Block); 2941dest ??= new BasicBlockBuilder(BasicBlockKind.Block); 3051var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 3055var afterCoalesce = new BasicBlockBuilder(BasicBlockKind.Block); 3124var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 3125var afterCoalesce = new BasicBlockBuilder(BasicBlockKind.Block); 3378var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 3447var afterAccess = new BasicBlockBuilder(BasicBlockKind.Block); 3621var start = new BasicBlockBuilder(BasicBlockKind.Block); 3693var catchBlock = new BasicBlockBuilder(BasicBlockKind.Block); 3706var continueDispatchBlock = new BasicBlockBuilder(BasicBlockKind.Block); 3766AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block)); 3768var continueDispatchBlock = new BasicBlockBuilder(BasicBlockKind.Block); 3870labeled = new BasicBlockBuilder(BasicBlockKind.Block); 3880return new BasicBlockBuilder(BasicBlockKind.Block); 3894labeledBlock = new BasicBlockBuilder(BasicBlockKind.Block); 3924AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block), linkToPrevious: false); 4085var afterTryFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4117var endOfFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4122AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block)); 4357var afterTryFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4399var endOfFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4403AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block)); 4530var afterTryFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4745BasicBlockBuilder checkConditionBlock = new BasicBlockBuilder(BasicBlockKind.Block); 4746BasicBlockBuilder bodyBlock = new BasicBlockBuilder(BasicBlockKind.Block); 4938var afterPositiveCheck = new BasicBlockBuilder(BasicBlockKind.Block); 4942var whenNotNull = new BasicBlockBuilder(BasicBlockKind.Block); 5049var notPositive = new BasicBlockBuilder(BasicBlockKind.Block); 5167var whenBothNotNull = new BasicBlockBuilder(BasicBlockKind.Block); 5188var notPositive = new BasicBlockBuilder(BasicBlockKind.Block); 5318BasicBlockBuilder afterIncrement = new BasicBlockBuilder(BasicBlockKind.Block); 5330BasicBlockBuilder whenNotNull = new BasicBlockBuilder(BasicBlockKind.Block); 5506var body = new BasicBlockBuilder(BasicBlockKind.Block); 5507var nextSection = new BasicBlockBuilder(BasicBlockKind.Block); 5522var nextCase = new BasicBlockBuilder(BasicBlockKind.Block); 5617AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block)); 5704AppendNewBlock(new BasicBlockBuilder(BasicBlockKind.Block), linkToPrevious: false); 5748var start = new BasicBlockBuilder(BasicBlockKind.Block); 5830afterInitialization = new BasicBlockBuilder(BasicBlockKind.Block); 6801resultBlock = new BasicBlockBuilder(BasicBlockKind.Block); 7745var afterSwitch = new BasicBlockBuilder(BasicBlockKind.Block); 7752var afterArm = new BasicBlockBuilder(BasicBlockKind.Block);
183 references to BasicBlockBuilder
Microsoft.CodeAnalysis (183)
Operations\ControlFlowGraphBuilder.BasicBlockBuilder.cs (13)
23private BasicBlockBuilder? _predecessor1; 24private BasicBlockBuilder? _predecessor2; 25private PooledHashSet<BasicBlockBuilder>? _predecessors; 61public void MoveStatementsFrom(BasicBlockBuilder other) 121public BasicBlockBuilder? GetSingletonPredecessorOrDefault() 143public void AddPredecessor(BasicBlockBuilder predecessor) 171_predecessors = PooledHashSet<BasicBlockBuilder>.GetInstance(); 181public void RemovePredecessor(BasicBlockBuilder predecessor) 201public void GetPredecessors(ArrayBuilder<BasicBlockBuilder> builder) 208foreach (BasicBlockBuilder predecessor in _predecessors) 245foreach (BasicBlockBuilder predecessorBlockBuilder in _predecessors) 289void addBranches(BasicBlockBuilder predecessorBlockBuilder) 319public BasicBlockBuilder? Destination { get; set; }
Operations\ControlFlowGraphBuilder.ConditionalAccessOperationTracker.cs (2)
26public readonly BasicBlockBuilder? WhenNull; 28public ConditionalAccessOperationTracker(ArrayBuilder<IOperation> operations, BasicBlockBuilder whenNull)
Operations\ControlFlowGraphBuilder.cs (163)
30private readonly BasicBlockBuilder _entry = new BasicBlockBuilder(BasicBlockKind.Entry); 31private readonly BasicBlockBuilder _exit = new BasicBlockBuilder(BasicBlockKind.Exit); 33private readonly ArrayBuilder<BasicBlockBuilder> _blocks; 34private readonly PooledDictionary<BasicBlockBuilder, RegionBuilder> _regionMap; 35private BasicBlockBuilder? _currentBasicBlock; 37private PooledDictionary<ILabelSymbol, BasicBlockBuilder>? _labeledBlocks; 63private ControlFlowGraphBuilder(Compilation compilation, CaptureIdDispenser? captureIdDispenser, ArrayBuilder<BasicBlockBuilder> blocks) 69_regionMap = PooledDictionary<BasicBlockBuilder, RegionBuilder>.GetInstance(); 113var blocks = ArrayBuilder<BasicBlockBuilder>.GetInstance(); 172private static ImmutableArray<BasicBlock> ToImmutableBlocks(ArrayBuilder<BasicBlockBuilder> blockBuilders) 177foreach (BasicBlockBuilder blockBuilder in blockBuilders) 184foreach (BasicBlockBuilder blockBuilder in blockBuilders) 192foreach (BasicBlockBuilder blockBuilder in blockBuilders) 199ControlFlowBranch? getFallThroughSuccessor(BasicBlockBuilder blockBuilder) 206ControlFlowBranch? getConditionalSuccessor(BasicBlockBuilder blockBuilder) 213ControlFlowBranch getBranch(in BasicBlockBuilder.Branch branch, BasicBlockBuilder source, bool isConditionalSuccessor) 223private static void MarkReachableBlocks(ArrayBuilder<BasicBlockBuilder> blocks) 240ArrayBuilder<BasicBlockBuilder> blocks, 243ArrayBuilder<BasicBlockBuilder>? outOfRangeBlocksToVisit, 249var toVisit = ArrayBuilder<BasicBlockBuilder>.GetInstance(); 256BasicBlockBuilder current = toVisit.Pop(); 292BasicBlockBuilder.Branch branch = current.FallThrough; 313void followBranch(BasicBlockBuilder current, in BasicBlockBuilder.Branch branch) 344bool stepThroughFinally(ControlFlowRegion region, BasicBlockBuilder destination) 476BasicBlockBuilder entryBlock = blocks[@catch.FirstBlockOrdinal]; 494private static void Pack(ArrayBuilder<BasicBlockBuilder> blocks, RegionBuilder root, PooledDictionary<BasicBlockBuilder, RegionBuilder> regionMap) 511private static bool PackRegions(RegionBuilder root, ArrayBuilder<BasicBlockBuilder> blocks, PooledDictionary<BasicBlockBuilder, RegionBuilder> regionMap) 577BasicBlockBuilder block = subRegion.FirstBlock; 614private static void MergeSubRegionAndFree(RegionBuilder subRegion, ArrayBuilder<BasicBlockBuilder> blocks, PooledDictionary<BasicBlockBuilder, RegionBuilder> regionMap, bool canHaveEmptyRegion = false) 670private static bool PackBlocks(ArrayBuilder<BasicBlockBuilder> blocks, PooledDictionary<BasicBlockBuilder, RegionBuilder> regionMap) 675ArrayBuilder<BasicBlockBuilder>? predecessorsBuilder = null; 690BasicBlockBuilder block = blocks[i]; 696BasicBlockBuilder? predecessor = block.GetSingletonPredecessorOrDefault(); 716ref BasicBlockBuilder.Branch next = ref block.FallThrough; 803BasicBlockBuilder? predecessor = block.GetSingletonPredecessorOrDefault(); 869BasicBlockBuilder? predecessor = block.GetSingletonPredecessorOrDefault(); 893predecessorsBuilder = ArrayBuilder<BasicBlockBuilder>.GetInstance(); 915foreach (BasicBlockBuilder predecessor in predecessorsBuilder) 956BasicBlockBuilder? predecessor = block.GetSingletonPredecessorOrDefault(); 986BasicBlockBuilder? destination = block.Conditional.Destination; 1014RegionBuilder? tryGetImplicitEntryRegion(BasicBlockBuilder block, [DisallowNull] RegionBuilder? currentRegion) 1038void removeBlock(BasicBlockBuilder block, RegionBuilder region) 1048BasicBlockBuilder newFirst = blocks[block.Ordinal + 1]; 1061BasicBlockBuilder newLast = blocks[block.Ordinal - 1]; 1082bool tryMergeBranch(BasicBlockBuilder predecessor, ref BasicBlockBuilder.Branch predecessorBranch, BasicBlockBuilder successor) 1093void mergeBranch(BasicBlockBuilder predecessor, ref BasicBlockBuilder.Branch predecessorBranch, ref BasicBlockBuilder.Branch successorBranch) 1101bool checkBranchesFromPredecessors(ArrayBuilder<BasicBlockBuilder> predecessors, RegionBuilder currentRegion, RegionBuilder? destinationRegionOpt) 1103foreach (BasicBlockBuilder predecessor in predecessors) 1186private static void CheckUnresolvedBranches(ArrayBuilder<BasicBlockBuilder> blocks, PooledDictionary<ILabelSymbol, BasicBlockBuilder>? labeledBlocks) 1193PooledHashSet<BasicBlockBuilder>? unresolved = null; 1194foreach (BasicBlockBuilder labeled in labeledBlocks.Values) 1200unresolved = PooledHashSet<BasicBlockBuilder>.GetInstance(); 1213foreach (BasicBlockBuilder block in blocks) 1222void fixupBranch(ref BasicBlockBuilder.Branch branch) 1257private BasicBlockBuilder CurrentBasicBlock 1295private void AppendNewBlock(BasicBlockBuilder block, bool linkToPrevious = true) 1302BasicBlockBuilder prevBlock = _blocks.Last(); 1368private static void LinkBlocks(BasicBlockBuilder prevBlock, BasicBlockBuilder nextBlock, ControlFlowBranchSemantics branchKind = ControlFlowBranchSemantics.Regular) 1377private void UnconditionalBranch(BasicBlockBuilder nextBlock) 1562var afterIf = new BasicBlockBuilder(BasicBlockKind.Block); 1566BasicBlockBuilder? whenFalse = null; 1611BasicBlockBuilder? whenFalse = null; 1614var afterIf = new BasicBlockBuilder(BasicBlockKind.Block); 2286BasicBlockBuilder? fallToTrueOpt, BasicBlockBuilder? fallToFalseOpt) 2349var done = new BasicBlockBuilder(BasicBlockKind.Block); 2350var checkRight = new BasicBlockBuilder(BasicBlockKind.Block); 2351var resultIsLeft = new BasicBlockBuilder(BasicBlockKind.Block); 2418var done = new BasicBlockBuilder(BasicBlockKind.Block); 2419var checkRight = new BasicBlockBuilder(BasicBlockKind.Block); 2481var done = new BasicBlockBuilder(BasicBlockKind.Block); 2482var doBitWise = new BasicBlockBuilder(BasicBlockKind.Block); 2578var done = new BasicBlockBuilder(BasicBlockKind.Block); 2579var doBitWise = new BasicBlockBuilder(BasicBlockKind.Block); 2652int? captureIdForResult, BasicBlockBuilder? fallToTrueOpt, BasicBlockBuilder? fallToFalseOpt) 2671ref BasicBlockBuilder? lazyFallThrough = ref stopValue ? ref fallToTrueOpt : ref fallToFalseOpt; 2687var labEnd = new BasicBlockBuilder(BasicBlockKind.Block); 2702private IOperation VisitConditionalExpression(IOperation condition, bool sense, int? captureIdForResult, BasicBlockBuilder? fallToTrueOpt, BasicBlockBuilder? fallToFalseOpt) 2758private void VisitConditionalBranch(IOperation condition, [NotNull] ref BasicBlockBuilder? dest, bool jumpIfTrue) 2773private void VisitConditionalBranchCore(IOperation condition, [NotNull] ref BasicBlockBuilder? dest, bool jumpIfTrue) 2780void visitConditionalBranchCore(IOperation condition, [NotNull] ref BasicBlockBuilder? dest, bool jumpIfTrue) 2794var stack = ArrayBuilder<(IOperation? condition, BasicBlockBuilder dest, bool jumpIfTrue)>.GetInstance(); 2799(IOperation? condition, BasicBlockBuilder dest, bool jumpIfTrue) top = stack.Pop(); 2814BasicBlockBuilder? fallThrough = new BasicBlockBuilder(BasicBlockKind.Block); 2874BasicBlockBuilder? whenFalse = null; 2878var afterIf = new BasicBlockBuilder(BasicBlockKind.Block); 2897var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 2907var afterCoalesce = new BasicBlockBuilder(BasicBlockKind.Block); 2962private void ConditionalBranch(IOperation condition, bool jumpIfTrue, BasicBlockBuilder destination) 2964BasicBlockBuilder previous = CurrentBasicBlock; 2965BasicBlockBuilder.Branch branch = RegularBranch(destination); 2981private IOperation NullCheckAndConvertCoalesceValue(ICoalesceOperation operation, BasicBlockBuilder whenNull) 3051var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 3055var afterCoalesce = new BasicBlockBuilder(BasicBlockKind.Block); 3124var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 3125var afterCoalesce = new BasicBlockBuilder(BasicBlockKind.Block); 3283private static BasicBlockBuilder.Branch RegularBranch(BasicBlockBuilder destination) 3285return new BasicBlockBuilder.Branch() { Destination = destination, Kind = ControlFlowBranchSemantics.Regular }; 3378var whenNull = new BasicBlockBuilder(BasicBlockKind.Block); 3447var afterAccess = new BasicBlockBuilder(BasicBlockKind.Block); 3578var @continue = GetLabeledOrNewBlock(operation.ContinueLabel); 3579var @break = GetLabeledOrNewBlock(operation.ExitLabel); 3621var start = new BasicBlockBuilder(BasicBlockKind.Block); 3650var afterTryCatchFinally = GetLabeledOrNewBlock(operation.ExitLabel); 3693var catchBlock = new BasicBlockBuilder(BasicBlockKind.Block); 3706var continueDispatchBlock = new BasicBlockBuilder(BasicBlockKind.Block); 3741var predecessors = ArrayBuilder<BasicBlockBuilder>.GetInstance(); 3768var continueDispatchBlock = new BasicBlockBuilder(BasicBlockKind.Block); 3840BasicBlockBuilder current = CurrentBasicBlock; 3865BasicBlockBuilder labeled = GetLabeledOrNewBlock(operation); 3876private BasicBlockBuilder GetLabeledOrNewBlock(ILabelSymbol? labelOpt) 3883BasicBlockBuilder? labeledBlock; 3887_labeledBlocks = PooledDictionary<ILabelSymbol, BasicBlockBuilder>.GetInstance(); 3938BasicBlockBuilder current = CurrentBasicBlock; 4085var afterTryFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4117var endOfFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4357var afterTryFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4399var endOfFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4503var @continue = GetLabeledOrNewBlock(operation.ContinueLabel); 4504var @break = GetLabeledOrNewBlock(operation.ExitLabel); 4530var afterTryFinally = new BasicBlockBuilder(BasicBlockKind.Block); 4743BasicBlockBuilder @continue = GetLabeledOrNewBlock(operation.ContinueLabel); 4744BasicBlockBuilder? @break = GetLabeledOrNewBlock(operation.ExitLabel); 4745BasicBlockBuilder checkConditionBlock = new BasicBlockBuilder(BasicBlockKind.Block); 4746BasicBlockBuilder bodyBlock = new BasicBlockBuilder(BasicBlockKind.Block); 4938var afterPositiveCheck = new BasicBlockBuilder(BasicBlockKind.Block); 4942var whenNotNull = new BasicBlockBuilder(BasicBlockKind.Block); 5049var notPositive = new BasicBlockBuilder(BasicBlockKind.Block); 5167var whenBothNotNull = new BasicBlockBuilder(BasicBlockKind.Block); 5188var notPositive = new BasicBlockBuilder(BasicBlockKind.Block); 5318BasicBlockBuilder afterIncrement = new BasicBlockBuilder(BasicBlockKind.Block); 5330BasicBlockBuilder whenNotNull = new BasicBlockBuilder(BasicBlockKind.Block); 5473BasicBlockBuilder? defaultBody = null; // Adjusted in handleSection 5474BasicBlockBuilder @break = GetLabeledOrNewBlock(operation.ExitLabel); 5506var body = new BasicBlockBuilder(BasicBlockKind.Block); 5507var nextSection = new BasicBlockBuilder(BasicBlockKind.Block); 5522var nextCase = new BasicBlockBuilder(BasicBlockKind.Block); 5539void handleCase(ICaseClauseOperation caseClause, BasicBlockBuilder body, [DisallowNull] BasicBlockBuilder? nextCase) 5542BasicBlockBuilder labeled = GetLabeledOrNewBlock(caseClause.Label); 5703BasicBlockBuilder current = CurrentBasicBlock; 5748var start = new BasicBlockBuilder(BasicBlockKind.Block); 5753var @break = GetLabeledOrNewBlock(operation.ExitLabel); 5761var @continue = GetLabeledOrNewBlock(operation.ContinueLabel); 5827BasicBlockBuilder? afterInitialization = null; 6798BasicBlockBuilder? resultBlock = null; 7745var afterSwitch = new BasicBlockBuilder(BasicBlockKind.Block); 7752var afterArm = new BasicBlockBuilder(BasicBlockKind.Block);
Operations\ControlFlowGraphBuilder.RegionBuilder.cs (5)
20public BasicBlockBuilder? FirstBlock = null; 21public BasicBlockBuilder? LastBlock = null; 248public void ExtendToInclude(BasicBlockBuilder block) 296public ControlFlowRegion ToImmutableRegionAndFree(ArrayBuilder<BasicBlockBuilder> blocks, 375void setRegion(BasicBlockBuilder block)