Home | History | Annotate | Download | only in IR

Lines Matching refs:DestTy

99 static Constant *FoldBitCast(Constant *V, Type *DestTy) {
101 if (SrcTy == DestTy)
107 if (PointerType *DPTy = dyn_cast<PointerType>(DestTy))
137 if (VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
144 return Constant::getNullValue(DestTy);
160 return ConstantPointerNull::get(cast<PointerType>(DestTy));
164 if (DestTy->isIntegerTy())
169 if (DestTy->isFloatingPointTy())
170 return ConstantFP::get(DestTy->getContext(),
171 APFloat(DestTy->getFltSemantics(),
331 /// getFoldedSizeOf - Return a ConstantExpr with type DestTy for sizeof
336 static Constant *getFoldedSizeOf(Type *Ty, Type *DestTy,
339 Constant *N = ConstantInt::get(DestTy, ATy->getNumElements());
340 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true);
349 return ConstantExpr::getNullValue(DestTy);
352 getFoldedSizeOf(STy->getElementType(0), DestTy, true);
356 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) {
361 Constant *N = ConstantInt::get(DestTy, NumElems);
373 DestTy, true);
383 DestTy, false),
384 C, DestTy);
388 /// getFoldedAlignOf - Return a ConstantExpr with type DestTy for alignof
393 static Constant *getFoldedAlignOf(Type *Ty, Type *DestTy,
400 DestTy,
402 C, DestTy);
409 return ConstantInt::get(DestTy, 1);
417 return ConstantInt::get(DestTy, 1);
420 getFoldedAlignOf(STy->getElementType(0), DestTy, true);
423 if (MemberAlign != getFoldedAlignOf(STy->getElementType(i), DestTy, true)) {
439 DestTy, true);
449 DestTy, false),
450 C, DestTy);
454 /// getFoldedOffsetOf - Return a ConstantExpr with type DestTy for offsetof
460 Type *DestTy,
464 DestTy, false),
465 FieldNo, DestTy);
466 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true);
478 getFoldedSizeOf(STy->getElementType(0), DestTy, true);
482 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) {
489 DestTy,
491 FieldNo, DestTy);
504 DestTy, false),
505 C, DestTy);
510 Type *DestTy) {
517 return Constant::getNullValue(DestTy);
518 return UndefValue::get(DestTy);
521 if (V->isNullValue() && !DestTy->isX86_MMXTy())
522 return Constant::getNullValue(DestTy);
529 if (unsigned newOpc = foldConstantCastPair(opc, CE, DestTy))
530 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy);
542 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy);
550 DestTy->isVectorTy() &&
551 DestTy->getVectorNumElements() == V->getType()->getVectorNumElements()) {
553 VectorType *DestVecTy = cast<VectorType>(DestTy);
574 Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf :
575 DestTy->isFloatTy() ? APFloat::IEEEsingle :
576 DestTy->isDoubleTy() ? APFloat::IEEEdouble :
577 DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended :
578 DestTy->isFP128Ty() ? APFloat::IEEEquad :
579 DestTy->isPPC_FP128Ty() ? APFloat::PPCDoubleDouble :
591 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
600 return ConstantPointerNull::get(cast<PointerType>(DestTy));
605 return ConstantInt::get(DestTy, 0);
618 if (Constant *C = getFoldedSizeOf(Ty, DestTy, !isOne)) {
620 DestTy, false),
621 Idx, DestTy);
633 return getFoldedAlignOf(STy->getElementType(1), DestTy, false);
639 DestTy, false))
650 APFloat apf(DestTy->getFltSemantics(),
651 APInt::getNullValue(DestTy->getPrimitiveSizeInBits()));
660 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth();
667 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth();
673 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
690 return FoldBitCast(V, DestTy);