Use getPreferredAlignmentLog or getPreferredAlignment

to get the alignment of global variables, rather than
using hand-made versions.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46495 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Duncan Sands
2008-01-29 06:23:44 +00:00
parent a34d8a0d83
commit d102593b42
7 changed files with 32 additions and 20 deletions

View File

@ -257,7 +257,7 @@ void ELFWriter::EmitGlobal(GlobalVariable *GV) {
}
const Type *GVType = (const Type*)GV->getType();
unsigned Align = TM.getTargetData()->getPrefTypeAlignment(GVType);
unsigned Align = TM.getTargetData()->getPreferredAlignment(GV);
unsigned Size = TM.getTargetData()->getABITypeSize(GVType);
// If this global has a zero initializer, it is part of the .bss or common