Lines Matching defs:Ty

834 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize,
836 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
837 getAISize(Ty->getContext(), ArraySize), InsertBefore) {
839 assert(!Ty->isVoidTy() && "Cannot allocate void!");
843 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize,
845 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
846 getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
848 assert(!Ty->isVoidTy() && "Cannot allocate void!");
852 AllocaInst::AllocaInst(Type *Ty, const Twine &Name,
854 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
855 getAISize(Ty->getContext(), 0), InsertBefore) {
857 assert(!Ty->isVoidTy() && "Cannot allocate void!");
861 AllocaInst::AllocaInst(Type *Ty, const Twine &Name,
863 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
864 getAISize(Ty->getContext(), 0), InsertAtEnd) {
866 assert(!Ty->isVoidTy() && "Cannot allocate void!");
870 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, unsigned Align,
872 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
873 getAISize(Ty->getContext(), ArraySize), InsertBefore) {
875 assert(!Ty->isVoidTy() && "Cannot allocate void!");
879 AllocaInst::AllocaInst(Type *Ty, Value *ArraySize, unsigned Align,
881 : UnaryInstruction(PointerType::getUnqual(Ty), Alloca,
882 getAISize(Ty->getContext(), ArraySize), InsertAtEnd) {
884 assert(!Ty->isVoidTy() && "Cannot allocate void!");
1733 Type *Ty, const Twine &Name,
1735 : Instruction(Ty, iType,
1746 Type *Ty, const Twine &Name,
1748 : Instruction(Ty, iType,
2350 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty,
2352 assert(castIsValid(op, S, Ty) && "Invalid cast!");
2355 case Trunc: return new TruncInst (S, Ty, Name, InsertBefore);
2356 case ZExt: return new ZExtInst (S, Ty, Name, InsertBefore);
2357 case SExt: return new SExtInst (S, Ty, Name, InsertBefore);
2358 case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertBefore);
2359 case FPExt: return new FPExtInst (S, Ty, Name, InsertBefore);
2360 case UIToFP: return new UIToFPInst (S, Ty, Name, InsertBefore);
2361 case SIToFP: return new SIToFPInst (S, Ty, Name, InsertBefore);
2362 case FPToUI: return new FPToUIInst (S, Ty, Name, InsertBefore);
2363 case FPToSI: return new FPToSIInst (S, Ty, Name, InsertBefore);
2364 case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertBefore);
2365 case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertBefore);
2366 case BitCast: return new BitCastInst (S, Ty, Name, InsertBefore);
2367 case AddrSpaceCast: return new AddrSpaceCastInst (S, Ty, Name, InsertBefore);
2372 CastInst *CastInst::Create(Instruction::CastOps op, Value *S, Type *Ty,
2374 assert(castIsValid(op, S, Ty) && "Invalid cast!");
2377 case Trunc: return new TruncInst (S, Ty, Name, InsertAtEnd);
2378 case ZExt: return new ZExtInst (S, Ty, Name, InsertAtEnd);
2379 case SExt: return new SExtInst (S, Ty, Name, InsertAtEnd);
2380 case FPTrunc: return new FPTruncInst (S, Ty, Name, InsertAtEnd);
2381 case FPExt: return new FPExtInst (S, Ty, Name, InsertAtEnd);
2382 case UIToFP: return new UIToFPInst (S, Ty, Name, InsertAtEnd);
2383 case SIToFP: return new SIToFPInst (S, Ty, Name, InsertAtEnd);
2384 case FPToUI: return new FPToUIInst (S, Ty, Name, InsertAtEnd);
2385 case FPToSI: return new FPToSIInst (S, Ty, Name, InsertAtEnd);
2386 case PtrToInt: return new PtrToIntInst (S, Ty, Name, InsertAtEnd);
2387 case IntToPtr: return new IntToPtrInst (S, Ty, Name, InsertAtEnd);
2388 case BitCast: return new BitCastInst (S, Ty, Name, InsertAtEnd);
2389 case AddrSpaceCast: return new AddrSpaceCastInst (S, Ty, Name, InsertAtEnd);
2394 CastInst *CastInst::CreateZExtOrBitCast(Value *S, Type *Ty,
2397 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2398 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2399 return Create(Instruction::ZExt, S, Ty, Name, InsertBefore);
2402 CastInst *CastInst::CreateZExtOrBitCast(Value *S, Type *Ty,
2405 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2406 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2407 return Create(Instruction::ZExt, S, Ty, Name, InsertAtEnd);
2410 CastInst *CastInst::CreateSExtOrBitCast(Value *S, Type *Ty,
2413 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2414 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2415 return Create(Instruction::SExt, S, Ty, Name, InsertBefore);
2418 CastInst *CastInst::CreateSExtOrBitCast(Value *S, Type *Ty,
2421 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2422 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2423 return Create(Instruction::SExt, S, Ty, Name, InsertAtEnd);
2426 CastInst *CastInst::CreateTruncOrBitCast(Value *S, Type *Ty,
2429 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2430 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2431 return Create(Instruction::Trunc, S, Ty, Name, InsertBefore);
2434 CastInst *CastInst::CreateTruncOrBitCast(Value *S, Type *Ty,
2437 if (S->getType()->getScalarSizeInBits() == Ty->getScalarSizeInBits())
2438 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2439 return Create(Instruction::Trunc, S, Ty, Name, InsertAtEnd);
2442 CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty,
2446 assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) &&
2448 assert(Ty->isVectorTy() == S->getType()->isVectorTy() && "Invalid cast");
2449 assert((!Ty->isVectorTy() ||
2450 Ty->getVectorNumElements() == S->getType()->getVectorNumElements()) &&
2453 if (Ty->isIntOrIntVectorTy())
2454 return Create(Instruction::PtrToInt, S, Ty, Name, InsertAtEnd);
2457 if (STy->getPointerAddressSpace() != Ty->getPointerAddressSpace())
2458 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertAtEnd);
2460 return Create(Instruction::BitCast, S, Ty, Name, InsertAtEnd);
2464 CastInst *CastInst::CreatePointerCast(Value *S, Type *Ty,
2468 assert((Ty->isIntOrIntVectorTy() || Ty->isPtrOrPtrVectorTy()) &&
2470 assert(Ty->isVectorTy() == S->getType()->isVectorTy() && "Invalid cast");
2471 assert((!Ty->isVectorTy() ||
2472 Ty->getVectorNumElements() == S->getType()->getVectorNumElements()) &&
2475 if (Ty->isIntOrIntVectorTy())
2476 return Create(Instruction::PtrToInt, S, Ty, Name, InsertBefore);
2479 if (STy->getPointerAddressSpace() != Ty->getPointerAddressSpace())
2480 return Create(Instruction::AddrSpaceCast, S, Ty, Name, InsertBefore);
2482 return Create(Instruction::BitCast, S, Ty, Name, InsertBefore);
2485 CastInst *CastInst::CreateIntegerCast(Value *C, Type *Ty,
2488 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() &&
2491 unsigned DstBits = Ty->getScalarSizeInBits();
2496 return Create(opcode, C, Ty, Name, InsertBefore);
2499 CastInst *CastInst::CreateIntegerCast(Value *C, Type *Ty,
2502 assert(C->getType()->isIntOrIntVectorTy() && Ty->isIntOrIntVectorTy() &&
2505 unsigned DstBits = Ty->getScalarSizeInBits();
2510 return Create(opcode, C, Ty, Name, InsertAtEnd);
2513 CastInst *CastInst::CreateFPCast(Value *C, Type *Ty,
2516 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() &&
2519 unsigned DstBits = Ty->getScalarSizeInBits();
2523 return Create(opcode, C, Ty, Name, InsertBefore);
2526 CastInst *CastInst::CreateFPCast(Value *C, Type *Ty,
2529 assert(C->getType()->isFPOrFPVectorTy() && Ty->isFPOrFPVectorTy() &&
2532 unsigned DstBits = Ty->getScalarSizeInBits();
2536 return Create(opcode, C, Ty, Name, InsertAtEnd);
2645 // castIsValid( getCastOpcode(Val, Ty), Val, Ty)
2848 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2849 ) : CastInst(Ty, Trunc, S, Name, InsertBefore) {
2850 assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc");
2854 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2855 ) : CastInst(Ty, Trunc, S, Name, InsertAtEnd) {
2856 assert(castIsValid(getOpcode(), S, Ty) && "Illegal Trunc");
2860 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2861 ) : CastInst(Ty, ZExt, S, Name, InsertBefore) {
2862 assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt");
2866 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2867 ) : CastInst(Ty, ZExt, S, Name, InsertAtEnd) {
2868 assert(castIsValid(getOpcode(), S, Ty) && "Illegal ZExt");
2871 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2872 ) : CastInst(Ty, SExt, S, Name, InsertBefore) {
2873 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt");
2877 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2878 ) : CastInst(Ty, SExt, S, Name, InsertAtEnd) {
2879 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SExt");
2883 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2884 ) : CastInst(Ty, FPTrunc, S, Name, InsertBefore) {
2885 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc");
2889 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2890 ) : CastInst(Ty, FPTrunc, S, Name, InsertAtEnd) {
2891 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPTrunc");
2895 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2896 ) : CastInst(Ty, FPExt, S, Name, InsertBefore) {
2897 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");
2901 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2902 ) : CastInst(Ty, FPExt, S, Name, InsertAtEnd) {
2903 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPExt");
2907 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2908 ) : CastInst(Ty, UIToFP, S, Name, InsertBefore) {
2909 assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP");
2913 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2914 ) : CastInst(Ty, UIToFP, S, Name, InsertAtEnd) {
2915 assert(castIsValid(getOpcode(), S, Ty) && "Illegal UIToFP");
2919 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2920 ) : CastInst(Ty, SIToFP, S, Name, InsertBefore) {
2921 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP");
2925 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2926 ) : CastInst(Ty, SIToFP, S, Name, InsertAtEnd) {
2927 assert(castIsValid(getOpcode(), S, Ty) && "Illegal SIToFP");
2931 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2932 ) : CastInst(Ty, FPToUI, S, Name, InsertBefore) {
2933 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI");
2937 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2938 ) : CastInst(Ty, FPToUI, S, Name, InsertAtEnd) {
2939 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToUI");
2943 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2944 ) : CastInst(Ty, FPToSI, S, Name, InsertBefore) {
2945 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI");
2949 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2950 ) : CastInst(Ty, FPToSI, S, Name, InsertAtEnd) {
2951 assert(castIsValid(getOpcode(), S, Ty) && "Illegal FPToSI");
2955 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2956 ) : CastInst(Ty, PtrToInt, S, Name, InsertBefore) {
2957 assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt");
2961 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2962 ) : CastInst(Ty, PtrToInt, S, Name, InsertAtEnd) {
2963 assert(castIsValid(getOpcode(), S, Ty) && "Illegal PtrToInt");
2967 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2968 ) : CastInst(Ty, IntToPtr, S, Name, InsertBefore) {
2969 assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr");
2973 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2974 ) : CastInst(Ty, IntToPtr, S, Name, InsertAtEnd) {
2975 assert(castIsValid(getOpcode(), S, Ty) && "Illegal IntToPtr");
2979 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2980 ) : CastInst(Ty, BitCast, S, Name, InsertBefore) {
2981 assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast");
2985 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2986 ) : CastInst(Ty, BitCast, S, Name, InsertAtEnd) {
2987 assert(castIsValid(getOpcode(), S, Ty) && "Illegal BitCast");
2991 Value *S, Type *Ty, const Twine &Name, Instruction *InsertBefore
2992 ) : CastInst(Ty, AddrSpaceCast, S, Name, InsertBefore) {
2993 assert(castIsValid(getOpcode(), S, Ty) && "Illegal AddrSpaceCast");
2997 Value *S, Type *Ty, const Twine &Name, BasicBlock *InsertAtEnd
2998 ) : CastInst(Ty, AddrSpaceCast, S, Name, InsertAtEnd) {
2999 assert(castIsValid(getOpcode(), S, Ty) && "Illegal AddrSpaceCast");