Use range loop.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@241104 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Rafael Espindola 2015-06-30 19:13:25 +00:00
parent fd8c98591d
commit 6e0583f36b

View File

@ -526,20 +526,18 @@ void PrinterContext<ET>::PrintUnwindInformation() const {
DictScope UI(SW, "UnwindInformation");
int SectionIndex = 0;
for (Elf_Shdr_iterator SI = ELF->section_begin(), SE = ELF->section_end();
SI != SE; ++SI, ++SectionIndex) {
if (SI->sh_type == ELF::SHT_ARM_EXIDX) {
const Elf_Shdr *IT = &(*SI);
for (const Elf_Shdr &Sec : ELF->sections()) {
if (Sec.sh_type == ELF::SHT_ARM_EXIDX) {
DictScope UIT(SW, "UnwindIndexTable");
SW.printNumber("SectionIndex", SectionIndex);
if (ErrorOr<StringRef> SectionName = ELF->getSectionName(IT))
if (ErrorOr<StringRef> SectionName = ELF->getSectionName(&Sec))
SW.printString("SectionName", *SectionName);
SW.printHex("SectionOffset", IT->sh_offset);
SW.printHex("SectionOffset", Sec.sh_offset);
PrintIndexTable(SectionIndex, IT);
PrintIndexTable(SectionIndex, &Sec);
}
++SectionIndex;
}
}
}