Skip to content

Commit fad35bb

Browse files
committed
[NFC] Adopted InstructionSetVector.
Replaced a useage of SmallSetVector.
1 parent d72ebe8 commit fad35bb

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

lib/SILOptimizer/Utils/CanonicalOSSALifetime.cpp

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454

5555
#include "swift/SILOptimizer/Utils/CanonicalOSSALifetime.h"
5656
#include "swift/SIL/InstructionUtils.h"
57+
#include "swift/SIL/NodeDatastructures.h"
5758
#include "swift/SIL/OwnershipUtils.h"
5859
#include "swift/SILOptimizer/Utils/CFGOptUtils.h"
5960
#include "swift/SILOptimizer/Utils/DebugOptUtils.h"
@@ -609,7 +610,7 @@ void CanonicalizeOSSALifetime::findOrInsertDestroys() {
609610
void CanonicalizeOSSALifetime::rewriteCopies() {
610611
assert(getCurrentDef()->getOwnershipKind() == OwnershipKind::Owned);
611612

612-
SmallSetVector<SILInstruction *, 8> instsToDelete;
613+
InstructionSetVector instsToDelete(getCurrentDef()->getFunction());
613614
defUseWorklist.clear();
614615

615616
// Visit each operand in the def-use chain.
@@ -707,8 +708,9 @@ void CanonicalizeOSSALifetime::rewriteCopies() {
707708
}
708709

709710
// Remove the leftover copy_value and destroy_value instructions.
710-
for (unsigned idx = 0, eidx = instsToDelete.size(); idx != eidx; ++idx) {
711-
deleter.forceDelete(instsToDelete[idx]);
711+
for (auto iter = instsToDelete.begin(), end = instsToDelete.end();
712+
iter != end; ++iter) {
713+
deleter.forceDelete(*iter);
712714
}
713715
}
714716

0 commit comments

Comments
 (0)