llvm.org GIT mirror llvm / 2955222
Object/COFF: Rename getXXX{Begin,End} -> xxx_{begin,end}. It is mentioned in the LLVM coding standard that _begin() and _end() suffixes should be used. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@191569 91177308-0d34-0410-b5e6-96231b3b80d8 Rui Ueyama 7 years ago
8 changed file(s) with 32 addition(s) and 32 deletion(s). Raw diff Collapse all Expand all
268268 bool &Res) const;
269269 virtual error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
270270 bool &Result) const;
271 virtual relocation_iterator getSectionRelBegin(DataRefImpl Sec) const;
272 virtual relocation_iterator getSectionRelEnd(DataRefImpl Sec) const;
271 virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const;
272 virtual relocation_iterator section_rel_end(DataRefImpl Sec) const;
273273
274274 virtual error_code getRelocationNext(DataRefImpl Rel,
275275 RelocationRef &Res) const;
310310 virtual unsigned getArch() const;
311311 virtual StringRef getLoadName() const;
312312
313 import_directory_iterator getImportDirectoryBegin() const;
314 import_directory_iterator getImportDirectoryEnd() const;
313 import_directory_iterator import_directory_begin() const;
314 import_directory_iterator import_directory_end() const;
315315
316316 error_code getHeader(const coff_file_header *&Res) const;
317317 error_code getCOFFHeader(const coff_file_header *&Res) const;
8686 virtual error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const;
8787 virtual error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
8888 bool &Result) const;
89 virtual relocation_iterator getSectionRelBegin(DataRefImpl Sec) const;
90 virtual relocation_iterator getSectionRelEnd(DataRefImpl Sec) const;
89 virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const;
90 virtual relocation_iterator section_rel_end(DataRefImpl Sec) const;
9191 virtual section_iterator getRelocatedSection(DataRefImpl Sec) const;
9292
9393 virtual error_code getRelocationNext(DataRefImpl Rel,
610610
611611 template
612612 relocation_iterator
613 ELFObjectFile::getSectionRelBegin(DataRefImpl Sec) const {
613 ELFObjectFile::section_rel_begin(DataRefImpl Sec) const {
614614 DataRefImpl RelData;
615615 uintptr_t SHT = reinterpret_cast(EF.begin_sections().get());
616616 RelData.d.a = (Sec.p - SHT) / EF.getHeader()->e_shentsize;
620620
621621 template
622622 relocation_iterator
623 ELFObjectFile::getSectionRelEnd(DataRefImpl Sec) const {
623 ELFObjectFile::section_rel_end(DataRefImpl Sec) const {
624624 DataRefImpl RelData;
625625 uintptr_t SHT = reinterpret_cast(EF.begin_sections().get());
626626 const Elf_Shdr *S = reinterpret_cast(Sec.p);
8888 virtual error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const;
8989 virtual error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
9090 bool &Result) const;
91 virtual relocation_iterator getSectionRelBegin(DataRefImpl Sec) const;
92 virtual relocation_iterator getSectionRelEnd(DataRefImpl Sec) const;
91 virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const;
92 virtual relocation_iterator section_rel_end(DataRefImpl Sec) const;
9393
9494 virtual error_code getRelocationNext(DataRefImpl Rel,
9595 RelocationRef &Res) const;
128128
129129 virtual StringRef getLoadName() const;
130130
131 relocation_iterator getSectionRelBegin(unsigned Index) const;
132 relocation_iterator getSectionRelEnd(unsigned Index) const;
131 relocation_iterator section_rel_begin(unsigned Index) const;
132 relocation_iterator section_rel_end(unsigned Index) const;
133133
134134 dice_iterator begin_dices() const;
135135 dice_iterator end_dices() const;
321321 virtual error_code isSectionReadOnlyData(DataRefImpl Sec, bool &Res) const =0;
322322 virtual error_code sectionContainsSymbol(DataRefImpl Sec, DataRefImpl Symb,
323323 bool &Result) const = 0;
324 virtual relocation_iterator getSectionRelBegin(DataRefImpl Sec) const = 0;
325 virtual relocation_iterator getSectionRelEnd(DataRefImpl Sec) const = 0;
324 virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const = 0;
325 virtual relocation_iterator section_rel_end(DataRefImpl Sec) const = 0;
326326 virtual section_iterator getRelocatedSection(DataRefImpl Sec) const;
327327
328328 // Same as above for RelocationRef.
527527 }
528528
529529 inline relocation_iterator SectionRef::begin_relocations() const {
530 return OwningObject->getSectionRelBegin(SectionPimpl);
530 return OwningObject->section_rel_begin(SectionPimpl);
531531 }
532532
533533 inline relocation_iterator SectionRef::end_relocations() const {
534 return OwningObject->getSectionRelEnd(SectionPimpl);
534 return OwningObject->section_rel_end(SectionPimpl);
535535 }
536536
537537 inline section_iterator SectionRef::getRelocatedSection() const {
405405 return object_error::success;
406406 }
407407
408 relocation_iterator COFFObjectFile::getSectionRelBegin(DataRefImpl Sec) const {
408 relocation_iterator COFFObjectFile::section_rel_begin(DataRefImpl Sec) const {
409409 const coff_section *sec = toSec(Sec);
410410 DataRefImpl ret;
411411 if (sec->NumberOfRelocations == 0)
416416 return relocation_iterator(RelocationRef(ret, this));
417417 }
418418
419 relocation_iterator COFFObjectFile::getSectionRelEnd(DataRefImpl Sec) const {
419 relocation_iterator COFFObjectFile::section_rel_end(DataRefImpl Sec) const {
420420 const coff_section *sec = toSec(Sec);
421421 DataRefImpl ret;
422422 if (sec->NumberOfRelocations == 0)
629629 return "";
630630 }
631631
632 import_directory_iterator COFFObjectFile::getImportDirectoryBegin() const {
632 import_directory_iterator COFFObjectFile::import_directory_begin() const {
633633 DataRefImpl Imp;
634634 Imp.p = reinterpret_cast(ImportDirectory);
635635 return import_directory_iterator(ImportDirectoryEntryRef(Imp, this));
636636 }
637637
638 import_directory_iterator COFFObjectFile::getImportDirectoryEnd() const {
638 import_directory_iterator COFFObjectFile::import_directory_end() const {
639639 DataRefImpl Imp;
640640 if (ImportDirectory) {
641641 Imp.p = reinterpret_cast(
822822 return object_error::success;
823823 }
824824
825 relocation_iterator MachOObjectFile::getSectionRelBegin(DataRefImpl Sec) const {
825 relocation_iterator MachOObjectFile::section_rel_begin(DataRefImpl Sec) const {
826826 uint32_t Offset;
827827 if (is64Bit()) {
828828 MachO::section_64 Sect = getSection64(Sec);
838838 }
839839
840840 relocation_iterator
841 MachOObjectFile::getSectionRelEnd(DataRefImpl Sec) const {
841 MachOObjectFile::section_rel_end(DataRefImpl Sec) const {
842842 uint32_t Offset;
843843 uint32_t Num;
844844 if (is64Bit()) {
13301330 report_fatal_error("get_load_name() unimplemented in MachOObjectFile");
13311331 }
13321332
1333 relocation_iterator MachOObjectFile::getSectionRelBegin(unsigned Index) const {
1333 relocation_iterator MachOObjectFile::section_rel_begin(unsigned Index) const {
13341334 DataRefImpl DRI;
13351335 DRI.d.a = Index;
1336 return getSectionRelBegin(DRI);
1337 }
1338
1339 relocation_iterator MachOObjectFile::getSectionRelEnd(unsigned Index) const {
1336 return section_rel_begin(DRI);
1337 }
1338
1339 relocation_iterator MachOObjectFile::section_rel_end(unsigned Index) const {
13401340 DataRefImpl DRI;
13411341 DRI.d.a = Index;
1342 return getSectionRelEnd(DRI);
1342 return section_rel_end(DRI);
13431343 }
13441344
13451345 dice_iterator MachOObjectFile::begin_dices() const {
231231 static void printImportTables(const COFFObjectFile *Obj) {
232232 outs() << "The Import Tables:\n";
233233 error_code ec;
234 for (import_directory_iterator i = Obj->getImportDirectoryBegin(),
235 e = Obj->getImportDirectoryEnd();
234 for (import_directory_iterator i = Obj->import_directory_begin(),
235 e = Obj->import_directory_end();
236236 i != e; i = i.increment(ec)) {
237237 if (ec)
238238 return;
9696 outs() << " ('_relocations', [\n";
9797 unsigned RelNum = 0;
9898 error_code EC;
99 for (relocation_iterator I = Obj.getSectionRelBegin(Index),
100 E = Obj.getSectionRelEnd(Index); I != E; I.increment(EC), ++RelNum) {
99 for (relocation_iterator I = Obj.section_rel_begin(Index),
100 E = Obj.section_rel_end(Index); I != E; I.increment(EC), ++RelNum) {
101101 MachO::any_relocation_info RE = Obj.getRelocation(I->getRawDataRefImpl());
102102 outs() << " # Relocation " << RelNum << "\n";
103103 outs() << " (('word-0', " << format("0x%x", RE.r_word0) << "),\n";