From 4a6f58380a23c7d510861937e7814593783745d8 Mon Sep 17 00:00:00 2001 From: Saleem Abdulrasool Date: Tue, 20 May 2014 05:18:06 +0000 Subject: [PATCH] llvm-readobj: use range-based for loop Convert an additional site to a range based for loop. NFC. llvm-svn: 209194 --- llvm/tools/llvm-readobj/COFFDumper.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/llvm/tools/llvm-readobj/COFFDumper.cpp b/llvm/tools/llvm-readobj/COFFDumper.cpp index b53520d..26ac181 100644 --- a/llvm/tools/llvm-readobj/COFFDumper.cpp +++ b/llvm/tools/llvm-readobj/COFFDumper.cpp @@ -196,15 +196,13 @@ static error_code resolveSectionAndAddress(const COFFObjectFile *Obj, // the function returns the symbol used for the relocation at the offset. static error_code resolveSymbol(const std::vector &Rels, uint64_t Offset, SymbolRef &Sym) { - for (std::vector::const_iterator RelI = Rels.begin(), - RelE = Rels.end(); - RelI != RelE; ++RelI) { + for (const auto &Relocation : Rels) { uint64_t Ofs; - if (error_code EC = RelI->getOffset(Ofs)) + if (error_code EC = Relocation.getOffset(Ofs)) return EC; if (Ofs == Offset) { - Sym = *RelI->getSymbol(); + Sym = *Relocation.getSymbol(); return readobj_error::success; } } -- 2.7.4