return Base;
// Truncate/sext the offset to the pointer size.
- unsigned AS = PtrVal->getType()->isPointerTy() ?
- cast<PointerType>(PtrVal->getType())->getAddressSpace() : 0;
- if (TD.getPointerSizeInBits(AS) != 64) {
- int SExtAmount = 64-TD.getPointerSizeInBits(AS);
+ if (TD.getPointerSizeInBits() != 64) {
+ int SExtAmount = 64-TD.getPointerSizeInBits();
Offset = (Offset << SExtAmount) >> SExtAmount;
}
const FunctionType *FTy = dyn_cast<FunctionType>(Ty);
if (FTy)
- return TD->getPointerPrefAlignment(0);
+ return TD->getPointerPrefAlignment();
return TD->getPrefTypeAlignment(Ty);
}