[lld] r286065 - [ELF] - Change argument of computeHash to MutableArrayRef. NFC.

George Rimar via llvm-commits llvm-commits at lists.llvm.org
Sun Nov 6 01:39:47 PDT 2016


Author: grimar
Date: Sun Nov  6 02:39:46 2016
New Revision: 286065

URL: http://llvm.org/viewvc/llvm-project?rev=286065&view=rev
Log:
[ELF] - Change argument of computeHash to MutableArrayRef. NFC.

This fixes casting warning and removes the need of that cast at all.

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

Modified: lld/trunk/ELF/SyntheticSections.cpp
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.cpp?rev=286065&r1=286064&r2=286065&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.cpp (original)
+++ lld/trunk/ELF/SyntheticSections.cpp Sun Nov  6 02:39:46 2016
@@ -124,7 +124,7 @@ static std::vector<ArrayRef<uint8_t>> sp
 
 template <class ELFT>
 void BuildIdSection<ELFT>::computeHash(
-    llvm::ArrayRef<uint8_t> Data,
+    llvm::MutableArrayRef<uint8_t> Data,
     std::function<void(ArrayRef<uint8_t> Arr, uint8_t *Hash)> Hash) {
   std::vector<ArrayRef<uint8_t>> Chunks = split(Data, 1024 * 1024);
   std::vector<uint8_t> HashList(Chunks.size() * HashSize);
@@ -141,7 +141,7 @@ void BuildIdSection<ELFT>::computeHash(
       Hash(Chunk, HashList.data() + Id * HashSize);
     });
 
-  Hash(HashList, this->getOutputLoc((uint8_t *)Data.begin()) + 16);
+  Hash(HashList, this->getOutputLoc(Data.begin()) + 16);
 }
 
 template <class ELFT>

Modified: lld/trunk/ELF/SyntheticSections.h
URL: http://llvm.org/viewvc/llvm-project/lld/trunk/ELF/SyntheticSections.h?rev=286065&r1=286064&r2=286065&view=diff
==============================================================================
--- lld/trunk/ELF/SyntheticSections.h (original)
+++ lld/trunk/ELF/SyntheticSections.h Sun Nov  6 02:39:46 2016
@@ -40,7 +40,7 @@ protected:
   std::vector<uint8_t> Buf;
 
   void
-  computeHash(llvm::ArrayRef<uint8_t> Buf,
+  computeHash(llvm::MutableArrayRef<uint8_t> Buf,
               std::function<void(ArrayRef<uint8_t> Arr, uint8_t *Hash)> Hash);
 
   size_t HashSize;




More information about the llvm-commits mailing list