mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2024-12-13 20:32:21 +00:00
Remove section_rel_empty. Just compare begin() and end() instead.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@205577 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
parent
da7ea68f0d
commit
67c46d286f
@ -387,7 +387,6 @@ protected:
|
|||||||
bool &Result) const override;
|
bool &Result) const override;
|
||||||
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
|
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
|
||||||
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
||||||
bool section_rel_empty(DataRefImpl Sec) const override;
|
|
||||||
|
|
||||||
void moveRelocationNext(DataRefImpl &Rel) const override;
|
void moveRelocationNext(DataRefImpl &Rel) const override;
|
||||||
error_code getRelocationAddress(DataRefImpl Rel,
|
error_code getRelocationAddress(DataRefImpl Rel,
|
||||||
|
@ -89,7 +89,6 @@ protected:
|
|||||||
bool &Result) const override;
|
bool &Result) const override;
|
||||||
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
|
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
|
||||||
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
||||||
bool section_rel_empty(DataRefImpl Sec) const override;
|
|
||||||
section_iterator getRelocatedSection(DataRefImpl Sec) const override;
|
section_iterator getRelocatedSection(DataRefImpl Sec) const override;
|
||||||
|
|
||||||
void moveRelocationNext(DataRefImpl &Rel) const override;
|
void moveRelocationNext(DataRefImpl &Rel) const override;
|
||||||
@ -495,12 +494,6 @@ ELFObjectFile<ELFT>::section_rel_end(DataRefImpl Sec) const {
|
|||||||
return relocation_iterator(RelocationRef(RelData, this));
|
return relocation_iterator(RelocationRef(RelData, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
template <class ELFT>
|
|
||||||
bool ELFObjectFile<ELFT>::section_rel_empty(DataRefImpl Sec) const {
|
|
||||||
const Elf_Shdr *S = reinterpret_cast<const Elf_Shdr *>(Sec.p);
|
|
||||||
return S->sh_size == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
template <class ELFT>
|
template <class ELFT>
|
||||||
section_iterator
|
section_iterator
|
||||||
ELFObjectFile<ELFT>::getRelocatedSection(DataRefImpl Sec) const {
|
ELFObjectFile<ELFT>::getRelocatedSection(DataRefImpl Sec) const {
|
||||||
|
@ -88,7 +88,6 @@ public:
|
|||||||
bool &Result) const override;
|
bool &Result) const override;
|
||||||
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
|
relocation_iterator section_rel_begin(DataRefImpl Sec) const override;
|
||||||
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
relocation_iterator section_rel_end(DataRefImpl Sec) const override;
|
||||||
bool section_rel_empty(DataRefImpl Sec) const override;
|
|
||||||
|
|
||||||
void moveRelocationNext(DataRefImpl &Rel) const override;
|
void moveRelocationNext(DataRefImpl &Rel) const override;
|
||||||
error_code getRelocationAddress(DataRefImpl Rel,
|
error_code getRelocationAddress(DataRefImpl Rel,
|
||||||
|
@ -117,7 +117,6 @@ public:
|
|||||||
relocation_iterator_range relocations() const {
|
relocation_iterator_range relocations() const {
|
||||||
return relocation_iterator_range(relocation_begin(), relocation_end());
|
return relocation_iterator_range(relocation_begin(), relocation_end());
|
||||||
}
|
}
|
||||||
bool relocation_empty() const;
|
|
||||||
section_iterator getRelocatedSection() const;
|
section_iterator getRelocatedSection() const;
|
||||||
|
|
||||||
DataRefImpl getRawDataRefImpl() const;
|
DataRefImpl getRawDataRefImpl() const;
|
||||||
@ -256,7 +255,6 @@ protected:
|
|||||||
bool &Result) const = 0;
|
bool &Result) const = 0;
|
||||||
virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const = 0;
|
virtual relocation_iterator section_rel_begin(DataRefImpl Sec) const = 0;
|
||||||
virtual relocation_iterator section_rel_end(DataRefImpl Sec) const = 0;
|
virtual relocation_iterator section_rel_end(DataRefImpl Sec) const = 0;
|
||||||
virtual bool section_rel_empty(DataRefImpl Sec) const = 0;
|
|
||||||
virtual section_iterator getRelocatedSection(DataRefImpl Sec) const;
|
virtual section_iterator getRelocatedSection(DataRefImpl Sec) const;
|
||||||
|
|
||||||
// Same as above for RelocationRef.
|
// Same as above for RelocationRef.
|
||||||
@ -491,10 +489,6 @@ inline relocation_iterator SectionRef::relocation_end() const {
|
|||||||
return OwningObject->section_rel_end(SectionPimpl);
|
return OwningObject->section_rel_end(SectionPimpl);
|
||||||
}
|
}
|
||||||
|
|
||||||
inline bool SectionRef::relocation_empty() const {
|
|
||||||
return OwningObject->section_rel_empty(SectionPimpl);
|
|
||||||
}
|
|
||||||
|
|
||||||
inline section_iterator SectionRef::getRelocatedSection() const {
|
inline section_iterator SectionRef::getRelocatedSection() const {
|
||||||
return OwningObject->getRelocatedSection(SectionPimpl);
|
return OwningObject->getRelocatedSection(SectionPimpl);
|
||||||
}
|
}
|
||||||
|
@ -163,7 +163,10 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
|
|||||||
StubMap Stubs;
|
StubMap Stubs;
|
||||||
section_iterator RelocatedSection = SI->getRelocatedSection();
|
section_iterator RelocatedSection = SI->getRelocatedSection();
|
||||||
|
|
||||||
if (SI->relocation_empty() && !ProcessAllSections)
|
relocation_iterator I = SI->relocation_begin();
|
||||||
|
relocation_iterator E = SI->relocation_end();
|
||||||
|
|
||||||
|
if (I == E && !ProcessAllSections)
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
bool IsCode = false;
|
bool IsCode = false;
|
||||||
@ -172,8 +175,7 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
|
|||||||
findOrEmitSection(*Obj, *RelocatedSection, IsCode, LocalSections);
|
findOrEmitSection(*Obj, *RelocatedSection, IsCode, LocalSections);
|
||||||
DEBUG(dbgs() << "\tSectionID: " << SectionID << "\n");
|
DEBUG(dbgs() << "\tSectionID: " << SectionID << "\n");
|
||||||
|
|
||||||
for (relocation_iterator I = SI->relocation_begin(),
|
for (; I != E;)
|
||||||
E = SI->relocation_end(); I != E;)
|
|
||||||
I = processRelocationRef(SectionID, I, *Obj, LocalSections, LocalSymbols,
|
I = processRelocationRef(SectionID, I, *Obj, LocalSections, LocalSymbols,
|
||||||
Stubs);
|
Stubs);
|
||||||
}
|
}
|
||||||
|
@ -389,11 +389,6 @@ relocation_iterator COFFObjectFile::section_rel_end(DataRefImpl Ref) const {
|
|||||||
return relocation_iterator(RelocationRef(Ret, this));
|
return relocation_iterator(RelocationRef(Ret, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool COFFObjectFile::section_rel_empty(DataRefImpl Ref) const {
|
|
||||||
const coff_section *Sec = toSec(Ref);
|
|
||||||
return Sec->NumberOfRelocations == 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Initialize the pointer to the symbol table.
|
// Initialize the pointer to the symbol table.
|
||||||
error_code COFFObjectFile::initSymbolTablePtr() {
|
error_code COFFObjectFile::initSymbolTablePtr() {
|
||||||
if (error_code EC = getObject(
|
if (error_code EC = getObject(
|
||||||
|
@ -791,16 +791,6 @@ MachOObjectFile::section_rel_end(DataRefImpl Sec) const {
|
|||||||
return relocation_iterator(RelocationRef(Ret, this));
|
return relocation_iterator(RelocationRef(Ret, this));
|
||||||
}
|
}
|
||||||
|
|
||||||
bool MachOObjectFile::section_rel_empty(DataRefImpl Sec) const {
|
|
||||||
if (is64Bit()) {
|
|
||||||
MachO::section_64 Sect = getSection64(Sec);
|
|
||||||
return Sect.nreloc == 0;
|
|
||||||
} else {
|
|
||||||
MachO::section Sect = getSection(Sec);
|
|
||||||
return Sect.nreloc == 0;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const {
|
void MachOObjectFile::moveRelocationNext(DataRefImpl &Rel) const {
|
||||||
const MachO::any_relocation_info *P =
|
const MachO::any_relocation_info *P =
|
||||||
reinterpret_cast<const MachO::any_relocation_info *>(Rel.p);
|
reinterpret_cast<const MachO::any_relocation_info *>(Rel.p);
|
||||||
|
Loading…
Reference in New Issue
Block a user