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/lib/DebugInfo/DWARFContext.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/lib/DebugInfo/DWARFContext.cpp')
| -rw-r--r-- | llvm/lib/DebugInfo/DWARFContext.cpp | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/llvm/lib/DebugInfo/DWARFContext.cpp b/llvm/lib/DebugInfo/DWARFContext.cpp index 8a245a0301d..0afe6ef6e13 100644 --- a/llvm/lib/DebugInfo/DWARFContext.cpp +++ b/llvm/lib/DebugInfo/DWARFContext.cpp @@ -699,26 +699,24 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) if (Section.relocation_begin() != Section.relocation_end()) { uint64_t SectionSize; RelocatedSection->getSize(SectionSize); - for (object::relocation_iterator reloc_i = Section.relocation_begin(), - reloc_e = Section.relocation_end(); - reloc_i != reloc_e; ++reloc_i) { + for (const RelocationRef &Reloc : Section.relocations()) { uint64_t Address; - reloc_i->getOffset(Address); + Reloc.getOffset(Address); uint64_t Type; - reloc_i->getType(Type); + Reloc.getType(Type); uint64_t SymAddr = 0; // ELF relocations may need the symbol address if (Obj->isELF()) { - object::symbol_iterator Sym = reloc_i->getSymbol(); + object::symbol_iterator Sym = Reloc.getSymbol(); Sym->getAddress(SymAddr); } object::RelocVisitor V(Obj->getFileFormatName()); // The section address is always 0 for debug sections. - object::RelocToApply R(V.visit(Type, *reloc_i, 0, SymAddr)); + object::RelocToApply R(V.visit(Type, Reloc, 0, SymAddr)); if (V.error()) { SmallString<32> Name; - error_code ec(reloc_i->getTypeName(Name)); + error_code ec(Reloc.getTypeName(Name)); if (ec) { errs() << "Aaaaaa! Nameless relocation! Aaaaaa!\n"; } |

