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 *)&(Buffer)[BlockStartPos], + Hasher.update(ArrayRef((const uint8_t *)&(Buffer)[BlockStartPos], Buffer.size() - BlockStartPos)); auto Hash = Hasher.result(); SmallVector Vals; Index: llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp =================================================================== --- llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp +++ llvm/trunk/lib/LTO/ThinLTOCodeGenerator.cpp @@ -457,9 +457,9 @@ // Include the hash for the resolved ODR. for (auto &Entry : ResolvedODR) { - Hasher.update(ArrayRef((uint8_t *)&Entry.first, + Hasher.update(ArrayRef((const uint8_t *)&Entry.first, sizeof(GlobalValue::GUID))); - Hasher.update(ArrayRef((uint8_t *)&Entry.second, + Hasher.update(ArrayRef((const uint8_t *)&Entry.second, sizeof(GlobalValue::LinkageTypes))); } @@ -467,7 +467,7 @@ for (auto &Entry : PreservedSymbols) { if (DefinedFunctions.count(Entry)) Hasher.update( - ArrayRef((uint8_t *)&Entry, sizeof(GlobalValue::GUID))); + ArrayRef((const uint8_t *)&Entry, sizeof(GlobalValue::GUID))); } sys::path::append(EntryPath, CachePath, toHex(Hasher.result()));