From 22cfcb246956ca0bc3271521cae314c509ecc1c8 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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@221454 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Target/NVPTX/NVPTXLowerStructArgs.cpp | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp b/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp index 6c1cc80a9fd..b592023631b 100644 --- a/lib/Target/NVPTX/NVPTXLowerStructArgs.cpp +++ b/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.34.1