mirror of
https://github.com/intel/llvm.git
synced 2026-01-26 03:56:16 +08:00
Fix Const Cast
Do proper casting to avoid a cast-away-const error. llvm-svn: 172559
This commit is contained in:
@@ -2280,7 +2280,8 @@ CodeGenModule::GetAddrOfConstantCFString(const StringLiteral *Literal) {
|
||||
llvm::Constant *C = 0;
|
||||
if (isUTF16) {
|
||||
ArrayRef<uint16_t> Arr =
|
||||
llvm::makeArrayRef<uint16_t>((uint16_t*)Entry.getKey().data(),
|
||||
llvm::makeArrayRef<uint16_t>(reinterpret_cast<uint16_t*>(
|
||||
const_cast<char *>(Entry.getKey().data())),
|
||||
Entry.getKey().size() / 2);
|
||||
C = llvm::ConstantDataArray::get(VMContext, Arr);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user