mirror of
https://github.com/apple/swift.git
synced 2025-12-14 20:36:38 +01:00
SIL: change SILModule's scheduledForDeletion from a double linked list to a std::vector
This commit is contained in:
@@ -164,8 +164,8 @@ void SILModule::checkForLeaks() const {
|
||||
if (!getOptions().checkSILModuleLeaks)
|
||||
return;
|
||||
|
||||
int instsInModule = std::distance(scheduledForDeletion.begin(),
|
||||
scheduledForDeletion.end());
|
||||
int instsInModule = scheduledForDeletion.size();
|
||||
|
||||
for (const SILFunction &F : *this) {
|
||||
const SILFunction *sn = &F;
|
||||
do {
|
||||
@@ -280,11 +280,11 @@ void SILModule::scheduleForDeletion(SILInstruction *I) {
|
||||
}
|
||||
|
||||
void SILModule::flushDeletedInsts() {
|
||||
while (!scheduledForDeletion.empty()) {
|
||||
SILInstruction *inst = &*scheduledForDeletion.begin();
|
||||
scheduledForDeletion.erase(inst);
|
||||
AlignedFree(inst);
|
||||
for (SILInstruction *instToDelete : scheduledForDeletion) {
|
||||
SILInstruction::destroy(instToDelete);
|
||||
AlignedFree(instToDelete);
|
||||
}
|
||||
scheduledForDeletion.clear();
|
||||
}
|
||||
|
||||
SILWitnessTable *
|
||||
|
||||
Reference in New Issue
Block a user