[ELF] - Change argument of computeHash to MutableArrayRef. NFC.
authorGeorge Rimar <grimar@accesssoftek.com>
Sun, 6 Nov 2016 08:39:46 +0000 (08:39 +0000)
committerGeorge Rimar <grimar@accesssoftek.com>
Sun, 6 Nov 2016 08:39:46 +0000 (08:39 +0000)
This fixes casting warning and removes the need of that cast at all.

llvm-svn: 286065

lld/ELF/SyntheticSections.cpp
lld/ELF/SyntheticSections.h

index 03dc6d0..a3655d1 100644 (file)
@@ -124,7 +124,7 @@ static std::vector<ArrayRef<uint8_t>> split(ArrayRef<uint8_t> Arr,
 
 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>
index 27a8d65..9cf622a 100644 (file)
@@ -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;