Lines Matching refs:Ty

812 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize,
814 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
815 getAISize(Ty->getContext(), ArraySize), InsertBefore) {
817 assert(!Ty->isVoidTy() && "Cannot allocate void!");
821 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize,
823 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
824 getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
826 assert(!Ty->isVoidTy() && "Cannot allocate void!");
830 AllocaInst::AllocaInst(Type *Ty, const Twine &Name,
832 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
833 getAISize(Ty->getContext(), 0), InsertBefore) {
835 assert(!Ty->isVoidTy() && "Cannot allocate void!");
839 AllocaInst::AllocaInst(Type *Ty, const Twine &Name,
841 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
842 getAISize(Ty->getContext(), 0), InsertAtEnd) {
844 assert(!Ty->isVoidTy() && "Cannot allocate void!");
848 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, unsigned Align,
850 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
851 getAISize(Ty->getContext(), ArraySize), InsertBefore) {
853 assert(!Ty->isVoidTy() && "Cannot allocate void!");
857 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, unsigned Align,
859 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
860 getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
862 assert(!Ty->isVoidTy() && "Cannot allocate void!");
1385 Type *Ty = Ptr->getType();
1387 if (VectorType *VTy = dyn_cast<VectorType>(Ty))
1388 Ty = VTy->getElementType();
1390 if (PointerType *PTy = dyn_cast<PointerType>(Ty))
1726 Type *Ty, const Twine &Name,
1728 : Instruction(Ty, iType,
1739 Type *Ty, const Twine &Name,
1741 : Instruction(Ty, iType,
2277 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty,
2279 assert(castIsValid(op, S, Ty) && "Invalid cast!");
2282 case Trunc: return new TruncInst (S, Ty, Name, InsertBefore);
2283 case ZExt: return new ZExtInst (S, Ty, Name, InsertBefore);
2284 case SExt: return new SExtInst (S, Ty, Name, InsertBefore);
2285 case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertBefore);
2286 case FPExt: return new FPExtInst (S, Ty, Name, InsertBefore);
2287 case UIToFP: return new UIToFPInst (S, Ty, Name, InsertBefore);
2288 case SIToFP: return new SIToFPInst (S, Ty, Name, InsertBefore);
2289 case FPToUI: return new FPToUIInst (S, Ty, Name, InsertBefore);
2290 case FPToSI: return new FPToSIInst (S, Ty, Name, InsertBefore);
2291 case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertBefore);
2292 case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertBefore);
2293 case BitCast: return new BitCastInst (S, Ty, Name, InsertBefore);
2298 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty,
2300 assert(castIsValid(op, S, Ty) && "Invalid cast!");
2303 case Trunc: return new TruncInst (S, Ty, Name, InsertAtEnd);
2304 case ZExt: return new ZExtInst (S, Ty, Name, InsertAtEnd);
2305 case SExt: return new SExtInst (S, Ty, Name, InsertAtEnd);
2306 case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertAtEnd);
2307 case FPExt: return new FPExtInst (S, Ty, Name, InsertAtEnd);
2308 case UIToFP: return new UIToFPInst (S, Ty, Name, InsertAtEnd);
2309 case SIToFP: return new SIToFPInst (S, Ty, Name, InsertAtEnd);
2310 case FPToUI: return new FPToUIInst (S, Ty, Name, InsertAtEnd);
2311 case FPToSI: return new FPToSIInst (S, Ty, Name, InsertAtEnd);
2312 case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertAtEnd);
2313 case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertAtEnd);
2314 case BitCast: return new BitCastInst (S, Ty, Name, InsertAtEnd);
2319 CastInst *CastInst::CreateZExtOrBitCast(Value *S, Type *Ty,
2322 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2323 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2324 return Create(Instruction::ZExt, S, Ty, Name, InsertBefore);
2327 CastInst *CastInst::CreateZExtOrBitCast(Value *S, Type *Ty,
2330 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2331 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2332 return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
2335 CastInst *CastInst::CreateSExtOrBitCast(Value *S, Type *Ty,
2338 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2339 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2340 return Create(Instruction::SExt, S, Ty, Name, InsertBefore);
2343 CastInst *CastInst::CreateSExtOrBitCast(Value *S, Type *Ty,
2346 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2347 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2348 return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
2351 CastInst *CastInst::CreateTruncOrBitCast(Value *S, Type *Ty,
2354 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2355 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2356 return Create(Instruction::Trunc, S, Ty, Name, InsertBefore);
2359 CastInst *CastInst::CreateTruncOrBitCast(Value *S, Type *Ty,
2362 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2363 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2364 return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
2367 CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty,
2371 assert((Ty->isIntegerTy() || Ty->isPointerTy()) &&
2374 if (Ty->isIntegerTy())
2375 return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
2376 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2380 CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty,
2384 assert((Ty->isIntegerTy() || Ty->isPointerTy()) &&
2387 if (Ty->isIntegerTy())
2388 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
2389 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2392 CastInst *CastInst::CreateIntegerCast(Value *C, Type *Ty,
2395 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() &&
2398 unsigned DstBits = Ty->getScalarSizeInBits();
2403 return Create(opcode, C, Ty, Name, InsertBefore);
2406 CastInst *CastInst::CreateIntegerCast(Value *C, Type *Ty,
2409 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() &&
2412 unsigned DstBits = Ty->getScalarSizeInBits();
2417 return Create(opcode, C, Ty, Name, InsertAtEnd);
2420 CastInst *CastInst::CreateFPCast(Value *C, Type *Ty,
2423 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() &&
2426 unsigned DstBits = Ty->getScalarSizeInBits();
2430 return Create(opcode, C, Ty, Name, InsertBefore);
2433 CastInst *CastInst::CreateFPCast(Value *C, Type *Ty,
2436 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() &&
2439 unsigned DstBits = Ty->getScalarSizeInBits();
2443 return Create(opcode, C, Ty, Name, InsertAtEnd);
2512 // castIsValid( getCastOpcode(Val, Ty), Val, Ty)
2693 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2694 ) : CastInst(Ty, Trunc, S, Name, InsertBefore) {
2695 assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc");
2699 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2700 ) : CastInst(Ty, Trunc, S, Name, InsertAtEnd) {
2701 assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc");
2705 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2706 ) : CastInst(Ty, ZExt, S, Name, InsertBefore) {
2707 assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt");
2711 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2712 ) : CastInst(Ty, ZExt, S, Name, InsertAtEnd) {
2713 assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt");
2716 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2717 ) : CastInst(Ty, SExt, S, Name, InsertBefore) {
2718 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt");
2722 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2723 ) : CastInst(Ty, SExt, S, Name, InsertAtEnd) {
2724 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt");
2728 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2729 ) : CastInst(Ty, FPTrunc, S, Name, InsertBefore) {
2730 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc");
2734 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2735 ) : CastInst(Ty, FPTrunc, S, Name, InsertAtEnd) {
2736 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc");
2740 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2741 ) : CastInst(Ty, FPExt, S, Name, InsertBefore) {
2742 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");
2746 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2747 ) : CastInst(Ty, FPExt, S, Name, InsertAtEnd) {
2748 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");
2752 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2753 ) : CastInst(Ty, UIToFP, S, Name, InsertBefore) {
2754 assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP");
2758 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2759 ) : CastInst(Ty, UIToFP, S, Name, InsertAtEnd) {
2760 assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP");
2764 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2765 ) : CastInst(Ty, SIToFP, S, Name, InsertBefore) {
2766 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP");
2770 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2771 ) : CastInst(Ty, SIToFP, S, Name, InsertAtEnd) {
2772 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP");
2776 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2777 ) : CastInst(Ty, FPToUI, S, Name, InsertBefore) {
2778 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI");
2782 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2783 ) : CastInst(Ty, FPToUI, S, Name, InsertAtEnd) {
2784 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI");
2788 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2789 ) : CastInst(Ty, FPToSI, S, Name, InsertBefore) {
2790 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI");
2794 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2795 ) : CastInst(Ty, FPToSI, S, Name, InsertAtEnd) {
2796 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI");
2800 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2801 ) : CastInst(Ty, PtrToInt, S, Name, InsertBefore) {
2802 assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt");
2806 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2807 ) : CastInst(Ty, PtrToInt, S, Name, InsertAtEnd) {
2808 assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt");
2812 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2813 ) : CastInst(Ty, IntToPtr, S, Name, InsertBefore) {
2814 assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr");
2818 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2819 ) : CastInst(Ty, IntToPtr, S, Name, InsertAtEnd) {
2820 assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr");
2824 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2825 ) : CastInst(Ty, BitCast, S, Name, InsertBefore) {
2826 assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast");
2830 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2831 ) : CastInst(Ty, BitCast, S, Name, InsertAtEnd) {
2832 assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast");