forked from OSchip/llvm-project
Modules: Clean up ModuleFile::Imports in ModuleManager::removeModules
I don't have a testcase for this (and I'm not sure if it's an observable bug), but it seems obviously wrong that ModuleManager::removeModules is failing to clean up deleted modules from ModuleFile::Imports. See the code in ModuleManager::addModule that inserts into ModuleFile::Imports; we need the inverse operation. llvm-svn: 293399
This commit is contained in:
parent
8e6bc1979d
commit
073ec35024
|
@ -204,10 +204,10 @@ void ModuleManager::removeModules(
|
|||
return victimSet.count(MF);
|
||||
};
|
||||
// Remove any references to the now-destroyed modules.
|
||||
//
|
||||
// FIXME: this should probably clean up Imports as well.
|
||||
for (auto I = begin(); I != First; ++I)
|
||||
for (auto I = begin(); I != First; ++I) {
|
||||
I->Imports.remove_if(IsVictim);
|
||||
I->ImportedBy.remove_if(IsVictim);
|
||||
}
|
||||
Roots.erase(std::remove_if(Roots.begin(), Roots.end(), IsVictim),
|
||||
Roots.end());
|
||||
|
||||
|
|
Loading…
Reference in New Issue