// Ignore fancy-aligned globals for now.
unsigned Alignment = I->getAlignment();
- unsigned AllocSize = TD->getTypeAllocSize(I->getType()->getElementType());
- if (Alignment > AllocSize)
+ const Type *Ty = I->getType()->getElementType();
+ if (Alignment > TD->getABITypeAlignment(Ty))
continue;
// Ignore all 'special' globals.
I->getName().startswith(".llvm."))
continue;
- if (AllocSize < MaxOffset) {
+ if (TD->getTypeAllocSize(Ty) < MaxOffset) {
const TargetLoweringObjectFile &TLOF = TLI->getObjFileLowering();
if (TLOF.getKindForGlobal(I, TLI->getTargetMachine()).isBSSLocal())
BSSGlobals.push_back(I);