From e77ffe35bf8565d859df807d2a0507def5096c8a Mon Sep 17 00:00:00 2001 From: Aaron Ballman Date: Thu, 6 Nov 2014 14:32:30 +0000 Subject: [PATCH] Fixing some -Wcast-qual warnings; NFC. llvm-svn: 221454 --- llvm/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/llvm/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp b/llvm/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp index 6c1cc80..b592023 100644 --- a/llvm/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp +++ b/llvm/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp @@ -64,7 +64,7 @@ void NVPTXLowerStructArgs::handleParam(Argument *Arg) { const Type *StructType = PType->getElementType(); AllocaInst *AllocA = - new AllocaInst((Type *)StructType, Arg->getName(), FirstInst); + new AllocaInst(const_cast(StructType), Arg->getName(), FirstInst); /* Set the alignment to alignment of the byval parameter. This is because, * later load/stores assume that alignment, and we are going to replace @@ -79,9 +79,9 @@ void NVPTXLowerStructArgs::handleParam(Argument *Arg) { Type::getInt8PtrTy(Func->getParent()->getContext(), ADDRESS_SPACE_PARAM), Type::getInt8PtrTy(Func->getParent()->getContext(), ADDRESS_SPACE_GENERIC) }; - Function *CvtFunc = (Function *)Intrinsic::getDeclaration( + Function *CvtFunc = Intrinsic::getDeclaration( Func->getParent(), Intrinsic::nvvm_ptr_gen_to_param, - ArrayRef((Type **)CvtTypes, 2)); + ArrayRef(const_cast(CvtTypes), 2)); std::vector BC1; BC1.push_back( new BitCastInst(Arg, Type::getInt8PtrTy(Func->getParent()->getContext(), @@ -90,9 +90,10 @@ void NVPTXLowerStructArgs::handleParam(Argument *Arg) { CallInst *CallCVT = CallInst::Create(CvtFunc, ArrayRef(BC1), "cvt_to_param", FirstInst); - BitCastInst *BitCast = new BitCastInst( - CallCVT, PointerType::get((Type *)StructType, ADDRESS_SPACE_PARAM), - Arg->getName(), FirstInst); + BitCastInst *BitCast = + new BitCastInst(CallCVT, PointerType::get(const_cast(StructType), + ADDRESS_SPACE_PARAM), + Arg->getName(), FirstInst); LoadInst *LI = new LoadInst(BitCast, Arg->getName(), FirstInst); new StoreInst(LI, AllocA, FirstInst); } -- 2.7.4