Skip to content

Commit 48bdd67

Browse files
[llvm-objdump] Use append_range (NFC)
1 parent 657f5b9 commit 48bdd67

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

llvm/tools/llvm-objdump/COFFDump.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -454,8 +454,7 @@ static bool getPDataSection(const COFFObjectFile *Obj,
454454
continue;
455455

456456
const coff_section *Pdata = Obj->getCOFFSection(Section);
457-
for (const RelocationRef &Reloc : Section.relocations())
458-
Rels.push_back(Reloc);
457+
append_range(Rels, Section.relocations());
459458

460459
// Sort relocations by address.
461460
llvm::sort(Rels, isRelocAddressLess);

llvm/tools/llvm-objdump/MachODump.cpp

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -362,8 +362,7 @@ static void getSectionsAndSymbols(MachOObjectFile *MachOObj,
362362
Symbols.push_back(Symbol);
363363
}
364364

365-
for (const SectionRef &Section : MachOObj->sections())
366-
Sections.push_back(Section);
365+
append_range(Sections, MachOObj->sections());
367366

368367
bool BaseSegmentAddressSet = false;
369368
for (const auto &Command : MachOObj->load_commands()) {
@@ -6115,8 +6114,7 @@ static void printObjc2_64bit_MetaData(MachOObjectFile *O, bool verbose) {
61156114
CreateSymbolAddressMap(O, &AddrMap);
61166115

61176116
std::vector<SectionRef> Sections;
6118-
for (const SectionRef &Section : O->sections())
6119-
Sections.push_back(Section);
6117+
append_range(Sections, O->sections());
61206118

61216119
struct DisassembleInfo info(O, &AddrMap, &Sections, verbose);
61226120

@@ -6197,8 +6195,7 @@ static void printObjc2_32bit_MetaData(MachOObjectFile *O, bool verbose) {
61976195
CreateSymbolAddressMap(O, &AddrMap);
61986196

61996197
std::vector<SectionRef> Sections;
6200-
for (const SectionRef &Section : O->sections())
6201-
Sections.push_back(Section);
6198+
append_range(Sections, O->sections());
62026199

62036200
struct DisassembleInfo info(O, &AddrMap, &Sections, verbose);
62046201

@@ -6292,8 +6289,7 @@ static bool printObjc1_32bit_MetaData(MachOObjectFile *O, bool verbose) {
62926289
CreateSymbolAddressMap(O, &AddrMap);
62936290

62946291
std::vector<SectionRef> Sections;
6295-
for (const SectionRef &Section : O->sections())
6296-
Sections.push_back(Section);
6292+
append_range(Sections, O->sections());
62976293

62986294
struct DisassembleInfo info(O, &AddrMap, &Sections, verbose);
62996295

@@ -6450,8 +6446,7 @@ static void DumpProtocolSection(MachOObjectFile *O, const char *sect,
64506446
CreateSymbolAddressMap(O, &AddrMap);
64516447

64526448
std::vector<SectionRef> Sections;
6453-
for (const SectionRef &Section : O->sections())
6454-
Sections.push_back(Section);
6449+
append_range(Sections, O->sections());
64556450

64566451
struct DisassembleInfo info(O, &AddrMap, &Sections, true);
64576452

llvm/tools/llvm-objdump/llvm-objdump.cpp

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1479,8 +1479,7 @@ getRelocsMap(object::ObjectFile const &Obj) {
14791479
if (Relocated == Obj.section_end() || !checkSectionFilter(*Relocated).Keep)
14801480
continue;
14811481
std::vector<RelocationRef> &V = Ret[*Relocated];
1482-
for (const RelocationRef &R : Sec.relocations())
1483-
V.push_back(R);
1482+
append_range(V, Sec.relocations());
14841483
// Sort relocations by address.
14851484
llvm::stable_sort(V, isRelocAddressLess);
14861485
}

0 commit comments

Comments
 (0)