Lines Matching defs:DestTy
100 static Constant *FoldBitCast(Constant *V, Type *DestTy) {
102 if (SrcTy == DestTy)
108 if (PointerType *DPTy = dyn_cast<PointerType>(DestTy))
138 if (VectorType *DestPTy = dyn_cast<VectorType>(DestTy)) {
145 return Constant::getNullValue(DestTy);
161 return ConstantPointerNull::get(cast<PointerType>(DestTy));
165 if (DestTy->isIntegerTy())
170 if (DestTy->isFloatingPointTy())
171 return ConstantFP::get(DestTy->getContext(),
172 APFloat(DestTy->getFltSemantics(),
332 /// getFoldedSizeOf - Return a ConstantExpr with type DestTy for sizeof
337 static Constant *getFoldedSizeOf(Type *Ty, Type *DestTy,
340 Constant *N = ConstantInt::get(DestTy, ATy->getNumElements());
341 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true);
350 return ConstantExpr::getNullValue(DestTy);
353 getFoldedSizeOf(STy->getElementType(0), DestTy, true);
357 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) {
362 Constant *N = ConstantInt::get(DestTy, NumElems);
374 DestTy, true);
384 DestTy, false),
385 C, DestTy);
389 /// getFoldedAlignOf - Return a ConstantExpr with type DestTy for alignof
394 static Constant *getFoldedAlignOf(Type *Ty, Type *DestTy,
401 DestTy,
403 C, DestTy);
410 return ConstantInt::get(DestTy, 1);
418 return ConstantInt::get(DestTy, 1);
421 getFoldedAlignOf(STy->getElementType(0), DestTy, true);
424 if (MemberAlign != getFoldedAlignOf(STy->getElementType(i), DestTy, true)) {
440 DestTy, true);
450 DestTy, false),
451 C, DestTy);
455 /// getFoldedOffsetOf - Return a ConstantExpr with type DestTy for offsetof
461 Type *DestTy,
465 DestTy, false),
466 FieldNo, DestTy);
467 Constant *E = getFoldedSizeOf(ATy->getElementType(), DestTy, true);
479 getFoldedSizeOf(STy->getElementType(0), DestTy, true);
483 getFoldedSizeOf(STy->getElementType(i), DestTy, true)) {
490 DestTy,
492 FieldNo, DestTy);
505 DestTy, false),
506 C, DestTy);
511 Type *DestTy) {
518 return Constant::getNullValue(DestTy);
519 return UndefValue::get(DestTy);
522 if (V->isNullValue() && !DestTy->isX86_MMXTy())
523 return Constant::getNullValue(DestTy);
530 if (unsigned newOpc = foldConstantCastPair(opc, CE, DestTy))
531 return ConstantExpr::getCast(newOpc, CE->getOperand(0), DestTy);
546 return ConstantExpr::getPointerCast(CE->getOperand(0), DestTy);
554 DestTy->isVectorTy() &&
555 DestTy->getVectorNumElements() == V->getType()->getVectorNumElements()) {
557 VectorType *DestVecTy = cast<VectorType>(DestTy);
578 Val.convert(DestTy->isHalfTy() ? APFloat::IEEEhalf :
579 DestTy->isFloatTy() ? APFloat::IEEEsingle :
580 DestTy->isDoubleTy() ? APFloat::IEEEdouble :
581 DestTy->isX86_FP80Ty() ? APFloat::x87DoubleExtended :
582 DestTy->isFP128Ty() ? APFloat::IEEEquad :
583 DestTy->isPPC_FP128Ty() ? APFloat::PPCDoubleDouble :
595 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
604 return ConstantPointerNull::get(cast<PointerType>(DestTy));
609 return ConstantInt::get(DestTy, 0);
622 if (Constant *C = getFoldedSizeOf(Ty, DestTy, !isOne)) {
624 DestTy, false),
625 Idx, DestTy);
637 return getFoldedAlignOf(STy->getElementType(1), DestTy, false);
643 DestTy, false))
654 APFloat apf(DestTy->getFltSemantics(),
655 APInt::getNullValue(DestTy->getPrimitiveSizeInBits()));
664 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth();
671 uint32_t BitWidth = cast<IntegerType>(DestTy)->getBitWidth();
677 uint32_t DestBitWidth = cast<IntegerType>(DestTy)->getBitWidth();
694 return FoldBitCast(V, DestTy);