diff options
author | Duncan Sands <baldrick@free.fr> | 2008-01-29 06:23:44 +0000 |
---|---|---|
committer | Duncan Sands <baldrick@free.fr> | 2008-01-29 06:23:44 +0000 |
commit | d102593b425da27fa96359300ff0e3d547d0ac8d (patch) | |
tree | 1e1c378b5a251371647bbaac306a9a2ea3873d21 /lib/CodeGen/MachOWriter.cpp | |
parent | a34d8a0d83bb39f4058e5dea4558e69cc4eda37c (diff) |
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
Diffstat (limited to 'lib/CodeGen/MachOWriter.cpp')
-rw-r--r-- | lib/CodeGen/MachOWriter.cpp | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/lib/CodeGen/MachOWriter.cpp b/lib/CodeGen/MachOWriter.cpp index 56bf70a62a..71e7430635 100644 --- a/lib/CodeGen/MachOWriter.cpp +++ b/lib/CodeGen/MachOWriter.cpp @@ -334,10 +334,8 @@ MachOWriter::~MachOWriter() { void MachOWriter::AddSymbolToSection(MachOSection *Sec, GlobalVariable *GV) { const Type *Ty = GV->getType()->getElementType(); unsigned Size = TM.getTargetData()->getABITypeSize(Ty); - unsigned Align = GV->getAlignment(); - if (Align == 0) - Align = TM.getTargetData()->getPrefTypeAlignment(Ty); - + unsigned Align = TM.getTargetData()->getPreferredAlignment(GV); + // Reserve space in the .bss section for this symbol while maintaining the // desired section alignment, which must be at least as much as required by // this symbol. |