Change the begin and end methods in ObjectFile to match the style guide.
authorRafael Espindola <rafael.espindola@gmail.com>
Mon, 10 Feb 2014 20:24:04 +0000 (20:24 +0000)
committerRafael Espindola <rafael.espindola@gmail.com>
Mon, 10 Feb 2014 20:24:04 +0000 (20:24 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@201108 91177308-0d34-0410-b5e6-96231b3b80d8

24 files changed:
include/llvm/Object/COFF.h
include/llvm/Object/ELFObjectFile.h
include/llvm/Object/MachO.h
include/llvm/Object/ObjectFile.h
lib/DebugInfo/DWARFContext.cpp
lib/ExecutionEngine/RuntimeDyld/ObjectImageCommon.h
lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
lib/ExecutionEngine/RuntimeDyld/RuntimeDyldELF.cpp
lib/MC/MCObjectDisassembler.cpp
lib/MC/MCObjectSymbolizer.cpp
lib/Object/COFFObjectFile.cpp
lib/Object/MachOObjectFile.cpp
lib/Object/Object.cpp
tools/llvm-ar/llvm-ar.cpp
tools/llvm-nm/llvm-nm.cpp
tools/llvm-objdump/COFFDump.cpp
tools/llvm-objdump/MachODump.cpp
tools/llvm-objdump/llvm-objdump.cpp
tools/llvm-readobj/COFFDumper.cpp
tools/llvm-readobj/MachODumper.cpp
tools/llvm-size/llvm-size.cpp
tools/llvm-symbolizer/LLVMSymbolize.cpp
tools/macho-dump/macho-dump.cpp
tools/obj2yaml/coff2yaml.cpp

index 5d99508f57f853940ffe3d6e268384fa409eb2d3..264a851e8538a747cf7673b3d1ba600c3fd42393 100644 (file)
@@ -332,12 +332,12 @@ protected:
 
 public:
   COFFObjectFile(MemoryBuffer *Object, error_code &EC, bool BufferOwned = true);
-  symbol_iterator begin_symbols() const LLVM_OVERRIDE;
-  symbol_iterator end_symbols() const LLVM_OVERRIDE;
-  library_iterator begin_libraries_needed() const LLVM_OVERRIDE;
-  library_iterator end_libraries_needed() const LLVM_OVERRIDE;
-  section_iterator begin_sections() const LLVM_OVERRIDE;
-  section_iterator end_sections() const LLVM_OVERRIDE;
+  symbol_iterator symbol_begin() const LLVM_OVERRIDE;
+  symbol_iterator symbol_end() const LLVM_OVERRIDE;
+  library_iterator needed_library_begin() const LLVM_OVERRIDE;
+  library_iterator needed_library_end() const LLVM_OVERRIDE;
+  section_iterator section_begin() const LLVM_OVERRIDE;
+  section_iterator section_end() const LLVM_OVERRIDE;
 
   const coff_section *getCOFFSection(section_iterator &It) const;
   const coff_symbol *getCOFFSymbol(symbol_iterator &It) const;
index fe63277830b476410940e3e361b799a7238f093f..054d8d4b65ee5ddaaa05c872c0076143593df299 100644 (file)
@@ -180,17 +180,17 @@ public:
 
   const Elf_Sym *getSymbol(DataRefImpl Symb) const;
 
-  symbol_iterator begin_symbols() const LLVM_OVERRIDE;
-  symbol_iterator end_symbols() const LLVM_OVERRIDE;
+  symbol_iterator symbol_begin() const LLVM_OVERRIDE;
+  symbol_iterator symbol_end() const LLVM_OVERRIDE;
 
-  symbol_iterator begin_dynamic_symbols() const;
-  symbol_iterator end_dynamic_symbols() const;
+  symbol_iterator dynamic_symbol_begin() const;
+  symbol_iterator dynamic_symbol_end() const;
 
-  section_iterator begin_sections() const LLVM_OVERRIDE;
-  section_iterator end_sections() const LLVM_OVERRIDE;
+  section_iterator section_begin() const LLVM_OVERRIDE;
+  section_iterator section_end() const LLVM_OVERRIDE;
 
-  library_iterator begin_libraries_needed() const LLVM_OVERRIDE;
-  library_iterator end_libraries_needed() const LLVM_OVERRIDE;
+  library_iterator needed_library_begin() const LLVM_OVERRIDE;
+  library_iterator needed_library_end() const LLVM_OVERRIDE;
 
   error_code getRelocationAddend(DataRefImpl Rel, int64_t &Res) const;
   error_code getSymbolVersion(SymbolRef Symb, StringRef &Version,
@@ -413,7 +413,7 @@ error_code ELFObjectFile<ELFT>::getSymbolSection(DataRefImpl Symb,
   const Elf_Sym *ESym = getSymbol(Symb);
   const Elf_Shdr *ESec = EF.getSection(ESym);
   if (!ESec)
-    Res = end_sections();
+    Res = section_end();
   else {
     DataRefImpl Sec;
     Sec.p = reinterpret_cast<intptr_t>(ESec);
@@ -571,12 +571,12 @@ template <class ELFT>
 section_iterator
 ELFObjectFile<ELFT>::getRelocatedSection(DataRefImpl Sec) const {
   if (EF.getHeader()->e_type != ELF::ET_REL)
-    return end_sections();
+    return section_end();
 
   Elf_Shdr_Iter EShdr = toELFShdrIter(Sec);
   uintX_t Type = EShdr->sh_type;
   if (Type != ELF::SHT_REL && Type != ELF::SHT_RELA)
-    return end_sections();
+    return section_end();
 
   const Elf_Shdr *R = EF.getSection(EShdr->sh_info);
   return section_iterator(SectionRef(toDRI(R), this));
@@ -606,7 +606,7 @@ ELFObjectFile<ELFT>::getRelocationSymbol(DataRefImpl Rel) const {
   }
   }
   if (!symbolIdx)
-    return end_symbols();
+    return symbol_end();
 
   const Elf_Shdr *SymSec = EF.getSection(sec->sh_link);
 
@@ -824,32 +824,32 @@ ELFObjectFile<ELFT>::ELFObjectFile(MemoryBuffer *Object, error_code &ec,
       EF(Object, ec) {}
 
 template <class ELFT>
-symbol_iterator ELFObjectFile<ELFT>::begin_symbols() const {
+symbol_iterator ELFObjectFile<ELFT>::symbol_begin() const {
   return symbol_iterator(SymbolRef(toDRI(EF.begin_symbols()), this));
 }
 
 template <class ELFT>
-symbol_iterator ELFObjectFile<ELFT>::end_symbols() const {
+symbol_iterator ELFObjectFile<ELFT>::symbol_end() const {
   return symbol_iterator(SymbolRef(toDRI(EF.end_symbols()), this));
 }
 
 template <class ELFT>
-symbol_iterator ELFObjectFile<ELFT>::begin_dynamic_symbols() const {
+symbol_iterator ELFObjectFile<ELFT>::dynamic_symbol_begin() const {
   return symbol_iterator(SymbolRef(toDRI(EF.begin_dynamic_symbols()), this));
 }
 
 template <class ELFT>
-symbol_iterator ELFObjectFile<ELFT>::end_dynamic_symbols() const {
+symbol_iterator ELFObjectFile<ELFT>::dynamic_symbol_end() const {
   return symbol_iterator(SymbolRef(toDRI(EF.end_dynamic_symbols()), this));
 }
 
 template <class ELFT>
-section_iterator ELFObjectFile<ELFT>::begin_sections() const {
+section_iterator ELFObjectFile<ELFT>::section_begin() const {
   return section_iterator(SectionRef(toDRI(EF.begin_sections()), this));
 }
 
 template <class ELFT>
-section_iterator ELFObjectFile<ELFT>::end_sections() const {
+section_iterator ELFObjectFile<ELFT>::section_end() const {
   return section_iterator(SectionRef(toDRI(EF.end_sections()), this));
 }
 
@@ -867,7 +867,7 @@ StringRef ELFObjectFile<ELFT>::getLoadName() const {
 }
 
 template <class ELFT>
-library_iterator ELFObjectFile<ELFT>::begin_libraries_needed() const {
+library_iterator ELFObjectFile<ELFT>::needed_library_begin() const {
   Elf_Dyn_Iter DI = EF.begin_dynamic_table();
   Elf_Dyn_Iter DE = EF.end_dynamic_table();
 
@@ -900,7 +900,7 @@ error_code ELFObjectFile<ELFT>::getLibraryPath(DataRefImpl Data,
 }
 
 template <class ELFT>
-library_iterator ELFObjectFile<ELFT>::end_libraries_needed() const {
+library_iterator ELFObjectFile<ELFT>::needed_library_end() const {
   return library_iterator(LibraryRef(toDRI(EF.end_dynamic_table()), this));
 }
 
index 44217fc54f9dcaaa09321d760f759721343860fc..50cdfc383942ffebe6e56ea11d79b1cce6f04b38 100644 (file)
@@ -126,14 +126,14 @@ public:
   // TODO: Would be useful to have an iterator based version
   // of the load command interface too.
 
-  symbol_iterator begin_symbols() const LLVM_OVERRIDE;
-  symbol_iterator end_symbols() const LLVM_OVERRIDE;
+  symbol_iterator symbol_begin() const LLVM_OVERRIDE;
+  symbol_iterator symbol_end() const LLVM_OVERRIDE;
 
-  section_iterator begin_sections() const LLVM_OVERRIDE;
-  section_iterator end_sections() const LLVM_OVERRIDE;
+  section_iterator section_begin() const LLVM_OVERRIDE;
+  section_iterator section_end() const LLVM_OVERRIDE;
 
-  library_iterator begin_libraries_needed() const LLVM_OVERRIDE;
-  library_iterator end_libraries_needed() const LLVM_OVERRIDE;
+  library_iterator needed_library_begin() const LLVM_OVERRIDE;
+  library_iterator needed_library_end() const LLVM_OVERRIDE;
 
   uint8_t getBytesInAddress() const LLVM_OVERRIDE;
 
index 3fac0e96460c4377389cf57dd19bdaf898a13dec..786f803187613d93e5fab9d2e51013a12ead38f5 100644 (file)
@@ -163,8 +163,8 @@ public:
 
   error_code containsSymbol(SymbolRef S, bool &Result) const;
 
-  relocation_iterator begin_relocations() const;
-  relocation_iterator end_relocations() const;
+  relocation_iterator relocation_begin() const;
+  relocation_iterator relocation_end() const;
   section_iterator getRelocatedSection() const;
 
   DataRefImpl getRawDataRefImpl() const;
@@ -342,14 +342,14 @@ protected:
 
 public:
 
-  virtual symbol_iterator begin_symbols() const = 0;
-  virtual symbol_iterator end_symbols() const = 0;
+  virtual symbol_iterator symbol_begin() const = 0;
+  virtual symbol_iterator symbol_end() const = 0;
 
-  virtual section_iterator begin_sections() const = 0;
-  virtual section_iterator end_sections() const = 0;
+  virtual section_iterator section_begin() const = 0;
+  virtual section_iterator section_end() const = 0;
 
-  virtual library_iterator begin_libraries_needed() const = 0;
-  virtual library_iterator end_libraries_needed() const = 0;
+  virtual library_iterator needed_library_begin() const = 0;
+  virtual library_iterator needed_library_end() const = 0;
 
   /// @brief The number of bytes used to represent an address in this object
   ///        file format.
@@ -518,11 +518,11 @@ inline error_code SectionRef::containsSymbol(SymbolRef S, bool &Result) const {
                                              Result);
 }
 
-inline relocation_iterator SectionRef::begin_relocations() const {
+inline relocation_iterator SectionRef::relocation_begin() const {
   return OwningObject->section_rel_begin(SectionPimpl);
 }
 
-inline relocation_iterator SectionRef::end_relocations() const {
+inline relocation_iterator SectionRef::relocation_end() const {
   return OwningObject->section_rel_end(SectionPimpl);
 }
 
index daf7cdd98c63398eef39f5f2fea4c1a267938396..b5b75b0408e95f34dd2d5644f3d3313dd3c76695 100644 (file)
@@ -603,8 +603,8 @@ static bool consumeCompressedDebugSectionHeader(StringRef &data,
 DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
   IsLittleEndian(Obj->isLittleEndian()),
   AddressSize(Obj->getBytesInAddress()) {
-  for (object::section_iterator i = Obj->begin_sections(),
-                                e = Obj->end_sections();
+  for (object::section_iterator i = Obj->section_begin(),
+                                e = Obj->section_end();
        i != e; ++i) {
     StringRef name;
     i->getName(name);
@@ -665,7 +665,7 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
     }
 
     section_iterator RelocatedSection = i->getRelocatedSection();
-    if (RelocatedSection == Obj->end_sections())
+    if (RelocatedSection == Obj->section_end())
       continue;
 
     StringRef RelSecName;
@@ -692,11 +692,11 @@ DWARFContextInMemory::DWARFContextInMemory(object::ObjectFile *Obj) :
         continue;
     }
 
-    if (i->begin_relocations() != i->end_relocations()) {
+    if (i->relocation_begin() != i->relocation_end()) {
       uint64_t SectionSize;
       RelocatedSection->getSize(SectionSize);
-      for (object::relocation_iterator reloc_i = i->begin_relocations(),
-                                       reloc_e = i->end_relocations();
+      for (object::relocation_iterator reloc_i = i->relocation_begin(),
+                                       reloc_e = i->relocation_end();
            reloc_i != reloc_e; ++reloc_i) {
         uint64_t Address;
         reloc_i->getOffset(Address);
index 2056f39b5acf94cb94bd764f43b3b0226d585406..f647b87f591d830bd6d5c824d3fb99bc59bda2c2 100644 (file)
@@ -52,14 +52,14 @@ public:
   virtual ~ObjectImageCommon() { delete ObjFile; }
 
   virtual object::symbol_iterator begin_symbols() const
-              { return ObjFile->begin_symbols(); }
+              { return ObjFile->symbol_begin(); }
   virtual object::symbol_iterator end_symbols() const
-              { return ObjFile->end_symbols(); }
+              { return ObjFile->symbol_end(); }
 
   virtual object::section_iterator begin_sections() const
-              { return ObjFile->begin_sections(); }
+              { return ObjFile->section_begin(); }
   virtual object::section_iterator end_sections() const
-              { return ObjFile->end_sections(); }
+              { return ObjFile->section_end(); }
 
   virtual /* Triple::ArchType */ unsigned getArch() const
               { return ObjFile->getArch(); }
index 8ea941b69dcfd2f7b83a675a99d2d0570aa01979..b858965b5c2c182c0bce87f8837f83bac4c59546 100644 (file)
@@ -177,8 +177,8 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
     StubMap Stubs;
     section_iterator RelocatedSection = si->getRelocatedSection();
 
-    for (relocation_iterator i = si->begin_relocations(),
-                             e = si->end_relocations();
+    for (relocation_iterator i = si->relocation_begin(),
+                             e = si->relocation_end();
          i != e; ++i) {
       // If it's the first relocation in this section, find its SectionID
       if (isFirstRelocation) {
@@ -251,15 +251,15 @@ unsigned RuntimeDyldImpl::emitSection(ObjectImage &Obj,
   // necessary section allocation size in loadObject by walking all the sections
   // once.
   if (StubSize > 0) {
-    for (section_iterator SI = ObjFile->begin_sections(),
-                          SE = ObjFile->end_sections();
+    for (section_iterator SI = ObjFile->section_begin(),
+                          SE = ObjFile->section_end();
          SI != SE; ++SI) {
       section_iterator RelSecI = SI->getRelocatedSection();
       if (!(RelSecI == Section))
         continue;
 
-      for (relocation_iterator I = SI->begin_relocations(),
-                               E = SI->end_relocations();
+      for (relocation_iterator I = SI->relocation_begin(),
+                               E = SI->relocation_end();
            I != E; ++I) {
         StubBufSize += StubSize;
       }
index 4dbd6794c61660a7046fcffceefaf73b8aec4b76..a4246e0c71edc3392e796977b1eeef1ea03109a9 100644 (file)
@@ -632,8 +632,8 @@ void RuntimeDyldELF::findOPDEntrySection(ObjectImage &Obj,
     if (RelSectionName != ".opd")
       continue;
 
-    for (relocation_iterator i = si->begin_relocations(),
-         e = si->end_relocations(); i != e;) {
+    for (relocation_iterator i = si->relocation_begin(),
+         e = si->relocation_end(); i != e;) {
       // The R_PPC64_ADDR64 relocation indicates the first field
       // of a .opd entry
       uint64_t TypeFunc;
index 85de4111b7f8abd9f8a8a55d5ea659bd8b6ff390..5851bdfdb71bac20bbedcb91314bb99c134b3b5b 100644 (file)
@@ -37,7 +37,7 @@ MCObjectDisassembler::MCObjectDisassembler(const ObjectFile &Obj,
     : Obj(Obj), Dis(Dis), MIA(MIA), MOS(0) {}
 
 uint64_t MCObjectDisassembler::getEntrypoint() {
-  for (symbol_iterator SI = Obj.begin_symbols(), SE = Obj.end_symbols();
+  for (symbol_iterator SI = Obj.symbol_begin(), SE = Obj.symbol_end();
        SI != SE; ++SI) {
     StringRef Name;
     SI->getName(Name);
@@ -87,7 +87,7 @@ MCModule *MCObjectDisassembler::buildModule(bool withCFG) {
 }
 
 void MCObjectDisassembler::buildSectionAtoms(MCModule *Module) {
-  for (section_iterator SI = Obj.begin_sections(), SE = Obj.end_sections();
+  for (section_iterator SI = Obj.section_begin(), SE = Obj.section_end();
        SI != SE; ++SI) {
     bool isText; SI->isText(isText);
     bool isData; SI->isData(isData);
@@ -176,7 +176,7 @@ void MCObjectDisassembler::buildCFG(MCModule *Module) {
   AddressSetTy Splits;
   AddressSetTy Calls;
 
-  for (symbol_iterator SI = Obj.begin_symbols(), SE = Obj.end_symbols();
+  for (symbol_iterator SI = Obj.symbol_begin(), SE = Obj.symbol_end();
        SI != SE; ++SI) {
     SymbolRef::Type SymType;
     SI->getType(SymType);
@@ -495,7 +495,7 @@ MCMachOObjectDisassembler::MCMachOObjectDisassembler(
     : MCObjectDisassembler(MOOF, Dis, MIA), MOOF(MOOF),
       VMAddrSlide(VMAddrSlide), HeaderLoadAddress(HeaderLoadAddress) {
 
-  for (section_iterator SI = MOOF.begin_sections(), SE = MOOF.end_sections();
+  for (section_iterator SI = MOOF.section_begin(), SE = MOOF.section_end();
        SI != SE; ++SI) {
     StringRef Name;
     SI->getName(Name);
index 3fb053dd7892484b084168222d99ae599048e95d..ee0b81ed15f44a311b8b0621a356bb27542332da 100644 (file)
@@ -52,7 +52,7 @@ MCMachObjectSymbolizer(MCContext &Ctx, OwningPtr<MCRelocationInfo> &RelInfo,
     : MCObjectSymbolizer(Ctx, RelInfo, MOOF), MOOF(MOOF),
       StubsStart(0), StubsCount(0), StubSize(0), StubsIndSymIndex(0) {
 
-  for (section_iterator SI = MOOF->begin_sections(), SE = MOOF->end_sections();
+  for (section_iterator SI = MOOF->section_begin(), SE = MOOF->section_end();
        SI != SE; ++SI) {
     StringRef Name; SI->getName(Name);
     if (Name == "__stubs") {
@@ -88,11 +88,11 @@ StringRef MCMachObjectSymbolizer::findExternalFunctionAt(uint64_t Addr) {
     MOOF->getIndirectSymbolTableEntry(MOOF->getDysymtabLoadCommand(), StubIdx);
 
   StringRef SymName;
-  symbol_iterator SI = MOOF->begin_symbols();
+  symbol_iterator SI = MOOF->symbol_begin();
   for (uint32_t i = 0; i != SymtabIdx; ++i)
     ++SI;
   SI->getName(SymName);
-  assert(SI != MOOF->end_symbols() && "Stub wasn't found in the symbol table!");
+  assert(SI != MOOF->symbol_end() && "Stub wasn't found in the symbol table!");
   assert(SymName.front() == '_' && "Mach-O symbol doesn't start with '_'!");
   return SymName.substr(1);
 }
@@ -155,7 +155,7 @@ tryAddingSymbolicOperand(MCInst &MI, raw_ostream &cStream,
     return false;
   uint64_t UValue = Value;
   // FIXME: map instead of looping each time?
-  for (symbol_iterator SI = Obj->begin_symbols(), SE = Obj->end_symbols();
+  for (symbol_iterator SI = Obj->symbol_begin(), SE = Obj->symbol_end();
        SI != SE; ++SI) {
     uint64_t SymAddr; SI->getAddress(SymAddr);
     uint64_t SymSize; SI->getSize(SymSize);
@@ -233,7 +233,7 @@ const RelocationRef *MCObjectSymbolizer::findRelocationAt(uint64_t Addr) {
 }
 
 void MCObjectSymbolizer::buildSectionList() {
-  for (section_iterator SI = Obj->begin_sections(), SE = Obj->end_sections();
+  for (section_iterator SI = Obj->section_begin(), SE = Obj->section_end();
        SI != SE; ++SI) {
     bool RequiredForExec; SI->isRequiredForExecution(RequiredForExec);
     if (RequiredForExec == false)
@@ -254,10 +254,10 @@ void MCObjectSymbolizer::buildSectionList() {
 }
 
 void MCObjectSymbolizer::buildRelocationByAddrMap() {
-  for (section_iterator SI = Obj->begin_sections(), SE = Obj->end_sections();
+  for (section_iterator SI = Obj->section_begin(), SE = Obj->section_end();
        SI != SE; ++SI) {
     section_iterator RelSecI = SI->getRelocatedSection();
-    if (RelSecI == Obj->end_sections())
+    if (RelSecI == Obj->section_end())
       continue;
 
     uint64_t StartAddr; RelSecI->getAddress(StartAddr);
@@ -265,8 +265,8 @@ void MCObjectSymbolizer::buildRelocationByAddrMap() {
     bool RequiredForExec; RelSecI->isRequiredForExecution(RequiredForExec);
     if (RequiredForExec == false || Size == 0)
       continue;
-    for (relocation_iterator RI = SI->begin_relocations(),
-                             RE = SI->end_relocations();
+    for (relocation_iterator RI = SI->relocation_begin(),
+                             RE = SI->relocation_end();
          RI != RE; ++RI) {
       // FIXME: libObject is inconsistent regarding error handling. The
       // overwhelming majority of methods always return object_error::success,
index a604acda749e1edaa3da52613bf88ec1c3015a3c..a1bbc56d2be55c1ccf5250e80dafeb1c9507d9dc 100644 (file)
@@ -205,7 +205,7 @@ error_code COFFObjectFile::getSymbolSection(DataRefImpl Ref,
                                             section_iterator &Result) const {
   const coff_symbol *Symb = toSymb(Ref);
   if (Symb->SectionNumber <= COFF::IMAGE_SYM_UNDEFINED)
-    Result = end_sections();
+    Result = section_end();
   else {
     const coff_section *Sec = 0;
     if (error_code EC = getSection(Symb->SectionNumber, Sec)) return EC;
@@ -383,7 +383,7 @@ error_code COFFObjectFile::initSymbolTablePtr() {
 
 // Returns the file offset for the given RVA.
 error_code COFFObjectFile::getRvaPtr(uint32_t Rva, uintptr_t &Res) const {
-  for (section_iterator I = begin_sections(), E = end_sections(); I != E;
+  for (section_iterator I = section_begin(), E = section_end(); I != E;
        ++I) {
     const coff_section *Section = getCOFFSection(I);
     uint32_t SectionStart = Section->VirtualAddress;
@@ -540,25 +540,25 @@ COFFObjectFile::COFFObjectFile(MemoryBuffer *Object, error_code &EC,
   EC = object_error::success;
 }
 
-symbol_iterator COFFObjectFile::begin_symbols() const {
+symbol_iterator COFFObjectFile::symbol_begin() const {
   DataRefImpl Ret;
   Ret.p = reinterpret_cast<uintptr_t>(SymbolTable);
   return symbol_iterator(SymbolRef(Ret, this));
 }
 
-symbol_iterator COFFObjectFile::end_symbols() const {
+symbol_iterator COFFObjectFile::symbol_end() const {
   // The symbol table ends where the string table begins.
   DataRefImpl Ret;
   Ret.p = reinterpret_cast<uintptr_t>(StringTable);
   return symbol_iterator(SymbolRef(Ret, this));
 }
 
-library_iterator COFFObjectFile::begin_libraries_needed() const {
+library_iterator COFFObjectFile::needed_library_begin() const {
   // TODO: implement
   report_fatal_error("Libraries needed unimplemented in COFFObjectFile");
 }
 
-library_iterator COFFObjectFile::end_libraries_needed() const {
+library_iterator COFFObjectFile::needed_library_end() const {
   // TODO: implement
   report_fatal_error("Libraries needed unimplemented in COFFObjectFile");
 }
@@ -591,13 +591,13 @@ export_directory_iterator COFFObjectFile::export_directory_end() const {
   return export_directory_iterator(Ref);
 }
 
-section_iterator COFFObjectFile::begin_sections() const {
+section_iterator COFFObjectFile::section_begin() const {
   DataRefImpl Ret;
   Ret.p = reinterpret_cast<uintptr_t>(SectionTable);
   return section_iterator(SectionRef(Ret, this));
 }
 
-section_iterator COFFObjectFile::end_sections() const {
+section_iterator COFFObjectFile::section_end() const {
   DataRefImpl Ret;
   int NumSections = COFFHeader->isImportLibrary()
       ? 0 : COFFHeader->NumberOfSections;
index 3dd837c6e79a862f09e358d311f52bfe13efe4ef..23c2d6d8bda07d17a19f3ad061ae23e9740ad51d 100644 (file)
@@ -296,7 +296,7 @@ static void printRelocationTargetName(const MachOObjectFile *O,
   if (IsScattered) {
     uint32_t Val = O->getPlainRelocationSymbolNum(RE);
 
-    for (symbol_iterator SI = O->begin_symbols(), SE = O->end_symbols();
+    for (symbol_iterator SI = O->symbol_begin(), SE = O->symbol_end();
          SI != SE; ++SI) {
       error_code ec;
       uint64_t Addr;
@@ -313,7 +313,7 @@ static void printRelocationTargetName(const MachOObjectFile *O,
 
     // If we couldn't find a symbol that this relocation refers to, try
     // to find a section beginning instead.
-    for (section_iterator SI = O->begin_sections(), SE = O->end_sections();
+    for (section_iterator SI = O->section_begin(), SE = O->section_end();
          SI != SE; ++SI) {
       error_code ec;
       uint64_t Addr;
@@ -337,11 +337,11 @@ static void printRelocationTargetName(const MachOObjectFile *O,
   uint64_t Val = O->getPlainRelocationSymbolNum(RE);
 
   if (isExtern) {
-    symbol_iterator SI = O->begin_symbols();
+    symbol_iterator SI = O->symbol_begin();
     advance(SI, Val);
     SI->getName(S);
   } else {
-    section_iterator SI = O->begin_sections();
+    section_iterator SI = O->section_begin();
     // Adjust for the fact that sections are 1-indexed.
     advance(SI, Val - 1);
     SI->getName(S);
@@ -528,7 +528,7 @@ error_code MachOObjectFile::getSymbolSize(DataRefImpl DRI,
   }
   // Unfortunately symbols are unsorted so we need to touch all
   // symbols from load command
-  for (symbol_iterator I = begin_symbols(), E = end_symbols(); I != E; ++I) {
+  for (symbol_iterator I = symbol_begin(), E = symbol_end(); I != E; ++I) {
     DataRefImpl DRI = I->getRawDataRefImpl();
     Entry = getSymbolTableEntryBase(this, DRI);
     getSymbolAddress(DRI, Value);
@@ -612,7 +612,7 @@ MachOObjectFile::getSymbolSection(DataRefImpl Symb,
   uint8_t index = Entry.n_sect;
 
   if (index == 0) {
-    Res = end_sections();
+    Res = section_end();
   } else {
     DataRefImpl DRI;
     DRI.d.a = index - 1;
@@ -834,7 +834,7 @@ MachOObjectFile::getRelocationSymbol(DataRefImpl Rel) const {
   uint32_t SymbolIdx = getPlainRelocationSymbolNum(RE);
   bool isExtern = getPlainRelocationExternal(RE);
   if (!isExtern)
-    return end_symbols();
+    return symbol_end();
 
   MachO::symtab_command S = getSymtabLoadCommand();
   unsigned SymbolTableEntrySize = is64Bit() ?
@@ -1163,7 +1163,7 @@ error_code MachOObjectFile::getLibraryPath(DataRefImpl LibData,
   report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
 }
 
-symbol_iterator MachOObjectFile::begin_symbols() const {
+symbol_iterator MachOObjectFile::symbol_begin() const {
   DataRefImpl DRI;
   if (!SymtabLoadCmd)
     return symbol_iterator(SymbolRef(DRI, this));
@@ -1173,7 +1173,7 @@ symbol_iterator MachOObjectFile::begin_symbols() const {
   return symbol_iterator(SymbolRef(DRI, this));
 }
 
-symbol_iterator MachOObjectFile::end_symbols() const {
+symbol_iterator MachOObjectFile::symbol_end() const {
   DataRefImpl DRI;
   if (!SymtabLoadCmd)
     return symbol_iterator(SymbolRef(DRI, this));
@@ -1188,23 +1188,23 @@ symbol_iterator MachOObjectFile::end_symbols() const {
   return symbol_iterator(SymbolRef(DRI, this));
 }
 
-section_iterator MachOObjectFile::begin_sections() const {
+section_iterator MachOObjectFile::section_begin() const {
   DataRefImpl DRI;
   return section_iterator(SectionRef(DRI, this));
 }
 
-section_iterator MachOObjectFile::end_sections() const {
+section_iterator MachOObjectFile::section_end() const {
   DataRefImpl DRI;
   DRI.d.a = Sections.size();
   return section_iterator(SectionRef(DRI, this));
 }
 
-library_iterator MachOObjectFile::begin_libraries_needed() const {
+library_iterator MachOObjectFile::needed_library_begin() const {
   // TODO: implement
   report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
 }
 
-library_iterator MachOObjectFile::end_libraries_needed() const {
+library_iterator MachOObjectFile::needed_library_end() const {
   // TODO: implement
   report_fatal_error("Needed libraries unimplemented in MachOObjectFile");
 }
@@ -1389,7 +1389,7 @@ SectionRef
 MachOObjectFile::getRelocationSection(
                                    const MachO::any_relocation_info &RE) const {
   if (isRelocationScattered(RE) || getPlainRelocationExternal(RE))
-    return *end_sections();
+    return *section_end();
   unsigned SecNum = getPlainRelocationSymbolNum(RE) - 1;
   DataRefImpl DRI;
   DRI.d.a = SecNum;
index 399d460f8ce5a63fdd0ef177a1aea3dfa554c635..243bd44a02c630dc16edd8e4e8a18922695dd9ad 100644 (file)
@@ -70,7 +70,7 @@ void LLVMDisposeObjectFile(LLVMObjectFileRef ObjectFile) {
 
 // ObjectFile Section iterators
 LLVMSectionIteratorRef LLVMGetSections(LLVMObjectFileRef ObjectFile) {
-  section_iterator SI = unwrap(ObjectFile)->begin_sections();
+  section_iterator SI = unwrap(ObjectFile)->section_begin();
   return wrap(new section_iterator(SI));
 }
 
@@ -80,7 +80,7 @@ void LLVMDisposeSectionIterator(LLVMSectionIteratorRef SI) {
 
 LLVMBool LLVMIsSectionIteratorAtEnd(LLVMObjectFileRef ObjectFile,
                                 LLVMSectionIteratorRef SI) {
-  return (*unwrap(SI) == unwrap(ObjectFile)->end_sections()) ? 1 : 0;
+  return (*unwrap(SI) == unwrap(ObjectFile)->section_end()) ? 1 : 0;
 }
 
 void LLVMMoveToNextSection(LLVMSectionIteratorRef SI) {
@@ -95,7 +95,7 @@ void LLVMMoveToContainingSection(LLVMSectionIteratorRef Sect,
 
 // ObjectFile Symbol iterators
 LLVMSymbolIteratorRef LLVMGetSymbols(LLVMObjectFileRef ObjectFile) {
-  symbol_iterator SI = unwrap(ObjectFile)->begin_symbols();
+  symbol_iterator SI = unwrap(ObjectFile)->symbol_begin();
   return wrap(new symbol_iterator(SI));
 }
 
@@ -105,7 +105,7 @@ void LLVMDisposeSymbolIterator(LLVMSymbolIteratorRef SI) {
 
 LLVMBool LLVMIsSymbolIteratorAtEnd(LLVMObjectFileRef ObjectFile,
                                 LLVMSymbolIteratorRef SI) {
-  return (*unwrap(SI) == unwrap(ObjectFile)->end_symbols()) ? 1 : 0;
+  return (*unwrap(SI) == unwrap(ObjectFile)->symbol_end()) ? 1 : 0;
 }
 
 void LLVMMoveToNextSymbol(LLVMSymbolIteratorRef SI) {
@@ -151,7 +151,7 @@ LLVMBool LLVMGetSectionContainsSymbol(LLVMSectionIteratorRef SI,
 
 // Section Relocation iterators
 LLVMRelocationIteratorRef LLVMGetRelocations(LLVMSectionIteratorRef Section) {
-  relocation_iterator SI = (*unwrap(Section))->begin_relocations();
+  relocation_iterator SI = (*unwrap(Section))->relocation_begin();
   return wrap(new relocation_iterator(SI));
 }
 
@@ -161,7 +161,7 @@ void LLVMDisposeRelocationIterator(LLVMRelocationIteratorRef SI) {
 
 LLVMBool LLVMIsRelocationIteratorAtEnd(LLVMSectionIteratorRef Section,
                                        LLVMRelocationIteratorRef SI) {
-  return (*unwrap(SI) == (*unwrap(Section))->end_relocations()) ? 1 : 0;
+  return (*unwrap(SI) == (*unwrap(Section))->relocation_end()) ? 1 : 0;
 }
 
 void LLVMMoveToNextRelocation(LLVMRelocationIteratorRef SI) {
index 1a1fd8a48333b598181948b668cc75c96fd0eca7..bc9ad37e5d30501b53e0f0f56cae145c177eb47f 100644 (file)
@@ -716,8 +716,8 @@ static void writeSymbolTable(
       print32BE(Out, 0);
     }
 
-    for (object::symbol_iterator I = Obj->begin_symbols(),
-                                 E = Obj->end_symbols();
+    for (object::symbol_iterator I = Obj->symbol_begin(),
+                                 E = Obj->symbol_end();
          I != E; ++I) {
       uint32_t Symflags = I->getFlags();;
       if (Symflags & object::SymbolRef::SF_FormatSpecific)
index 3a72862776f17ec0d8c3cd766beabd5107c5f81e..fd18454a8f0bb279f75d64e7213516bd5e34d03a 100644 (file)
@@ -365,7 +365,7 @@ static char getSymbolNMTypeChar(COFFObjectFile &Obj, symbol_iterator I) {
 
   uint32_t Characteristics = 0;
   if (Symb->SectionNumber > 0) {
-    section_iterator SecI = Obj.end_sections();
+    section_iterator SecI = Obj.section_end();
     if (error(I->getSection(SecI)))
       return '?';
     const coff_section *Section = Obj.getCOFFSection(SecI);
@@ -415,7 +415,7 @@ static char getSymbolNMTypeChar(MachOObjectFile &Obj, symbol_iterator I) {
   case MachO::N_ABS:
     return 's';
   case MachO::N_SECT: {
-    section_iterator Sec = Obj.end_sections();
+    section_iterator Sec = Obj.section_end();
     Obj.getSymbolSection(Symb, Sec);
     DataRefImpl Ref = Sec->getRawDataRefImpl();
     StringRef SectionName;
@@ -493,29 +493,29 @@ static char getNMTypeChar(ObjectFile *Obj, symbol_iterator I) {
 static void getDynamicSymbolIterators(ObjectFile *Obj, symbol_iterator &Begin,
                                       symbol_iterator &End) {
   if (ELF32LEObjectFile *ELF = dyn_cast<ELF32LEObjectFile>(Obj)) {
-    Begin = ELF->begin_dynamic_symbols();
-    End = ELF->end_dynamic_symbols();
+    Begin = ELF->dynamic_symbol_begin();
+    End = ELF->dynamic_symbol_end();
     return;
   }
   if (ELF64LEObjectFile *ELF = dyn_cast<ELF64LEObjectFile>(Obj)) {
-    Begin = ELF->begin_dynamic_symbols();
-    End = ELF->end_dynamic_symbols();
+    Begin = ELF->dynamic_symbol_begin();
+    End = ELF->dynamic_symbol_end();
     return;
   }
   if (ELF32BEObjectFile *ELF = dyn_cast<ELF32BEObjectFile>(Obj)) {
-    Begin = ELF->begin_dynamic_symbols();
-    End = ELF->end_dynamic_symbols();
+    Begin = ELF->dynamic_symbol_begin();
+    End = ELF->dynamic_symbol_end();
     return;
   }
   ELF64BEObjectFile *ELF = cast<ELF64BEObjectFile>(Obj);
-  Begin = ELF->begin_dynamic_symbols();
-  End = ELF->end_dynamic_symbols();
+  Begin = ELF->dynamic_symbol_begin();
+  End = ELF->dynamic_symbol_end();
   return;
 }
 
 static void dumpSymbolNamesFromObject(ObjectFile *Obj) {
-  symbol_iterator IBegin = Obj->begin_symbols();
-  symbol_iterator IEnd = Obj->end_symbols();
+  symbol_iterator IBegin = Obj->symbol_begin();
+  symbol_iterator IEnd = Obj->symbol_end();
   if (DynamicSyms) {
     if (!Obj->isELF()) {
       error("File format has no dynamic symbol table", Obj->getFileName());
index dd2db2b037ed17875dba176373626546747c6c73..f6f0f15197b93f73172f12f237c9194197baff8a 100644 (file)
@@ -163,7 +163,7 @@ static error_code resolveSectionAndAddress(const COFFObjectFile *Obj,
                                            uint64_t &ResolvedAddr) {
   if (error_code EC = Sym.getAddress(ResolvedAddr))
     return EC;
-  section_iterator iter(Obj->begin_sections());
+  section_iterator iter(Obj->section_begin());
   if (error_code EC = Sym.getSection(iter))
     return EC;
   ResolvedSection = Obj->getCOFFSection(iter);
@@ -320,7 +320,7 @@ void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
 
   const coff_section *Pdata = 0;
 
-  for (section_iterator SI = Obj->begin_sections(), SE = Obj->end_sections();
+  for (section_iterator SI = Obj->section_begin(), SE = Obj->section_end();
        SI != SE; ++SI) {
     StringRef Name;
     if (error(SI->getName(Name))) continue;
@@ -329,8 +329,8 @@ void llvm::printCOFFUnwindInfo(const COFFObjectFile *Obj) {
 
     Pdata = Obj->getCOFFSection(SI);
     std::vector<RelocationRef> Rels;
-    for (relocation_iterator RI = SI->begin_relocations(),
-                             RE = SI->end_relocations();
+    for (relocation_iterator RI = SI->relocation_begin(),
+                             RE = SI->relocation_end();
          RI != RE; ++RI)
       Rels.push_back(*RI);
 
index b8ce9c884a76c4aa1a32c29f0606a43cff40ee2c..35e424d60b4eeba258d1d45ad27287065518e134 100644 (file)
@@ -154,13 +154,13 @@ getSectionsAndSymbols(const MachO::mach_header Header,
                       std::vector<SymbolRef> &Symbols,
                       SmallVectorImpl<uint64_t> &FoundFns,
                       uint64_t &BaseSegmentAddress) {
-  for (symbol_iterator SI = MachOObj->begin_symbols(),
-                       SE = MachOObj->end_symbols();
+  for (symbol_iterator SI = MachOObj->symbol_begin(),
+                       SE = MachOObj->symbol_end();
        SI != SE; ++SI)
     Symbols.push_back(*SI);
 
-  for (section_iterator SI = MachOObj->begin_sections(),
-                        SE = MachOObj->end_sections();
+  for (section_iterator SI = MachOObj->section_begin(),
+                        SE = MachOObj->section_end();
        SI != SE; ++SI) {
     SectionRef SR = *SI;
     StringRef SectName;
@@ -329,8 +329,8 @@ static void DisassembleInputMachO2(StringRef Filename,
 
     // Parse relocations.
     std::vector<std::pair<uint64_t, SymbolRef> > Relocs;
-    for (relocation_iterator RI = Sections[SectIdx].begin_relocations(),
-                             RE = Sections[SectIdx].end_relocations();
+    for (relocation_iterator RI = Sections[SectIdx].relocation_begin(),
+                             RE = Sections[SectIdx].relocation_end();
          RI != RE; ++RI) {
       uint64_t RelocOffset, SectionAddress;
       RI->getOffset(RelocOffset);
index 4572c9654812ca1080502710c5729a2641a1f275..3b87507af0a1c4d93fe74afe560a1acfd7b8329f 100644 (file)
@@ -386,14 +386,14 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
   // in RelocSecs contain the relocations for section S.
   error_code EC;
   std::map<SectionRef, SmallVector<SectionRef, 1> > SectionRelocMap;
-  for (section_iterator I = Obj->begin_sections(), E = Obj->end_sections();
+  for (section_iterator I = Obj->section_begin(), E = Obj->section_end();
        I != E; ++I) {
     section_iterator Sec2 = I->getRelocatedSection();
-    if (Sec2 != Obj->end_sections())
+    if (Sec2 != Obj->section_end())
       SectionRelocMap[*Sec2].push_back(*I);
   }
 
-  for (section_iterator I = Obj->begin_sections(), E = Obj->end_sections();
+  for (section_iterator I = Obj->section_begin(), E = Obj->section_end();
        I != E; ++I) {
     bool Text;
     if (error(I->isText(Text)))
@@ -407,7 +407,7 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
 
     // Make a list of all the symbols in this section.
     std::vector<std::pair<uint64_t, StringRef> > Symbols;
-    for (symbol_iterator SI = Obj->begin_symbols(), SE = Obj->end_symbols();
+    for (symbol_iterator SI = Obj->symbol_begin(), SE = Obj->symbol_end();
          SI != SE; ++SI) {
       bool contains;
       if (!error(I->containsSymbol(*SI, contains)) && contains) {
@@ -435,8 +435,8 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
       for (SmallVectorImpl<SectionRef>::iterator RelocSec = RelocSecs->begin(),
                                                  E = RelocSecs->end();
            RelocSec != E; ++RelocSec) {
-        for (relocation_iterator RI = RelocSec->begin_relocations(),
-                                 RE = RelocSec->end_relocations();
+        for (relocation_iterator RI = RelocSec->relocation_begin(),
+                                 RE = RelocSec->relocation_end();
              RI != RE; ++RI)
           Rels.push_back(*RI);
       }
@@ -552,15 +552,15 @@ static void DisassembleObject(const ObjectFile *Obj, bool InlineRelocs) {
 }
 
 static void PrintRelocations(const ObjectFile *o) {
-  for (section_iterator si = o->begin_sections(), se = o->end_sections();
+  for (section_iterator si = o->section_begin(), se = o->section_end();
        si != se; ++si) {
-    if (si->begin_relocations() == si->end_relocations())
+    if (si->relocation_begin() == si->relocation_end())
       continue;
     StringRef secname;
     if (error(si->getName(secname))) continue;
     outs() << "RELOCATION RECORDS FOR [" << secname << "]:\n";
-    for (relocation_iterator ri = si->begin_relocations(),
-                             re = si->end_relocations();
+    for (relocation_iterator ri = si->relocation_begin(),
+                             re = si->relocation_end();
          ri != re; ++ri) {
       bool hidden;
       uint64_t address;
@@ -581,7 +581,7 @@ static void PrintSectionHeaders(const ObjectFile *o) {
   outs() << "Sections:\n"
             "Idx Name          Size      Address          Type\n";
   unsigned i = 0;
-  for (section_iterator si = o->begin_sections(), se = o->end_sections();
+  for (section_iterator si = o->section_begin(), se = o->section_end();
        si != se; ++si) {
     StringRef Name;
     if (error(si->getName(Name)))
@@ -604,7 +604,7 @@ static void PrintSectionHeaders(const ObjectFile *o) {
 
 static void PrintSectionContents(const ObjectFile *o) {
   error_code EC;
-  for (section_iterator si = o->begin_sections(), se = o->end_sections();
+  for (section_iterator si = o->section_begin(), se = o->section_end();
        si != se; ++si) {
     StringRef Name;
     StringRef Contents;
@@ -696,14 +696,14 @@ static void PrintSymbolTable(const ObjectFile *o) {
   if (const COFFObjectFile *coff = dyn_cast<const COFFObjectFile>(o))
     PrintCOFFSymbolTable(coff);
   else {
-    for (symbol_iterator si = o->begin_symbols(), se = o->end_symbols();
+    for (symbol_iterator si = o->symbol_begin(), se = o->symbol_end();
          si != se; ++si) {
       StringRef Name;
       uint64_t Address;
       SymbolRef::Type Type;
       uint64_t Size;
       uint32_t Flags = si->getFlags();
-      section_iterator Section = o->end_sections();
+      section_iterator Section = o->section_end();
       if (error(si->getName(Name))) continue;
       if (error(si->getAddress(Address))) continue;
       if (error(si->getType(Type))) continue;
@@ -743,7 +743,7 @@ static void PrintSymbolTable(const ObjectFile *o) {
              << ' ';
       if (Absolute)
         outs() << "*ABS*";
-      else if (Section == o->end_sections())
+      else if (Section == o->section_end())
         outs() << "*UND*";
       else {
         if (const MachOObjectFile *MachO =
index 08153ebd0472c37ef901bab9617614ddaee1893d..120794280d24e3451daa669674809d6ea5aec5fc 100644 (file)
@@ -185,7 +185,7 @@ static error_code resolveSectionAndAddress(const COFFObjectFile *Obj,
   if (error_code EC = Sym.getAddress(ResolvedAddr))
     return EC;
 
-  section_iterator iter(Obj->begin_sections());
+  section_iterator iter(Obj->section_begin());
   if (error_code EC = Sym.getSection(iter))
     return EC;
 
@@ -541,13 +541,13 @@ error_code COFFDumper::getSection(
 }
 
 void COFFDumper::cacheRelocations() {
-  for (section_iterator SecI = Obj->begin_sections(),
-                        SecE = Obj->end_sections();
+  for (section_iterator SecI = Obj->section_begin(),
+                        SecE = Obj->section_end();
        SecI != SecE; ++SecI) {
     const coff_section *Section = Obj->getCOFFSection(SecI);
 
-    for (relocation_iterator RelI = SecI->begin_relocations(),
-                             RelE = SecI->end_relocations();
+    for (relocation_iterator RelI = SecI->relocation_begin(),
+                             RelE = SecI->relocation_end();
          RelI != RelE; ++RelI)
       RelocMap[Section].push_back(*RelI);
 
@@ -818,8 +818,8 @@ void COFFDumper::printCodeViewLineTables(section_iterator SecI) {
 void COFFDumper::printSections() {
   ListScope SectionsD(W, "Sections");
   int SectionNumber = 0;
-  for (section_iterator SecI = Obj->begin_sections(),
-                        SecE = Obj->end_sections();
+  for (section_iterator SecI = Obj->section_begin(),
+                        SecE = Obj->section_end();
        SecI != SecE; ++SecI) {
     ++SectionNumber;
     const coff_section *Section = Obj->getCOFFSection(SecI);
@@ -845,16 +845,16 @@ void COFFDumper::printSections() {
 
     if (opts::SectionRelocations) {
       ListScope D(W, "Relocations");
-      for (relocation_iterator RelI = SecI->begin_relocations(),
-                               RelE = SecI->end_relocations();
+      for (relocation_iterator RelI = SecI->relocation_begin(),
+                               RelE = SecI->relocation_end();
            RelI != RelE; ++RelI)
         printRelocation(SecI, RelI);
     }
 
     if (opts::SectionSymbols) {
       ListScope D(W, "Symbols");
-      for (symbol_iterator SymI = Obj->begin_symbols(),
-                           SymE = Obj->end_symbols();
+      for (symbol_iterator SymI = Obj->symbol_begin(),
+                           SymE = Obj->symbol_end();
            SymI != SymE; ++SymI) {
         bool Contained = false;
         if (SecI->containsSymbol(*SymI, Contained) || !Contained)
@@ -880,8 +880,8 @@ void COFFDumper::printRelocations() {
   ListScope D(W, "Relocations");
 
   int SectionNumber = 0;
-  for (section_iterator SecI = Obj->begin_sections(),
-                        SecE = Obj->end_sections();
+  for (section_iterator SecI = Obj->section_begin(),
+                        SecE = Obj->section_end();
                         SecI != SecE; ++SecI) {
     ++SectionNumber;
     StringRef Name;
@@ -889,8 +889,8 @@ void COFFDumper::printRelocations() {
       continue;
 
     bool PrintedGroup = false;
-    for (relocation_iterator RelI = SecI->begin_relocations(),
-                             RelE = SecI->end_relocations();
+    for (relocation_iterator RelI = SecI->relocation_begin(),
+                             RelE = SecI->relocation_end();
          RelI != RelE; ++RelI) {
       if (!PrintedGroup) {
         W.startLine() << "Section (" << SectionNumber << ") " << Name << " {\n";
@@ -939,7 +939,7 @@ void COFFDumper::printRelocation(section_iterator SecI,
 void COFFDumper::printSymbols() {
   ListScope Group(W, "Symbols");
 
-  for (symbol_iterator SymI = Obj->begin_symbols(), SymE = Obj->end_symbols();
+  for (symbol_iterator SymI = Obj->symbol_begin(), SymE = Obj->symbol_end();
        SymI != SymE; ++SymI)
     printSymbol(SymI);
 }
@@ -1087,8 +1087,8 @@ void COFFDumper::printUnwindInfo() {
 }
 
 void COFFDumper::printX64UnwindInfo() {
-  for (section_iterator SecI = Obj->begin_sections(),
-                        SecE = Obj->end_sections();
+  for (section_iterator SecI = Obj->section_begin(),
+                        SecE = Obj->section_end();
        SecI != SecE; ++SecI) {
     StringRef Name;
     if (error(SecI->getName(Name)))
index af76901a3f1c863940e798a144d5cd670e9e2808..ef699b30bf752eff707212ca00910f97e546d950 100644 (file)
@@ -222,8 +222,8 @@ void MachODumper::printSections(const MachOObjectFile *Obj) {
   ListScope Group(W, "Sections");
 
   int SectionIndex = -1;
-  for (section_iterator SecI = Obj->begin_sections(),
-                        SecE = Obj->end_sections();
+  for (section_iterator SecI = Obj->section_begin(),
+                        SecE = Obj->section_end();
        SecI != SecE; ++SecI) {
     ++SectionIndex;
 
@@ -258,16 +258,16 @@ void MachODumper::printSections(const MachOObjectFile *Obj) {
 
     if (opts::SectionRelocations) {
       ListScope D(W, "Relocations");
-      for (relocation_iterator RelI = SecI->begin_relocations(),
-                               RelE = SecI->end_relocations();
+      for (relocation_iterator RelI = SecI->relocation_begin(),
+                               RelE = SecI->relocation_end();
            RelI != RelE; ++RelI)
         printRelocation(SecI, RelI);
     }
 
     if (opts::SectionSymbols) {
       ListScope D(W, "Symbols");
-      for (symbol_iterator SymI = Obj->begin_symbols(),
-                           SymE = Obj->end_symbols();
+      for (symbol_iterator SymI = Obj->symbol_begin(),
+                           SymE = Obj->symbol_end();
            SymI != SymE; ++SymI) {
         bool Contained = false;
         if (SecI->containsSymbol(*SymI, Contained) || !Contained)
@@ -290,16 +290,16 @@ void MachODumper::printRelocations() {
   ListScope D(W, "Relocations");
 
   error_code EC;
-  for (section_iterator SecI = Obj->begin_sections(),
-                        SecE = Obj->end_sections();
+  for (section_iterator SecI = Obj->section_begin(),
+                        SecE = Obj->section_end();
        SecI != SecE; ++SecI) {
     StringRef Name;
     if (error(SecI->getName(Name)))
       continue;
 
     bool PrintedGroup = false;
-    for (relocation_iterator RelI = SecI->begin_relocations(),
-                             RelE = SecI->end_relocations();
+    for (relocation_iterator RelI = SecI->relocation_begin(),
+                             RelE = SecI->relocation_end();
          RelI != RelE; ++RelI) {
       if (!PrintedGroup) {
         W.startLine() << "Section " << Name << " {\n";
@@ -331,7 +331,7 @@ void MachODumper::printRelocation(const MachOObjectFile *Obj,
   if (error(RelI->getOffset(Offset))) return;
   if (error(RelI->getTypeName(RelocName))) return;
   symbol_iterator Symbol = RelI->getSymbol();
-  if (Symbol != Obj->end_symbols() &&
+  if (Symbol != Obj->symbol_end() &&
       error(Symbol->getName(SymbolName)))
     return;
 
@@ -370,7 +370,7 @@ void MachODumper::printRelocation(const MachOObjectFile *Obj,
 void MachODumper::printSymbols() {
   ListScope Group(W, "Symbols");
 
-  for (symbol_iterator SymI = Obj->begin_symbols(), SymE = Obj->end_symbols();
+  for (symbol_iterator SymI = Obj->symbol_begin(), SymE = Obj->symbol_end();
        SymI != SymE; ++SymI) {
     printSymbol(SymI);
   }
@@ -389,9 +389,9 @@ void MachODumper::printSymbol(symbol_iterator SymI) {
   getSymbol(Obj, SymI->getRawDataRefImpl(), Symbol);
 
   StringRef SectionName = "";
-  section_iterator SecI(Obj->end_sections());
+  section_iterator SecI(Obj->section_begin());
   if (!error(SymI->getSection(SecI)) &&
-      SecI != Obj->end_sections())
+      SecI != Obj->section_end())
       error(SecI->getName(SectionName));
 
   DictScope D(W, "Symbol");
index f46bf6b4a204172f24fac2f746b2b26e09b1380a..c2d24462758b02034075da7a3b22f295769d5f5c 100644 (file)
@@ -111,7 +111,7 @@ static void PrintObjectSectionSizes(ObjectFile *o) {
     std::size_t max_name_len = strlen("section");
     std::size_t max_size_len = strlen("size");
     std::size_t max_addr_len = strlen("addr");
-    for (section_iterator i = o->begin_sections(), e = o->end_sections();
+    for (section_iterator i = o->section_begin(), e = o->section_end();
          i != e; ++i) {
       uint64_t size = 0;
       if (error(i->getSize(size)))
@@ -150,7 +150,7 @@ static void PrintObjectSectionSizes(ObjectFile *o) {
         << "%#" << max_addr_len << radix_fmt << "\n";
 
     // Print each section.
-    for (section_iterator i = o->begin_sections(), e = o->end_sections();
+    for (section_iterator i = o->section_begin(), e = o->section_end();
          i != e; ++i) {
       StringRef name;
       uint64_t size = 0;
@@ -181,7 +181,7 @@ static void PrintObjectSectionSizes(ObjectFile *o) {
     uint64_t total_bss = 0;
 
     // Make one pass over the section table to calculate sizes.
-    for (section_iterator i = o->begin_sections(), e = o->end_sections();
+    for (section_iterator i = o->section_begin(), e = o->section_end();
          i != e; ++i) {
       uint64_t size = 0;
       bool isText = false;
index 40751998579c7bce7bbad48685c31349a312a556..9f329a6de61a77bac28f233d5005fa7404cdc78e 100644 (file)
@@ -52,7 +52,7 @@ static void patchFunctionNameInDILineInfo(const std::string &NewFunctionName,
 
 ModuleInfo::ModuleInfo(ObjectFile *Obj, DIContext *DICtx)
     : Module(Obj), DebugInfoContext(DICtx) {
-  for (symbol_iterator si = Module->begin_symbols(), se = Module->end_symbols();
+  for (symbol_iterator si = Module->symbol_begin(), se = Module->symbol_end();
        si != se; ++si) {
     SymbolRef::Type SymbolType;
     if (error(si->getType(SymbolType)))
@@ -265,7 +265,7 @@ static bool getGNUDebuglinkContents(const Binary *Bin, std::string &DebugName,
   const ObjectFile *Obj = dyn_cast<ObjectFile>(Bin);
   if (!Obj)
     return false;
-  for (section_iterator I = Obj->begin_sections(), E = Obj->end_sections();
+  for (section_iterator I = Obj->section_begin(), E = Obj->section_end();
        I != E; ++I) {
     StringRef Name;
     I->getName(Name);
index f2f4b8c70f0df47a4eabedad7f0a0b2a3f176f91..dbb2700b77e5e79f8c0e5cbde8f84c4be2832cd0 100644 (file)
@@ -202,7 +202,7 @@ static int DumpSymtabCommand(const MachOObjectFile &Obj) {
   // Dump the symbol table.
   outs() << "  ('_symbols', [\n";
   unsigned SymNum = 0;
-  for (symbol_iterator I = Obj.begin_symbols(), E = Obj.end_symbols(); I != E;
+  for (symbol_iterator I = Obj.symbol_begin(), E = Obj.symbol_end(); I != E;
        ++I, ++SymNum) {
     DataRefImpl DRI = I->getRawDataRefImpl();
     if (Obj.is64Bit()) {
index 47ccfb77000dfa1160d3558ca9283e178412f2c9..8fdd4aee0c9f05c8a5d3e4027733e0a21a49d5a2 100644 (file)
@@ -51,8 +51,8 @@ void COFFDumper::dumpHeader(const object::coff_file_header *Header) {
 
 void COFFDumper::dumpSections(unsigned NumSections) {
   std::vector<COFFYAML::Section> &Sections = YAMLObj.Sections;
-  for (object::section_iterator iter = Obj.begin_sections();
-       iter != Obj.end_sections(); ++iter) {
+  for (object::section_iterator iter = Obj.section_begin();
+       iter != Obj.section_end(); ++iter) {
     const object::coff_section *Sect = Obj.getCOFFSection(iter);
     COFFYAML::Section Sec;
     Sec.Name = Sect->Name; // FIXME: check the null termination!
@@ -65,8 +65,8 @@ void COFFDumper::dumpSections(unsigned NumSections) {
     Sec.SectionData = object::yaml::BinaryRef(sectionData);
 
     std::vector<COFFYAML::Relocation> Relocations;
-    for (object::relocation_iterator rIter = iter->begin_relocations();
-                       rIter != iter->end_relocations(); ++rIter) {
+    for (object::relocation_iterator rIter = iter->relocation_begin();
+                       rIter != iter->relocation_end(); ++rIter) {
       const object::coff_relocation *reloc = Obj.getCOFFRelocation(rIter);
       COFFYAML::Relocation Rel;
       object::symbol_iterator Sym = rIter->getSymbol();
@@ -82,8 +82,8 @@ void COFFDumper::dumpSections(unsigned NumSections) {
 
 void COFFDumper::dumpSymbols(unsigned NumSymbols) {
   std::vector<COFFYAML::Symbol> &Symbols = YAMLObj.Symbols;
-  for (object::symbol_iterator iter = Obj.begin_symbols();
-       iter != Obj.end_symbols(); ++iter) {
+  for (object::symbol_iterator iter = Obj.symbol_begin();
+       iter != Obj.symbol_end(); ++iter) {
     const object::coff_symbol *Symbol = Obj.getCOFFSymbol(iter);
     COFFYAML::Symbol Sym;
     Obj.getSymbolName(Symbol, Sym.Name);