diff options
Diffstat (limited to 'llvm/lib/Object/MachOObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/MachOObjectFile.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp index fb8a2146790..450693f64e1 100644 --- a/llvm/lib/Object/MachOObjectFile.cpp +++ b/llvm/lib/Object/MachOObjectFile.cpp @@ -296,16 +296,16 @@ static void printRelocationTargetName(const MachOObjectFile *O, if (IsScattered) { uint32_t Val = O->getPlainRelocationSymbolNum(RE); - for (symbol_iterator SI = O->symbol_begin(), SE = O->symbol_end(); - SI != SE; ++SI) { + for (const SymbolRef &Symbol : O->symbols()) { error_code ec; uint64_t Addr; StringRef Name; - if ((ec = SI->getAddress(Addr))) + if ((ec = Symbol.getAddress(Addr))) report_fatal_error(ec.message()); - if (Addr != Val) continue; - if ((ec = SI->getName(Name))) + if (Addr != Val) + continue; + if ((ec = Symbol.getName(Name))) report_fatal_error(ec.message()); fmt << Name; return; @@ -528,8 +528,8 @@ error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI, } // Unfortunately symbols are unsorted so we need to touch all // symbols from load command - for (symbol_iterator I = symbol_begin(), E = symbol_end(); I != E; ++I) { - DataRefImpl DRI = I->getRawDataRefImpl(); + for (const SymbolRef &Symbol : symbols()) { + DataRefImpl DRI = Symbol.getRawDataRefImpl(); Entry = getSymbolTableEntryBase(this, DRI); getSymbolAddress(DRI, Value); if (Entry.n_sect == SectionIndex && Value > BeginOffset) |