diff options
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r-- | llvm/lib/CodeGen/AsmPrinter.cpp | 4 |
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"; |