1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2024-11-22 10:42:39 +01:00

[llvm-objdump] Use append_range (NFC)

This commit is contained in:
Kazu Hirata 2021-01-26 20:00:19 -08:00
parent 8f3f48c295
commit 923c60906b
3 changed files with 7 additions and 14 deletions

View File

@ -454,8 +454,7 @@ static bool getPDataSection(const COFFObjectFile *Obj,
continue;
const coff_section *Pdata = Obj->getCOFFSection(Section);
for (const RelocationRef &Reloc : Section.relocations())
Rels.push_back(Reloc);
append_range(Rels, Section.relocations());
// Sort relocations by address.
llvm::sort(Rels, isRelocAddressLess);

View File

@ -362,8 +362,7 @@ static void getSectionsAndSymbols(MachOObjectFile *MachOObj,
Symbols.push_back(Symbol);
}
for (const SectionRef &Section : MachOObj->sections())
Sections.push_back(Section);
append_range(Sections, MachOObj->sections());
bool BaseSegmentAddressSet = false;
for (const auto &Command : MachOObj->load_commands()) {
@ -6115,8 +6114,7 @@ static void printObjc2_64bit_MetaData(MachOObjectFile *O, bool verbose) {
CreateSymbolAddressMap(O, &AddrMap);
std::vector<SectionRef> Sections;
for (const SectionRef &Section : O->sections())
Sections.push_back(Section);
append_range(Sections, O->sections());
struct DisassembleInfo info(O, &AddrMap, &Sections, verbose);
@ -6197,8 +6195,7 @@ static void printObjc2_32bit_MetaData(MachOObjectFile *O, bool verbose) {
CreateSymbolAddressMap(O, &AddrMap);
std::vector<SectionRef> Sections;
for (const SectionRef &Section : O->sections())
Sections.push_back(Section);
append_range(Sections, O->sections());
struct DisassembleInfo info(O, &AddrMap, &Sections, verbose);
@ -6292,8 +6289,7 @@ static bool printObjc1_32bit_MetaData(MachOObjectFile *O, bool verbose) {
CreateSymbolAddressMap(O, &AddrMap);
std::vector<SectionRef> Sections;
for (const SectionRef &Section : O->sections())
Sections.push_back(Section);
append_range(Sections, O->sections());
struct DisassembleInfo info(O, &AddrMap, &Sections, verbose);
@ -6450,8 +6446,7 @@ static void DumpProtocolSection(MachOObjectFile *O, const char *sect,
CreateSymbolAddressMap(O, &AddrMap);
std::vector<SectionRef> Sections;
for (const SectionRef &Section : O->sections())
Sections.push_back(Section);
append_range(Sections, O->sections());
struct DisassembleInfo info(O, &AddrMap, &Sections, true);

View File

@ -1479,8 +1479,7 @@ getRelocsMap(object::ObjectFile const &Obj) {
if (Relocated == Obj.section_end() || !checkSectionFilter(*Relocated).Keep)
continue;
std::vector<RelocationRef> &V = Ret[*Relocated];
for (const RelocationRef &R : Sec.relocations())
V.push_back(R);
append_range(V, Sec.relocations());
// Sort relocations by address.
llvm::stable_sort(V, isRelocAddressLess);
}