summaryrefslogtreecommitdiffstats
path: root/llvm/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
commitdd8eeed096b636195cc4eba6b5c705c217a9a17d (patch)
tree0a7c6afafab92b43bc7c657ac88da44e067713c0 /llvm/lib/CodeGen/AsmPrinter.cpp
parent0aacd2ab9ba8daab865ecdf015be6b07f222043b (diff)
downloadbcm5719-llvm-dd8eeed096b636195cc4eba6b5c705c217a9a17d.tar.gz
bcm5719-llvm-dd8eeed096b636195cc4eba6b5c705c217a9a17d.zip
Teach emitAlignment to handle explicit alignment requests by globals.
llvm-svn: 24354
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 452cc0583ed..a6028e43de8 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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";
OpenPOWER on IntegriCloud