switch asmprinter to emit alignments through OutStreamer.



git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79406 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 1762859..7d72b0c 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -753,15 +753,12 @@
   NumBits = std::max(NumBits, ForcedAlignBits);
   
   if (NumBits == 0) return;   // No need to emit alignment.
-  if (TAI->getAlignmentIsInBytes()) NumBits = 1 << NumBits;
-  O << TAI->getAlignDirective() << NumBits;
-
+  
+  unsigned FillValue = 0;
   if (getCurrentSection()->getKind().isText())
-    if (unsigned FillValue = TAI->getTextAlignFillValue()) {
-      O << ',';
-      PrintHex(FillValue);
-    }
-  O << '\n';
+    FillValue = TAI->getTextAlignFillValue();
+  
+  OutStreamer.EmitValueToAlignment(1 << NumBits, FillValue, 1, 0);
 }
 
 /// EmitZeros - Emit a block of zeros.