summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2014-04-03 22:42:22 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2014-04-03 22:42:22 +0000
commit77314aa014599282f52c0f425b7b90d8ef9ad02f (patch)
tree3cc69d98f067850aa3883eda0c6838450b286c88 /llvm/lib
parent4f010d2f660f48df779163b8b88a864c3c4c2ceb (diff)
downloadbcm5719-llvm-77314aa014599282f52c0f425b7b90d8ef9ad02f.tar.gz
bcm5719-llvm-77314aa014599282f52c0f425b7b90d8ef9ad02f.zip
Remove section_rel_empty. Just compare begin() and end() instead.
llvm-svn: 205577
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp8
-rw-r--r--llvm/lib/Object/COFFObjectFile.cpp5
-rw-r--r--llvm/lib/Object/MachOObjectFile.cpp10
3 files changed, 5 insertions, 18 deletions
diff --git a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
index 986d3a0a354..ea5d709e358 100644
--- a/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
+++ b/llvm/lib/ExecutionEngine/RuntimeDyld/RuntimeDyld.cpp
@@ -163,7 +163,10 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
StubMap Stubs;
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;
bool IsCode = false;
@@ -172,8 +175,7 @@ ObjectImage *RuntimeDyldImpl::loadObject(ObjectImage *InputObject) {
findOrEmitSection(*Obj, *RelocatedSection, IsCode, LocalSections);
DEBUG(dbgs() << "\tSectionID: " << SectionID << "\n");
- for (relocation_iterator I = SI->relocation_begin(),
- E = SI->relocation_end(); I != E;)
+ for (; I != E;)
I = processRelocationRef(SectionID, I, *Obj, LocalSections, LocalSymbols,
Stubs);
}
diff --git a/llvm/lib/Object/COFFObjectFile.cpp b/llvm/lib/Object/COFFObjectFile.cpp
index a75ebbf2a7c..27a491a84d9 100644
--- a/llvm/lib/Object/COFFObjectFile.cpp
+++ b/llvm/lib/Object/COFFObjectFile.cpp
@@ -389,11 +389,6 @@ relocation_iterator COFFObjectFile::section_rel_end(DataRefImpl Ref) const {
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.
error_code COFFObjectFile::initSymbolTablePtr() {
if (error_code EC = getObject(
diff --git a/llvm/lib/Object/MachOObjectFile.cpp b/llvm/lib/Object/MachOObjectFile.cpp
index 12132a4b0c6..0f519da92fc 100644
--- a/llvm/lib/Object/MachOObjectFile.cpp
+++ b/llvm/lib/Object/MachOObjectFile.cpp
@@ -791,16 +791,6 @@ MachOObjectFile::section_rel_end(DataRefImpl Sec) const {
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 {
const MachO::any_relocation_info *P =
reinterpret_cast<const MachO::any_relocation_info *>(Rel.p);
OpenPOWER on IntegriCloud