Skip to content

Commit 990f0ee

Browse files
committed
[NFC] BasicBlockWorklist: add ::empty.
Enable clients to check whether the worklist has anything in it without popping a block to find out.
1 parent 7c4036e commit 990f0ee

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

include/swift/SIL/BasicBlockDatastructures.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,9 @@ class BasicBlockWorklist {
8383
push(initialBlock);
8484
}
8585

86+
/// Whether there are any remaining blocks to process.
87+
bool empty() { return worklist.empty(); }
88+
8689
/// Pops the last added element from the worklist or returns null, if the
8790
/// worklist is empty.
8891
SILBasicBlock *pop() {

0 commit comments

Comments
 (0)