mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2025-11-23 00:20:25 +00:00
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:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user