diff options
author | Alexey Samsonov <samsonov@google.com> | 2014-03-14 14:22:49 +0000 |
---|---|---|
committer | Alexey Samsonov <samsonov@google.com> | 2014-03-14 14:22:49 +0000 |
commit | aa4d29571c832c1fc706f047e3ee099a133b179b (patch) | |
tree | 5c24ba4009faa1bd85f515783fc3861abadc7522 /llvm/tools/llvm-objdump/MachODump.cpp | |
parent | 68627942069e29129a685fba09104cf32fbc8298 (diff) | |
download | bcm5719-llvm-aa4d29571c832c1fc706f047e3ee099a133b179b.tar.gz bcm5719-llvm-aa4d29571c832c1fc706f047e3ee099a133b179b.zip |
[C++11] Introduce SectionRef::relocations() to use range-based loops
Reviewers: rafael
Reviewed By: rafael
CC: llvm-commits
Differential Revision: http://llvm-reviews.chandlerc.com/D3077
llvm-svn: 203927
Diffstat (limited to 'llvm/tools/llvm-objdump/MachODump.cpp')
-rw-r--r-- | llvm/tools/llvm-objdump/MachODump.cpp | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/llvm/tools/llvm-objdump/MachODump.cpp b/llvm/tools/llvm-objdump/MachODump.cpp index 087fb40628a..e5247a64b08 100644 --- a/llvm/tools/llvm-objdump/MachODump.cpp +++ b/llvm/tools/llvm-objdump/MachODump.cpp @@ -325,16 +325,14 @@ static void DisassembleInputMachO2(StringRef Filename, bool symbolTableWorked = false; // Parse relocations. - std::vector<std::pair<uint64_t, SymbolRef> > Relocs; - for (relocation_iterator RI = Sections[SectIdx].relocation_begin(), - RE = Sections[SectIdx].relocation_end(); - RI != RE; ++RI) { + std::vector<std::pair<uint64_t, SymbolRef>> Relocs; + for (const RelocationRef &Reloc : Sections[SectIdx].relocations()) { uint64_t RelocOffset, SectionAddress; - RI->getOffset(RelocOffset); + Reloc.getOffset(RelocOffset); Sections[SectIdx].getAddress(SectionAddress); RelocOffset -= SectionAddress; - symbol_iterator RelocSym = RI->getSymbol(); + symbol_iterator RelocSym = Reloc.getSymbol(); Relocs.push_back(std::make_pair(RelocOffset, *RelocSym)); } |