Lines Matching refs:Ty
48 Type *Ty = ST->getElementType(i); in StructLayout() local
49 unsigned TyAlign = ST->isPacked() ? 1 : DL.getABITypeAlignment(Ty); in StructLayout()
59 StructSize += DL.getTypeAllocSize(Ty); // Consume space for this data item in StructLayout()
454 Type *Ty) const { in getAlignmentInfo()
488 unsigned Align = getTypeAllocSize(cast<VectorType>(Ty)->getElementType()); in getAlignmentInfo()
489 Align *= cast<VectorType>(Ty)->getNumElements(); in getAlignmentInfo()
505 unsigned Align = getTypeStoreSize(Ty); in getAlignmentInfo()
551 const StructLayout *DataLayout::getStructLayout(StructType *Ty) const { in getStructLayout()
556 StructLayout *&SL = (*STM)[Ty]; in getStructLayout()
561 int NumElts = Ty->getNumElements(); in getStructLayout()
569 new (L) StructLayout(Ty, *this); in getStructLayout()
602 unsigned DataLayout::getPointerTypeSizeInBits(Type *Ty) const { in getPointerTypeSizeInBits()
603 assert(Ty->isPtrOrPtrVectorTy() && in getPointerTypeSizeInBits()
606 if (Ty->isPointerTy()) in getPointerTypeSizeInBits()
607 return getTypeSizeInBits(Ty); in getPointerTypeSizeInBits()
609 return getTypeSizeInBits(Ty->getScalarType()); in getPointerTypeSizeInBits()
620 unsigned DataLayout::getAlignment(Type *Ty, bool abi_or_pref) const { in getAlignment() argument
623 assert(Ty->isSized() && "Cannot getTypeInfo() on a type that is unsized!"); in getAlignment()
624 switch (Ty->getTypeID()) { in getAlignment()
631 unsigned AS = cast<PointerType>(Ty)->getAddressSpace(); in getAlignment()
637 return getAlignment(cast<ArrayType>(Ty)->getElementType(), abi_or_pref); in getAlignment()
641 if (cast<StructType>(Ty)->isPacked() && abi_or_pref) in getAlignment()
645 const StructLayout *Layout = getStructLayout(cast<StructType>(Ty)); in getAlignment()
646 unsigned Align = getAlignmentInfo(AGGREGATE_ALIGN, 0, abi_or_pref, Ty); in getAlignment()
670 return getAlignmentInfo((AlignTypeEnum)AlignType, getTypeSizeInBits(Ty), in getAlignment()
671 abi_or_pref, Ty); in getAlignment()
674 unsigned DataLayout::getABITypeAlignment(Type *Ty) const { in getABITypeAlignment()
675 return getAlignment(Ty, true); in getABITypeAlignment()
684 unsigned DataLayout::getPrefTypeAlignment(Type *Ty) const { in getPrefTypeAlignment()
685 return getAlignment(Ty, false); in getPrefTypeAlignment()
688 unsigned DataLayout::getPreferredTypeAlignmentShift(Type *Ty) const { in getPreferredTypeAlignmentShift()
689 unsigned Align = getPrefTypeAlignment(Ty); in getPreferredTypeAlignmentShift()
699 Type *DataLayout::getIntPtrType(Type *Ty) const { in getIntPtrType()
700 assert(Ty->isPtrOrPtrVectorTy() && in getIntPtrType()
702 unsigned NumBits = getPointerTypeSizeInBits(Ty); in getIntPtrType()
703 IntegerType *IntTy = IntegerType::get(Ty->getContext(), NumBits); in getIntPtrType()
704 if (VectorType *VecTy = dyn_cast<VectorType>(Ty)) in getIntPtrType()
723 Type *Ty = ptrTy; in getIndexedOffset() local
724 assert(Ty->isPointerTy() && "Illegal argument for getIndexedOffset()"); in getIndexedOffset()
744 Ty = STy->getElementType(FieldNo); in getIndexedOffset()
747 Ty = cast<SequentialType>(Ty)->getElementType(); in getIndexedOffset()
751 Result += (uint64_t)arrayIdx * getTypeAllocSize(Ty); in getIndexedOffset()