summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRafael Espindola <rafael.espindola@gmail.com>2016-04-05 14:47:28 +0000
committerRafael Espindola <rafael.espindola@gmail.com>2016-04-05 14:47:28 +0000
commit0f7ccc3d925bc57803f6e559a6d3eac044f7c561 (patch)
tree4de01a1d3f2ce839a48a0051c45b07c36672c2c8
parentaafcf758c9ca2da3f0643de21467e74eb5b58174 (diff)
downloadbcm5719-llvm-0f7ccc3d925bc57803f6e559a6d3eac044f7c561.tar.gz
bcm5719-llvm-0f7ccc3d925bc57803f6e559a6d3eac044f7c561.zip
Update for llvm change.
llvm-svn: 265404
-rw-r--r--lld/ELF/ICF.cpp16
-rw-r--r--lld/ELF/InputFiles.cpp4
-rw-r--r--lld/ELF/InputSection.cpp5
-rw-r--r--lld/ELF/InputSection.h5
-rw-r--r--lld/ELF/OutputSections.cpp4
-rw-r--r--lld/ELF/OutputSections.h3
-rw-r--r--lld/ELF/Writer.cpp10
7 files changed, 19 insertions, 28 deletions
diff --git a/lld/ELF/ICF.cpp b/lld/ELF/ICF.cpp
index a69acdd1901..5c950ddfaeb 100644
--- a/lld/ELF/ICF.cpp
+++ b/lld/ELF/ICF.cpp
@@ -102,14 +102,12 @@ private:
void forEachGroup(std::vector<InputSection<ELFT> *> &V, Comparator Eq);
template <class RelTy>
- static bool relocationEq(iterator_range<const RelTy *> RA,
- iterator_range<const RelTy *> RB);
+ static bool relocationEq(ArrayRef<RelTy> RA, ArrayRef<RelTy> RB);
template <class RelTy>
static bool variableEq(const InputSection<ELFT> *A,
- const InputSection<ELFT> *B,
- iterator_range<const RelTy *> RA,
- iterator_range<const RelTy *> RB);
+ const InputSection<ELFT> *B, ArrayRef<RelTy> RA,
+ ArrayRef<RelTy> RB);
static bool equalsConstant(const InputSection<ELFT> *A,
const InputSection<ELFT> *B);
@@ -206,8 +204,7 @@ void ICF<ELFT>::forEachGroup(std::vector<InputSection<ELFT> *> &V,
// Compare two lists of relocations.
template <class ELFT>
template <class RelTy>
-bool ICF<ELFT>::relocationEq(iterator_range<const RelTy *> RelsA,
- iterator_range<const RelTy *> RelsB) {
+bool ICF<ELFT>::relocationEq(ArrayRef<RelTy> RelsA, ArrayRef<RelTy> RelsB) {
const RelTy *IA = RelsA.begin();
const RelTy *EA = RelsA.end();
const RelTy *IB = RelsB.begin();
@@ -252,9 +249,8 @@ bool ICF<ELFT>::equalsConstant(const InputSection<ELFT> *A,
template <class ELFT>
template <class RelTy>
bool ICF<ELFT>::variableEq(const InputSection<ELFT> *A,
- const InputSection<ELFT> *B,
- iterator_range<const RelTy *> RelsA,
- iterator_range<const RelTy *> RelsB) {
+ const InputSection<ELFT> *B, ArrayRef<RelTy> RelsA,
+ ArrayRef<RelTy> RelsB) {
const RelTy *IA = RelsA.begin();
const RelTy *EA = RelsA.end();
const RelTy *IB = RelsB.begin();
diff --git a/lld/ELF/InputFiles.cpp b/lld/ELF/InputFiles.cpp
index e58814de57a..02f8e52d22b 100644
--- a/lld/ELF/InputFiles.cpp
+++ b/lld/ELF/InputFiles.cpp
@@ -55,8 +55,8 @@ typename ELFT::SymRange ELFFileBase<ELFT>::getElfSymbols(bool OnlyGlobals) {
fatal("invalid sh_info in symbol table");
if (OnlyGlobals)
- return make_range(Syms.begin() + FirstNonLocal, Syms.end());
- return make_range(Syms.begin(), Syms.end());
+ return makeArrayRef(Syms.begin() + FirstNonLocal, Syms.end());
+ return makeArrayRef(Syms.begin(), Syms.end());
}
template <class ELFT>
diff --git a/lld/ELF/InputSection.cpp b/lld/ELF/InputSection.cpp
index d0077399530..c641957c6d4 100644
--- a/lld/ELF/InputSection.cpp
+++ b/lld/ELF/InputSection.cpp
@@ -131,8 +131,7 @@ template <class ELFT> uint64_t InputSection<ELFT>::getThunksSize() const {
// copy relocations one by one.
template <class ELFT>
template <class RelTy>
-void InputSection<ELFT>::copyRelocations(uint8_t *Buf,
- iterator_range<const RelTy *> Rels) {
+void InputSection<ELFT>::copyRelocations(uint8_t *Buf, ArrayRef<RelTy> Rels) {
InputSectionBase<ELFT> *RelocatedSection = getRelocatedSection();
for (const RelTy &Rel : Rels) {
@@ -242,7 +241,7 @@ static uintX_t getMipsGotVA(const SymbolBody &Body, uintX_t SymVA,
template <class ELFT>
template <class RelTy>
void InputSectionBase<ELFT>::relocate(uint8_t *Buf, uint8_t *BufEnd,
- iterator_range<const RelTy *> Rels) {
+ ArrayRef<RelTy> Rels) {
size_t Num = Rels.end() - Rels.begin();
for (size_t I = 0; I < Num; ++I) {
const RelTy &RI = *(Rels.begin() + I);
diff --git a/lld/ELF/InputSection.h b/lld/ELF/InputSection.h
index 9064abbf31a..c69026e9bc7 100644
--- a/lld/ELF/InputSection.h
+++ b/lld/ELF/InputSection.h
@@ -79,8 +79,7 @@ public:
InputSectionBase<ELFT> *getRelocTarget(const Elf_Rela &Rel) const;
template <class RelTy>
- void relocate(uint8_t *Buf, uint8_t *BufEnd,
- llvm::iterator_range<const RelTy *> Rels);
+ void relocate(uint8_t *Buf, uint8_t *BufEnd, llvm::ArrayRef<RelTy> Rels);
private:
template <class RelTy>
@@ -181,7 +180,7 @@ public:
private:
template <class RelTy>
- void copyRelocations(uint8_t *Buf, llvm::iterator_range<const RelTy *> Rels);
+ void copyRelocations(uint8_t *Buf, llvm::ArrayRef<RelTy> Rels);
// Called by ICF to merge two input sections.
void replace(InputSection<ELFT> *Other);
diff --git a/lld/ELF/OutputSections.cpp b/lld/ELF/OutputSections.cpp
index 7617585a803..7e96c82eae6 100644
--- a/lld/ELF/OutputSections.cpp
+++ b/lld/ELF/OutputSections.cpp
@@ -1100,7 +1100,7 @@ static typename ELFT::uint readEntryLength(ArrayRef<uint8_t> D) {
template <class ELFT>
template <class RelTy>
void EHOutputSection<ELFT>::addSectionAux(EHInputSection<ELFT> *S,
- iterator_range<const RelTy *> Rels) {
+ ArrayRef<RelTy> Rels) {
const endianness E = ELFT::TargetEndianness;
S->OutSec = this;
@@ -1175,7 +1175,7 @@ void EHOutputSection<ELFT>::addSection(InputSectionBase<ELFT> *C) {
auto *S = cast<EHInputSection<ELFT>>(C);
const Elf_Shdr *RelSec = S->RelocSection;
if (!RelSec) {
- addSectionAux(S, make_range<const Elf_Rela *>(nullptr, nullptr));
+ addSectionAux(S, makeArrayRef<Elf_Rela>(nullptr, nullptr));
return;
}
ELFFile<ELFT> &Obj = S->getFile()->getObj();
diff --git a/lld/ELF/OutputSections.h b/lld/ELF/OutputSections.h
index b066a958df3..8a48ba8e193 100644
--- a/lld/ELF/OutputSections.h
+++ b/lld/ELF/OutputSections.h
@@ -323,8 +323,7 @@ public:
void writeTo(uint8_t *Buf) override;
template <class RelTy>
- void addSectionAux(EHInputSection<ELFT> *S,
- llvm::iterator_range<const RelTy *> Rels);
+ void addSectionAux(EHInputSection<ELFT> *S, llvm::ArrayRef<RelTy> Rels);
void addSection(InputSectionBase<ELFT> *S) override;
diff --git a/lld/ELF/Writer.cpp b/lld/ELF/Writer.cpp
index dfb4380a268..e6806c79697 100644
--- a/lld/ELF/Writer.cpp
+++ b/lld/ELF/Writer.cpp
@@ -67,8 +67,7 @@ private:
bool needsGot();
template <class RelTy>
- void scanRelocs(InputSectionBase<ELFT> &C,
- iterator_range<const RelTy *> Rels);
+ void scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels);
void scanRelocs(InputSection<ELFT> &C);
void scanRelocs(InputSectionBase<ELFT> &S, const Elf_Shdr &RelSec);
@@ -92,7 +91,7 @@ private:
}
template <class RelTy>
void scanRelocsForThunks(const elf::ObjectFile<ELFT> &File,
- iterator_range<const RelTy *> Rels);
+ ArrayRef<RelTy> Rels);
void ensureBss();
void addCommonSymbols(std::vector<DefinedCommon *> &Syms);
@@ -319,7 +318,7 @@ static unsigned handleTlsRelocation(uint32_t Type, SymbolBody &Body,
template <class ELFT>
template <class RelTy>
void Writer<ELFT>::scanRelocsForThunks(const elf::ObjectFile<ELFT> &File,
- iterator_range<const RelTy *> Rels) {
+ ArrayRef<RelTy> Rels) {
for (const RelTy &RI : Rels) {
uint32_t Type = RI.getType(Config->Mips64EL);
uint32_t SymIndex = RI.getSymbol(Config->Mips64EL);
@@ -347,8 +346,7 @@ void Writer<ELFT>::scanRelocsForThunks(const elf::ObjectFile<ELFT> &File,
// space for the extra PT_LOAD even if we end up not using it.
template <class ELFT>
template <class RelTy>
-void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C,
- iterator_range<const RelTy *> Rels) {
+void Writer<ELFT>::scanRelocs(InputSectionBase<ELFT> &C, ArrayRef<RelTy> Rels) {
const elf::ObjectFile<ELFT> &File = *C.getFile();
for (auto I = Rels.begin(), E = Rels.end(); I != E; ++I) {
const RelTy &RI = *I;
OpenPOWER on IntegriCloud