Compile C strings to:
authorChris Lattner <sabre@nondot.org>
Thu, 10 Nov 2005 18:09:27 +0000 (18:09 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 10 Nov 2005 18:09:27 +0000 (18:09 +0000)
l1__2E_str_1:                           ; '.str_1'
        .asciz  "foo"

not:

        .align  0
l1__2E_str_1:                           ; '.str_1'
        .asciz  "foo"

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24273 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp

index ae569bd15ae7bb4ea0c7f43bf5f0fbdb3268887b..0ba39c22584ce83c2b652cf9c8e2d46aba50d90b 100644 (file)
@@ -36,6 +36,7 @@ void AsmPrinter::setupMachineFunction(MachineFunction &MF) {
 
 // emitAlignment - Emit an alignment directive to the specified power of two.
 void AsmPrinter::emitAlignment(unsigned NumBits) const {
+  if (NumBits == 0) return;   // No need to emit alignment.
   if (AlignmentIsInBytes) NumBits = 1 << NumBits;
   O << AlignDirective << NumBits << "\n";
 }