[lld] r251644 - [ELF2] merge-string.s test fixed for win32 configuration.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 12:30:29 PDT 2015


Author: grimar
Date: Thu Oct 29 14:30:28 2015
New Revision: 251644

URL: http://llvm.org/viewvc/llvm-project?rev=251644&view=rev
Log:
[ELF2] merge-string.s test fixed for win32 configuration.

Differential revision: http://reviews.llvm.org/D14171

Modified:
    lld/trunk/ELF/InputSection.cpp
    lld/trunk/ELF/InputSection.h

Modified: lld/trunk/ELF/InputSection.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.cpp?rev=251644&r1=251643&r2=251644&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.cpp (original)
+++ lld/trunk/ELF/InputSection.cpp Thu Oct 29 14:30:28 2015
@@ -164,7 +164,7 @@ MergeInputSection<ELFT>::getOffset(uintX
   // Find the element this offset points to.
   auto I = std::upper_bound(
       this->Offsets.begin(), this->Offsets.end(), Offset,
-      [](const uintX_t &A, const std::pair<uintX_t, uintX_t> &B) {
+      [](const uintX_t &A, const std::pair<uintX_t, size_t> &B) {
         return A < B.first;
       });
   size_t End = I == this->Offsets.end() ? Data.size() : I->first;
@@ -173,8 +173,8 @@ MergeInputSection<ELFT>::getOffset(uintX
 
   // Compute the Addend and if the Base is cached, return.
   uintX_t Addend = Offset - Start;
-  uintX_t &Base = I->second;
-  if (Base != uintX_t(-1))
+  size_t &Base = I->second;
+  if (Base != size_t(-1))
     return Base + Addend;
 
   // Map the base to the offset in the output section and cashe it.

Modified: lld/trunk/ELF/InputSection.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/InputSection.h?rev=251644&r1=251643&r2=251644&view=diff
==============================================================================
--- lld/trunk/ELF/InputSection.h (original)
+++ lld/trunk/ELF/InputSection.h Thu Oct 29 14:30:28 2015
@@ -84,7 +84,7 @@ template <class ELFT> class MergeInputSe
   typedef typename llvm::object::ELFFile<ELFT>::Elf_Shdr Elf_Shdr;
 
 public:
-  std::vector<std::pair<uintX_t, uintX_t>> Offsets;
+  std::vector<std::pair<uintX_t, size_t>> Offsets;
   MergeInputSection(ObjectFile<ELFT> *F, const Elf_Shdr *Header);
   static bool classof(const InputSectionBase<ELFT> *S);
   // Translate an offset in the input section to an offset in the output




More information about the llvm-commits mailing list