diff options
author | Chris Lattner <sabre@nondot.org> | 2005-11-14 19:00:06 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2005-11-14 19:00:06 +0000 |
commit | a1ab72daadbdc5b499ce7e7e97c4b80efad46736 (patch) | |
tree | df28d73e5b7122dda99d47f25d3ad5bfb342db8d /lib/CodeGen/AsmPrinter.cpp | |
parent | ac7fd7fcc67948475c89f033b90d94b666722dd7 (diff) |
Teach emitAlignment to handle explicit alignment requests by globals.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24354 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/AsmPrinter.cpp')
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 452cc0583e..a6028e43de 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -35,7 +35,9 @@ void AsmPrinter::setupMachineFunction(MachineFunction &MF) { } // emitAlignment - Emit an alignment directive to the specified power of two. -void AsmPrinter::emitAlignment(unsigned NumBits) const { +void AsmPrinter::emitAlignment(unsigned NumBits, const GlobalValue *GV) const { + if (GV && GV->getAlignment()) + NumBits = Log2_32(GV->getAlignment()); if (NumBits == 0) return; // No need to emit alignment. if (AlignmentIsInBytes) NumBits = 1 << NumBits; O << AlignDirective << NumBits << "\n"; |