[C++11] Remove a now unnecessary use of std::function for a remove_if

predicate. The wrapper used by SetVector was erroneously requiring an
adaptable predicate. It has been fixed and we really don't want to
require an indirect call for every predicate evaluation.

llvm-svn: 202744
This commit is contained in:
Chandler Carruth 2014-03-03 19:36:27 +00:00
parent 23f16b1ceb
commit b55d0226b7
1 changed files with 3 additions and 4 deletions

View File

@ -143,11 +143,10 @@ void ModuleManager::removeModules(ModuleIterator first, ModuleIterator last,
llvm::SmallPtrSet<ModuleFile *, 4> victimSet(first, last);
// Remove any references to the now-destroyed modules.
std::function<bool(ModuleFile *)> checkInSet = [&](ModuleFile *MF) {
return victimSet.count(MF);
};
for (unsigned i = 0, n = Chain.size(); i != n; ++i) {
Chain[i]->ImportedBy.remove_if(checkInSet);
Chain[i]->ImportedBy.remove_if([&](ModuleFile *MF) {
return victimSet.count(MF);
});
}
// Delete the modules and erase them from the various structures.