From 29d199aa4deda2ca4c6dc471efa3527e2dc8bc34 Mon Sep 17 00:00:00 2001 From: Rafael Espindola Date: Mon, 10 Aug 2015 18:57:42 +0000 Subject: [PATCH] Use continue to reduce indentation. NFC. llvm-svn: 244480 --- tools/llvm-readobj/ARMEHABIPrinter.h | 32 +++++++++++++++------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/tools/llvm-readobj/ARMEHABIPrinter.h b/tools/llvm-readobj/ARMEHABIPrinter.h index 2917cf0e118..7b2c79136a5 100644 --- a/tools/llvm-readobj/ARMEHABIPrinter.h +++ b/tools/llvm-readobj/ARMEHABIPrinter.h @@ -369,23 +369,25 @@ PrinterContext::FindExceptionTable(unsigned IndexSectionIndex, /// table. for (const Elf_Shdr &Sec : ELF->sections()) { - if (Sec.sh_type == ELF::SHT_REL && Sec.sh_info == IndexSectionIndex) { - for (const Elf_Rel &R : ELF->rels(&Sec)) { - if (R.r_offset == static_cast(IndexTableOffset)) { - typename object::ELFFile::Elf_Rela RelA; - RelA.r_offset = R.r_offset; - RelA.r_info = R.r_info; - RelA.r_addend = 0; + if (Sec.sh_type != ELF::SHT_REL || Sec.sh_info != IndexSectionIndex) + continue; - std::pair Symbol = - ELF->getRelocationSymbol(&Sec, &RelA); + for (const Elf_Rel &R : ELF->rels(&Sec)) { + if (R.r_offset != static_cast(IndexTableOffset)) + continue; - ErrorOr Ret = ELF->getSection(Symbol.second); - if (std::error_code EC = Ret.getError()) - report_fatal_error(EC.message()); - return *Ret; - } - } + typename object::ELFFile::Elf_Rela RelA; + RelA.r_offset = R.r_offset; + RelA.r_info = R.r_info; + RelA.r_addend = 0; + + std::pair Symbol = + ELF->getRelocationSymbol(&Sec, &RelA); + + ErrorOr Ret = ELF->getSection(Symbol.second); + if (std::error_code EC = Ret.getError()) + report_fatal_error(EC.message()); + return *Ret; } } return nullptr;