File tree Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Expand file tree Collapse file tree 2 files changed +14
-1
lines changed Original file line number Diff line number Diff line change @@ -91,8 +91,11 @@ class DeadEndBlocks {
91
91
// / the set of reachable blocks.
92
92
void updateForReachableBlock (SILBasicBlock *reachableBB);
93
93
94
+ // / Add new blocks to the set of reachable blocks.
95
+ void updateForNewBlock (SILBasicBlock *newBB);
96
+
94
97
const SILFunction *getFunction () const { return f; }
95
-
98
+
96
99
// / Performs a simple check if \p block (or its single successor) ends in an
97
100
// / "unreachable".
98
101
// /
Original file line number Diff line number Diff line change @@ -404,6 +404,16 @@ void DeadEndBlocks::updateForReachableBlock(SILBasicBlock *reachableBB) {
404
404
propagateNewlyReachableBlocks (numReachable);
405
405
}
406
406
407
+ void DeadEndBlocks::updateForNewBlock (SILBasicBlock *newBB) {
408
+ if (!didComputeValue)
409
+ return ;
410
+
411
+ assert (reachableBlocks.count (newBB) == 0 );
412
+ unsigned numReachable = reachableBlocks.size ();
413
+ reachableBlocks.insert (newBB);
414
+ propagateNewlyReachableBlocks (numReachable);
415
+ }
416
+
407
417
bool DeadEndBlocks::triviallyEndsInUnreachable (SILBasicBlock *block) {
408
418
// Handle the case where a single "unreachable" block (e.g. containing a call
409
419
// to fatalError()), is jumped to from multiple source blocks.
You can’t perform that action at this time.
0 commit comments