[PATCH] D14171: [ELF2] merge-string.s test fixed for win32 configuraton.

Rui Ueyama via llvm-commits llvm-commits at lists.llvm.org
Thu Oct 29 11:42:37 PDT 2015


ruiu added a comment.

LGTM. That's I think that's not super important but meaningful discussion.
:)
2015/10/29 10:10 "George Rimar" <grimar at accesssoftek.com>:

> grimar updated this revision to Diff 38745.

>  grimar added a comment.

> 

> Review comment addressed.

> 

> http://reviews.llvm.org/D14171

> 

> Files:

> 

>   ELF/InputSection.cpp

>   ELF/InputSection.h

> 

> Index: ELF/InputSection.h

>  ===================================================================

> 

>   - ELF/InputSection.h +++ ELF/InputSection.h @@ -84,7 +84,7 @@ 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 Index: ELF/InputSection.cpp ===================================================================

>   - ELF/InputSection.cpp +++ ELF/InputSection.cpp @@ -164,17 +164,17 @@ // 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; --I; uintX_t Start = I->first;

> 

>   // 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.

> 

> 



http://reviews.llvm.org/D14171





More information about the llvm-commits mailing list