Lines Matching defs:DestTy
489 static Value *createCast(IRBuilder<> &Builder, Value *V, Type *DestTy) {
492 assert(DestTy->isStructTy());
493 assert(SrcTy->getStructNumElements() == DestTy->getStructNumElements());
494 Value *Result = PoisonValue::get(DestTy);
498 DestTy->getStructElementType(I));
504 assert(!DestTy->isStructTy());
505 if (SrcTy->isIntegerTy() && DestTy->isPointerTy())
506 return Builder.CreateIntToPtr(V, DestTy);
507 else if (SrcTy->isPointerTy() && DestTy->isIntegerTy())
508 return Builder.CreatePtrToInt(V, DestTy);
510 return Builder.CreateBitCast(V, DestTy);