/// the specified type.
unsigned char getTypeAlignmentPref(const Type *Ty) const;
- /// getTypeAlignmentShift - Return the preferred alignment for the
+ /// getPreferredTypeAlignmentShift - Return the preferred alignment for the
/// specified type, returned as log2 of the value (a shift amount).
///
- unsigned char getTypeAlignmentShift(const Type *Ty) const;
+ unsigned char getPreferredTypeAlignmentShift(const Type *Ty) const;
/// getIntPtrType - Return an unsigned integer type that is the same size or
/// greater to the host pointer size.
const Type *Type = CP->getType();
// MachineConstantPool wants an explicit alignment.
if (Align == 0) {
- Align = TM.getTargetData()->getTypeAlignmentShift(Type);
+ Align = TM.getTargetData()->getPreferredTypeAlignmentShift(Type);
if (Align == 0) {
// Alignment of packed types. FIXME!
Align = TM.getTargetData()->getTypeSize(Type);
std::string name = Mang->getValueName(I);
Constant *C = I->getInitializer();
unsigned Size = TD->getTypeSize(C->getType());
- // unsigned Align = TD->getTypeAlignmentShift(C->getType());
+ // unsigned Align = TD->getPreferredTypeAlignmentShift(C->getType());
unsigned Align = TD->getPreferredAlignmentLog(I);
if (C->isNullValue() &&
std::string name = Mang->getValueName(I);
Constant *C = I->getInitializer();
unsigned Size = TD->getTypeSize(C->getType());
- unsigned Align = TD->getTypeAlignmentShift(C->getType());
+ unsigned Align = TD->getPreferredTypeAlignmentShift(C->getType());
if (C->isNullValue() &&
(I->hasLinkOnceLinkage() || I->hasInternalLinkage() ||
return Align;
}
-unsigned char TargetData::getTypeAlignmentShift(const Type *Ty) const {
+unsigned char TargetData::getPreferredTypeAlignmentShift(const Type *Ty) const {
unsigned Align = getTypeAlignmentPref(Ty);
assert(!(Align & (Align-1)) && "Alignment is not a power of two!");
return Log2_32(Align);
/// requested alignment (if the global has one).
unsigned TargetData::getPreferredAlignmentLog(const GlobalVariable *GV) const {
const Type *ElemType = GV->getType()->getElementType();
- unsigned Alignment = getTypeAlignmentShift(ElemType);
+ unsigned Alignment = getPreferredTypeAlignmentShift(ElemType);
if (GV->getAlignment() > (1U << Alignment))
Alignment = Log2_32(GV->getAlignment());