r270180 - CodeGen: address -Wcast-qual warning
Saleem Abdulrasool via cfe-commits
cfe-commits at lists.llvm.org
Thu May 19 20:58:12 PDT 2016
Author: compnerd
Date: Thu May 19 22:58:12 2016
New Revision: 270180
URL: http://llvm.org/viewvc/llvm-project?rev=270180&view=rev
Log:
CodeGen: address -Wcast-qual warning
Add a const_cast rather than the C-style cast. NFC.
Modified:
cfe/trunk/lib/CodeGen/BackendUtil.cpp
Modified: cfe/trunk/lib/CodeGen/BackendUtil.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/CodeGen/BackendUtil.cpp?rev=270180&r1=270179&r2=270180&view=diff
==============================================================================
--- cfe/trunk/lib/CodeGen/BackendUtil.cpp (original)
+++ cfe/trunk/lib/CodeGen/BackendUtil.cpp Thu May 19 22:58:12 2016
@@ -853,7 +853,7 @@ void clang::EmbedBitcode(llvm::Module *M
// Skip if only bitcode needs to be embedded.
if (CGOpts.getEmbedBitcode() != CodeGenOptions::Embed_Bitcode) {
// Embed command-line options.
- ArrayRef<uint8_t> CmdData((uint8_t*)CGOpts.CmdArgs.data(),
+ ArrayRef<uint8_t> CmdData(const_cast<uint8_t *>(CGOpts.CmdArgs.data()),
CGOpts.CmdArgs.size());
llvm::Constant *CmdConstant =
llvm::ConstantDataArray::get(M->getContext(), CmdData);
More information about the cfe-commits
mailing list