aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2005-11-14 19:00:06 +0000
committerChris Lattner <sabre@nondot.org>2005-11-14 19:00:06 +0000
commita1ab72daadbdc5b499ce7e7e97c4b80efad46736 (patch)
treedf28d73e5b7122dda99d47f25d3ad5bfb342db8d /lib/CodeGen/AsmPrinter.cpp
parentac7fd7fcc67948475c89f033b90d94b666722dd7 (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.cpp4
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";