unsigned NumElements =
getOperandValue(I.getOperand(0), SF).IntVal.getZExtValue();
- unsigned TypeSize = (size_t)TD.getTypeAllocSize(Ty);
+ unsigned TypeSize = (size_t)getDataLayout().getTypeAllocSize(Ty);
// Avoid malloc-ing zero bytes, use max()...
unsigned MemToAlloc = std::max(1U, NumElements * TypeSize);
for (; I != E; ++I) {
if (StructType *STy = dyn_cast<StructType>(*I)) {
- const StructLayout *SLO = TD.getStructLayout(STy);
+ const StructLayout *SLO = getDataLayout().getStructLayout(STy);
const ConstantInt *CPU = cast<ConstantInt>(I.getOperand());
unsigned Index = unsigned(CPU->getZExtValue());
assert(BitWidth == 64 && "Invalid index type for getelementptr");
Idx = (int64_t)IdxGV.IntVal.getZExtValue();
}
- Total += TD.getTypeAllocSize(ST->getElementType())*Idx;
+ Total += getDataLayout().getTypeAllocSize(ST->getElementType()) * Idx;
}
}
GenericValue Dest, Src = getOperandValue(SrcVal, SF);
assert(DstTy->isPointerTy() && "Invalid PtrToInt instruction");
- uint32_t PtrSize = TD.getPointerSizeInBits();
+ uint32_t PtrSize = getDataLayout().getPointerSizeInBits();
if (PtrSize != Src.IntVal.getBitWidth())
Src.IntVal = Src.IntVal.zextOrTrunc(PtrSize);
(DstTy->getTypeID() == Type::VectorTyID)) {
// vector src bitcast to vector dst or vector src bitcast to scalar dst or
// scalar src bitcast to vector dst
- bool isLittleEndian = TD.isLittleEndian();
+ bool isLittleEndian = getDataLayout().isLittleEndian();
GenericValue TempDst, TempSrc, SrcVec;
const Type *SrcElemTy;
const Type *DstElemTy;