Skip to content

Commit

Permalink
llvm-readobj: use range-based for loop
Browse files Browse the repository at this point in the history
Convert an additional site to a range based for loop.  NFC.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@209194 91177308-0d34-0410-b5e6-96231b3b80d8
  • Loading branch information
compnerd committed May 20, 2014
1 parent 4bf804f commit daf56d6
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions tools/llvm-readobj/COFFDumper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<RelocationRef> &Rels,
uint64_t Offset, SymbolRef &Sym) {
for (std::vector<RelocationRef>::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;
}
}
Expand Down

0 comments on commit daf56d6

Please sign in to comment.