[lld] r265404 - Update for llvm change.

Rafael Espindola via llvm-commits llvm-commits at lists.llvm.org
Tue Apr 5 07:47:28 PDT 2016


Author: rafael
Date: Tue Apr  5 09:47:28 2016
New Revision: 265404

URL: http://llvm.org/viewvc/llvm-project?rev=265404&view=rev
Log:
Update for llvm change.

Modified:
    lld/trunk/ELF/ICF.cpp
    lld/trunk/ELF/InputFiles.cpp
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/InputSection.h
    lld/trunk/ELF/OutputSections.cpp
    lld/trunk/ELF/OutputSections.h
    lld/trunk/ELF/Writer.cpp

Modified: lld/trunk/ELF/ICF.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/ICF.cpp?rev=265404&r1=265403&r2=265404&view=diff
==============================================================================
--- lld/trunk/ELF/ICF.cpp (original)
+++ lld/trunk/ELF/ICF.cpp Tue Apr  5 09:47:28 2016
@@ -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
 // 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 Inp
 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();

Modified: lld/trunk/ELF/InputFiles.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputFiles.cpp?rev=265404&r1=265403&r2=265404&view=diff
==============================================================================
--- lld/trunk/ELF/InputFiles.cpp (original)
+++ lld/trunk/ELF/InputFiles.cpp Tue Apr  5 09:47:28 2016
@@ -55,8 +55,8 @@ typename ELFT::SymRange ELFFileBase<ELFT
     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>

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=265404&r1=265403&r2=265404&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Tue Apr  5 09:47:28 2016
@@ -131,8 +131,7 @@ template <class ELFT> uint64_t InputSect
 // 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 Symbol
 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);

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=265404&r1=265403&r2=265404&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Tue Apr  5 09:47:28 2016
@@ -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);

Modified: lld/trunk/ELF/OutputSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.cpp?rev=265404&r1=265403&r2=265404&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.cpp (original)
+++ lld/trunk/ELF/OutputSections.cpp Tue Apr  5 09:47:28 2016
@@ -1100,7 +1100,7 @@ static typename ELFT::uint readEntryLeng
 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(I
   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();

Modified: lld/trunk/ELF/OutputSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/OutputSections.h?rev=265404&r1=265403&r2=265404&view=diff
==============================================================================
--- lld/trunk/ELF/OutputSections.h (original)
+++ lld/trunk/ELF/OutputSections.h Tue Apr  5 09:47:28 2016
@@ -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;
 

Modified: lld/trunk/ELF/Writer.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/Writer.cpp?rev=265404&r1=265403&r2=265404&view=diff
==============================================================================
--- lld/trunk/ELF/Writer.cpp (original)
+++ lld/trunk/ELF/Writer.cpp Tue Apr  5 09:47:28 2016
@@ -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(uint
 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(c
 // 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;




More information about the llvm-commits mailing list