diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-03-18 06:53:02 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-03-18 06:53:02 +0000 |
commit | 27dc839406ae7b25e91ab1dafa1b06d1b9d0a6ee (patch) | |
tree | 6483b683d79e060efa7312aefa39fed4f0cfdf9b /llvm/tools/llvm-objdump | |
parent | eac8cc7a42c5469a9af154b10f0fc19e57744656 (diff) | |
download | bcm5719-llvm-27dc839406ae7b25e91ab1dafa1b06d1b9d0a6ee.tar.gz bcm5719-llvm-27dc839406ae7b25e91ab1dafa1b06d1b9d0a6ee.zip |
[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
llvm-svn: 204120
Diffstat (limited to 'llvm/tools/llvm-objdump')
-rw-r--r-- | llvm/tools/llvm-objdump/COFFDump.cpp | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/llvm/tools/llvm-objdump/COFFDump.cpp b/llvm/tools/llvm-objdump/COFFDump.cpp index e2d65a48177..49f27553c13 100644 --- a/llvm/tools/llvm-objdump/COFFDump.cpp +++ b/llvm/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. |