OSDN Git Service

Clean up to avoid compiler warnings for casting away const qualifiers.
authorSjoerd Meijer <sjoerd.meijer@arm.com>
Wed, 27 Apr 2016 18:35:02 +0000 (18:35 +0000)
committerSjoerd Meijer <sjoerd.meijer@arm.com>
Wed, 27 Apr 2016 18:35:02 +0000 (18:35 +0000)
Differential Revision: http://reviews.llvm.org/D19598

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@267753 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Bitcode/Writer/BitcodeWriter.cpp
lib/LTO/ThinLTOCodeGenerator.cpp

index 6764e77..9fb5d66 100644 (file)
@@ -3337,7 +3337,7 @@ void ModuleBitcodeWriter::writeModuleHash(size_t BlockStartPos) {
   // 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 f443008..1f1c1b6 100644 (file)
@@ -457,9 +457,9 @@ public:
 
     // 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)));
     }
 
@@ -467,7 +467,7 @@ public:
     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()));