|
31 | 31 | #include "swift/SIL/InstructionUtils.h"
|
32 | 32 | #include "swift/SIL/MemAccessUtils.h"
|
33 | 33 | #include "swift/SIL/PrettyStackTrace.h"
|
| 34 | +#include "swift/SIL/SILBitfield.h" |
34 | 35 | #include "swift/SIL/SILDebugScope.h"
|
35 | 36 | #include "swift/SIL/SILDeclRef.h"
|
36 | 37 | #include "swift/SIL/SILLinkage.h"
|
@@ -2007,7 +2008,7 @@ void IRGenSILFunction::emitSILFunction() {
|
2007 | 2008 |
|
2008 | 2009 | // Invariant: for every block in the work queue, we have visited all
|
2009 | 2010 | // of its dominators.
|
2010 |
| - llvm::SmallPtrSet<SILBasicBlock*, 8> visitedBlocks; |
| 2011 | + BasicBlockSet visitedBlocks(CurSILFn); |
2011 | 2012 | SmallVector<SILBasicBlock*, 8> workQueue; // really a stack
|
2012 | 2013 |
|
2013 | 2014 | // Queue up the entry block, for which the invariant trivially holds.
|
@@ -2042,15 +2043,15 @@ void IRGenSILFunction::emitSILFunction() {
|
2042 | 2043 | // Therefore the invariant holds of all the successors, and we can
|
2043 | 2044 | // queue them up if we haven't already visited them.
|
2044 | 2045 | for (auto *succBB : bb->getSuccessorBlocks()) {
|
2045 |
| - if (visitedBlocks.insert(succBB).second) |
| 2046 | + if (visitedBlocks.insert(succBB)) |
2046 | 2047 | workQueue.push_back(succBB);
|
2047 | 2048 | }
|
2048 | 2049 | }
|
2049 | 2050 |
|
2050 | 2051 | // If there are dead blocks in the SIL function, we might have left
|
2051 | 2052 | // invalid blocks in the IR. Do another pass and kill them off.
|
2052 | 2053 | for (SILBasicBlock &bb : *CurSILFn)
|
2053 |
| - if (!visitedBlocks.count(&bb)) |
| 2054 | + if (!visitedBlocks.contains(&bb)) |
2054 | 2055 | LoweredBBs[&bb].bb->eraseFromParent();
|
2055 | 2056 |
|
2056 | 2057 | }
|
|
0 commit comments