[PATCH] D19598: compiler warning for casting away const qualifier

Sjoerd Meijer via llvm-commits llvm-commits at lists.llvm.org
Wed Apr 27 11:40:48 PDT 2016


This revision was automatically updated to reflect the committed changes.
Closed by commit rL267753: Clean up to avoid compiler warnings for casting away const qualifiers. (authored by SjoerdMeijer).

Changed prior to commit:
  http://reviews.llvm.org/D19598?vs=55230&id=55269#toc

Repository:
  rL LLVM

http://reviews.llvm.org/D19598

Files:
  llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
  llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp

Index: llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
===================================================================
--- llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
+++ llvm/trunk/lib/Bitcode/Writer/BitcodeWriter.cpp
@@ -3337,7 +3337,7 @@
   // Emit the module's hash.
   // MODULE_CODE_HASH: [5*i32]
   SHA1 Hasher;
-  Hasher.update(ArrayRef<uint8_t>((uint8_t *)&(Buffer)[BlockStartPos],
+  Hasher.update(ArrayRef<uint8_t>((const uint8_t *)&(Buffer)[BlockStartPos],
                                   Buffer.size() - BlockStartPos));
   auto Hash = Hasher.result();
   SmallVector<uint64_t, 20> Vals;
Index: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
===================================================================
--- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
+++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp
@@ -457,17 +457,17 @@
 
     // Include the hash for the resolved ODR.
     for (auto &Entry : ResolvedODR) {
-      Hasher.update(ArrayRef<uint8_t>((uint8_t *)&Entry.first,
+      Hasher.update(ArrayRef<uint8_t>((const uint8_t *)&Entry.first,
                                       sizeof(GlobalValue::GUID)));
-      Hasher.update(ArrayRef<uint8_t>((uint8_t *)&Entry.second,
+      Hasher.update(ArrayRef<uint8_t>((const uint8_t *)&Entry.second,
                                       sizeof(GlobalValue::LinkageTypes)));
     }
 
     // Include the hash for the preserved symbols.
     for (auto &Entry : PreservedSymbols) {
       if (DefinedFunctions.count(Entry))
         Hasher.update(
-            ArrayRef<uint8_t>((uint8_t *)&Entry, sizeof(GlobalValue::GUID)));
+            ArrayRef<uint8_t>((const uint8_t *)&Entry, sizeof(GlobalValue::GUID)));
     }
 
     sys::path::append(EntryPath, CachePath, toHex(Hasher.result()));


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D19598.55269.patch
Type: text/x-patch
Size: 1765 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20160427/83566222/attachment.bin>


More information about the llvm-commits mailing list