summaryrefslogtreecommitdiff
path: root/tools/llvm-objdump
diff options
context:
space:
mode:
authorAlexey Samsonov <samsonov@google.com>2014-03-18 06:53:02 +0000
committerAlexey Samsonov <samsonov@google.com>2014-03-18 06:53:02 +0000
commit5b645797db05926bffdd6214e94a527267445cc9 (patch)
tree654d72ff2ee5049fd99780d13934c64cb1bd76bf /tools/llvm-objdump
parent3bdef4b6dc8098d86c74c445c8478c28598a3a05 (diff)
downloadllvm-5b645797db05926bffdd6214e94a527267445cc9.tar.gz
llvm-5b645797db05926bffdd6214e94a527267445cc9.tar.bz2
llvm-5b645797db05926bffdd6214e94a527267445cc9.tar.xz
[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
Diffstat (limited to 'tools/llvm-objdump')
-rw-r--r--tools/llvm-objdump/COFFDump.cpp11
1 files changed, 5 insertions, 6 deletions
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<RelocationRef> &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.