Skip to content

Commit 83117a9

Browse files
committed
[NFC] ReachableBlocks: Use StackList.
Replace a SmallVector.
1 parent 0f4f42f commit 83117a9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

lib/SILOptimizer/Utils/BasicBlockOptUtils.cpp

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -10,13 +10,14 @@
1010
//
1111
//===----------------------------------------------------------------------===//
1212

13-
#include "swift/Basic/Assertions.h"
1413
#include "swift/SILOptimizer/Utils/BasicBlockOptUtils.h"
14+
#include "swift/Basic/Assertions.h"
15+
#include "swift/SIL/LoopInfo.h"
16+
#include "swift/SIL/StackList.h"
1517
#include "swift/SILOptimizer/Utils/CFGOptUtils.h"
1618
#include "swift/SILOptimizer/Utils/InstOptUtils.h"
1719
#include "swift/SILOptimizer/Utils/OwnershipOptUtils.h"
1820
#include "swift/SILOptimizer/Utils/SILSSAUpdater.h"
19-
#include "swift/SIL/LoopInfo.h"
2021

2122
using namespace swift;
2223

@@ -25,9 +26,8 @@ using namespace swift;
2526
bool ReachableBlocks::visit(function_ref<bool(SILBasicBlock *)> visitor) {
2627
// Walk over the CFG, starting at the entry block, until all reachable blocks
2728
// are visited.
28-
SILBasicBlock *entryBB = visited.getFunction()->getEntryBlock();
29-
SmallVector<SILBasicBlock *, 8> worklist = {entryBB};
30-
visited.insert(entryBB);
29+
StackList<SILBasicBlock *> worklist(visited.getFunction());
30+
visited.insert(visited.getFunction()->getEntryBlock());
3131
while (!worklist.empty()) {
3232
SILBasicBlock *bb = worklist.pop_back_val();
3333
if (!visitor(bb))

0 commit comments

Comments
 (0)