forked from OSchip/llvm-project
llvm-readobj: use range-based for loop
Convert an additional site to a range based for loop. NFC. llvm-svn: 209194
This commit is contained in:
parent
ec373545b8
commit
4a6f58380a
|
@ -196,15 +196,13 @@ static error_code resolveSectionAndAddress(const COFFObjectFile *Obj,
|
||||||
// the function returns the symbol used for the relocation at the offset.
|
// the function returns the symbol used for the relocation at the offset.
|
||||||
static error_code resolveSymbol(const std::vector<RelocationRef> &Rels,
|
static error_code resolveSymbol(const std::vector<RelocationRef> &Rels,
|
||||||
uint64_t Offset, SymbolRef &Sym) {
|
uint64_t Offset, SymbolRef &Sym) {
|
||||||
for (std::vector<RelocationRef>::const_iterator RelI = Rels.begin(),
|
for (const auto &Relocation : Rels) {
|
||||||
RelE = Rels.end();
|
|
||||||
RelI != RelE; ++RelI) {
|
|
||||||
uint64_t Ofs;
|
uint64_t Ofs;
|
||||||
if (error_code EC = RelI->getOffset(Ofs))
|
if (error_code EC = Relocation.getOffset(Ofs))
|
||||||
return EC;
|
return EC;
|
||||||
|
|
||||||
if (Ofs == Offset) {
|
if (Ofs == Offset) {
|
||||||
Sym = *RelI->getSymbol();
|
Sym = *Relocation.getSymbol();
|
||||||
return readobj_error::success;
|
return readobj_error::success;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue