[llvm] r241100 - Use range loop.
Rafael Espindola
rafael.espindola at gmail.com
Tue Jun 30 12:02:01 PDT 2015
Author: rafael
Date: Tue Jun 30 14:02:00 2015
New Revision: 241100
URL: http://llvm.org/viewvc/llvm-project?rev=241100&view=rev
Log:
Use range loop.
Modified:
llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h
Modified: llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h?rev=241100&r1=241099&r2=241100&view=diff
==============================================================================
--- llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h (original)
+++ llvm/trunk/tools/llvm-readobj/ARMEHABIPrinter.h Tue Jun 30 14:02:00 2015
@@ -365,10 +365,9 @@ PrinterContext<ET>::FindExceptionTable(u
/// handling table. Use this symbol to recover the actual exception handling
/// table.
- for (Elf_Shdr_iterator SI = ELF->section_begin(), SE = ELF->section_end();
- SI != SE; ++SI) {
- if (SI->sh_type == ELF::SHT_REL && SI->sh_info == IndexSectionIndex) {
- for (Elf_Rel_iterator RI = ELF->rel_begin(&*SI), RE = ELF->rel_end(&*SI);
+ for (const Elf_Shdr &Sec : ELF->sections()) {
+ if (Sec.sh_type == ELF::SHT_REL && Sec.sh_info == IndexSectionIndex) {
+ for (Elf_Rel_iterator RI = ELF->rel_begin(&Sec), RE = ELF->rel_end(&Sec);
RI != RE; ++RI) {
if (RI->r_offset == static_cast<unsigned>(IndexTableOffset)) {
typename object::ELFFile<ET>::Elf_Rela RelA;
@@ -377,7 +376,7 @@ PrinterContext<ET>::FindExceptionTable(u
RelA.r_addend = 0;
std::pair<const Elf_Shdr *, const Elf_Sym *> Symbol =
- ELF->getRelocationSymbol(&(*SI), &RelA);
+ ELF->getRelocationSymbol(&Sec, &RelA);
return ELF->getSection(Symbol.second);
}
More information about the llvm-commits
mailing list