summaryrefslogtreecommitdiff
path: root/lib/Serialization/ModuleManager.cpp
diff options
context:
space:
mode:
authorChandler Carruth <chandlerc@gmail.com>2014-03-03 19:36:27 +0000
committerChandler Carruth <chandlerc@gmail.com>2014-03-03 19:36:27 +0000
commit50744c2e4370e5619e22834d67976c13a9f3b172 (patch)
tree29cd977e91ce1fb5e4ae8fe3e84099f25ac92fb7 /lib/Serialization/ModuleManager.cpp
parentc0e55cd4046e21786ba92a6f676aa42d41496dd5 (diff)
downloadclang-50744c2e4370e5619e22834d67976c13a9f3b172.tar.gz
clang-50744c2e4370e5619e22834d67976c13a9f3b172.tar.bz2
clang-50744c2e4370e5619e22834d67976c13a9f3b172.tar.xz
[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. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@202744 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Serialization/ModuleManager.cpp')
-rw-r--r--lib/Serialization/ModuleManager.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/Serialization/ModuleManager.cpp b/lib/Serialization/ModuleManager.cpp
index 201f8fadea..3513eba860 100644
--- a/lib/Serialization/ModuleManager.cpp
+++ b/lib/Serialization/ModuleManager.cpp
@@ -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.