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 {
9191 // / the set of reachable blocks.
9292 void updateForReachableBlock (SILBasicBlock *reachableBB);
9393
94+ // / Add new blocks to the set of reachable blocks.
95+ void updateForNewBlock (SILBasicBlock *newBB);
96+
9497 const SILFunction *getFunction () const { return f; }
95-
98+
9699 // / Performs a simple check if \p block (or its single successor) ends in an
97100 // / "unreachable".
98101 // /
Original file line number Diff line number Diff line change @@ -404,6 +404,16 @@ void DeadEndBlocks::updateForReachableBlock(SILBasicBlock *reachableBB) {
404404 propagateNewlyReachableBlocks (numReachable);
405405}
406406
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+
407417bool DeadEndBlocks::triviallyEndsInUnreachable (SILBasicBlock *block) {
408418 // Handle the case where a single "unreachable" block (e.g. containing a call
409419 // to fatalError()), is jumped to from multiple source blocks.
You can’t perform that action at this time.
0 commit comments