- const Type* Int32Ty = IntegerType::getInt32Ty(CurBB->getContext());
- if (Size->getType() != Int32Ty)
- Size = CastInst::CreateIntegerCast(Size, Int32Ty, false /*ZExt*/,
- "", CurBB);
- Value* Malloc = CallInst::CreateMalloc(CurBB, Int32Ty,
- Ty->getElementType(), Size, NULL);
- I = cast<Instruction>(Malloc);
+ const Type *Int32Ty = IntegerType::getInt32Ty(CurBB->getContext());
+ I = CallInst::CreateMalloc(CurBB, Int32Ty, Ty->getElementType(),
+ Size, NULL);