File tree Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Expand file tree Collapse file tree 2 files changed +7
-7
lines changed Original file line number Diff line number Diff line change @@ -217,7 +217,7 @@ class SILModule {
217
217
// / This avoids dangling instruction pointers within the run of a pass and in
218
218
// / analysis caches. Note that the analysis invalidation mechanism ensures
219
219
// / that analysis caches are invalidated before flushDeletedInsts().
220
- llvm::iplist <SILInstruction> scheduledForDeletion;
220
+ std::vector <SILInstruction* > scheduledForDeletion;
221
221
222
222
// / The swift Module associated with this SILModule.
223
223
ModuleDecl *TheSwiftModule;
Original file line number Diff line number Diff line change @@ -164,8 +164,8 @@ void SILModule::checkForLeaks() const {
164
164
if (!getOptions ().checkSILModuleLeaks )
165
165
return ;
166
166
167
- int instsInModule = std::distance ( scheduledForDeletion.begin (),
168
- scheduledForDeletion. end ());
167
+ int instsInModule = scheduledForDeletion.size ();
168
+
169
169
for (const SILFunction &F : *this ) {
170
170
const SILFunction *sn = &F;
171
171
do {
@@ -280,11 +280,11 @@ void SILModule::scheduleForDeletion(SILInstruction *I) {
280
280
}
281
281
282
282
void SILModule::flushDeletedInsts () {
283
- while (!scheduledForDeletion.empty ()) {
284
- SILInstruction *inst = &*scheduledForDeletion.begin ();
285
- scheduledForDeletion.erase (inst);
286
- AlignedFree (inst);
283
+ for (SILInstruction *instToDelete : scheduledForDeletion) {
284
+ SILInstruction::destroy (instToDelete);
285
+ AlignedFree (instToDelete);
287
286
}
287
+ scheduledForDeletion.clear ();
288
288
}
289
289
290
290
SILWitnessTable *
You can’t perform that action at this time.
0 commit comments