From 41beee6575f98a3190d072583788d39cbdbe25f2 Mon Sep 17 00:00:00 2001 From: Sjoerd Meijer Date: Wed, 27 Apr 2016 18:35:02 +0000 Subject: [PATCH] Clean up to avoid compiler warnings for casting away const qualifiers. Differential Revision: http://reviews.llvm.org/D19598 llvm-svn: 267753 --- llvm/lib/Bitcode/Writer/BitcodeWriter.cpp | 2 +- llvm/lib/LTO/ThinLTOCodeGenerator.cpp | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp index 6764e77..9fb5d66 100644 --- a/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp +++ b/llvm/lib/Bitcode/Writer/BitcodeWriter.cpp @@ -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 *)&(Buffer)[BlockStartPos], + Hasher.update(ArrayRef((const uint8_t *)&(Buffer)[BlockStartPos], Buffer.size() - BlockStartPos)); auto Hash = Hasher.result(); SmallVector Vals; diff --git a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp index f443008..1f1c1b6 100644 --- a/llvm/lib/LTO/ThinLTOCodeGenerator.cpp +++ b/llvm/lib/LTO/ThinLTOCodeGenerator.cpp @@ -457,9 +457,9 @@ public: // 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 @@ public: 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())); -- 2.7.4