summaryrefslogtreecommitdiffstats
path: root/llvm/tools/llvm-objcopy/MachO/Object.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/tools/llvm-objcopy/MachO/Object.cpp')
-rw-r--r--llvm/tools/llvm-objcopy/MachO/Object.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/llvm/tools/llvm-objcopy/MachO/Object.cpp b/llvm/tools/llvm-objcopy/MachO/Object.cpp
index 264f39c28ed..ba3e2ef8ba4 100644
--- a/llvm/tools/llvm-objcopy/MachO/Object.cpp
+++ b/llvm/tools/llvm-objcopy/MachO/Object.cpp
@@ -10,6 +10,13 @@ const SymbolEntry *SymbolTable::getSymbolByIndex(uint32_t Index) const {
return Symbols[Index].get();
}
+void Object::removeSections(function_ref<bool(const Section &)> ToRemove) {
+ for (LoadCommand &LC : LoadCommands)
+ LC.Sections.erase(std::remove_if(std::begin(LC.Sections),
+ std::end(LC.Sections), ToRemove),
+ std::end(LC.Sections));
+}
+
} // end namespace macho
} // end namespace objcopy
} // end namespace llvm
OpenPOWER on IntegriCloud