From 5b645797db05926bffdd6214e94a527267445cc9 Mon Sep 17 00:00:00 2001 From: Alexey Samsonov Date: Tue, 18 Mar 2014 06:53:02 +0000 Subject: [C++11] Change the interface of getCOFF{Section,Relocation,Symbol} to make it work with range-based for loops. Reviewers: ruiu Reviewed By: ruiu CC: llvm-commits Differential Revision: http://llvm-reviews.chandlerc.com/D3097 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@204120 91177308-0d34-0410-b5e6-96231b3b80d8 --- tools/llvm-objdump/COFFDump.cpp | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'tools/llvm-objdump') diff --git a/tools/llvm-objdump/COFFDump.cpp b/tools/llvm-objdump/COFFDump.cpp index e2d65a4817..49f27553c1 100644 --- a/tools/llvm-objdump/COFFDump.cpp +++ b/tools/llvm-objdump/COFFDump.cpp @@ -166,7 +166,7 @@ static error_code resolveSectionAndAddress(const COFFObjectFile *Obj, section_iterator iter(Obj->section_begin()); if (error_code EC = Sym.getSection(iter)) return EC; - ResolvedSection = Obj->getCOFFSection(iter); + ResolvedSection = Obj->getCOFFSection(*iter); return object_error::success; } @@ -381,16 +381,15 @@ static void printExportTable(const COFFObjectFile *Obj) { static bool getPDataSection(const COFFObjectFile *Obj, std::vector &Rels, const RuntimeFunction *&RFStart, int &NumRFs) { - for (section_iterator SI = Obj->section_begin(), SE = Obj->section_end(); - SI != SE; ++SI) { + for (const SectionRef &Section : Obj->sections()) { StringRef Name; - if (error(SI->getName(Name))) + if (error(Section.getName(Name))) continue; if (Name != ".pdata") continue; - const coff_section *Pdata = Obj->getCOFFSection(SI); - for (const RelocationRef &Reloc : SI->relocations()) + const coff_section *Pdata = Obj->getCOFFSection(Section); + for (const RelocationRef &Reloc : Section.relocations()) Rels.push_back(Reloc); // Sort relocations by address. -- cgit v1.2.3