Seiya Nuta | f923d9b | 2019-06-21 00:21:50 +0000 | [diff] [blame] | 1 | #include "Object.h" |
| 2 | #include "../llvm-objcopy.h" |
| 3 | |
| 4 | namespace llvm { |
| 5 | namespace objcopy { |
| 6 | namespace macho { |
| 7 | |
| 8 | const SymbolEntry *SymbolTable::getSymbolByIndex(uint32_t Index) const { |
| 9 | assert(Index < Symbols.size() && "invalid symbol index"); |
| 10 | return Symbols[Index].get(); |
| 11 | } |
| 12 | |
Seiya Nuta | 7f19dd1 | 2019-10-28 15:40:37 +0900 | [diff] [blame] | 13 | void Object::removeSections(function_ref<bool(const Section &)> ToRemove) { |
| 14 | for (LoadCommand &LC : LoadCommands) |
| 15 | LC.Sections.erase(std::remove_if(std::begin(LC.Sections), |
| 16 | std::end(LC.Sections), ToRemove), |
| 17 | std::end(LC.Sections)); |
| 18 | } |
| 19 | |
Seiya Nuta | f923d9b | 2019-06-21 00:21:50 +0000 | [diff] [blame] | 20 | } // end namespace macho |
| 21 | } // end namespace objcopy |
| 22 | } // end namespace llvm |