[llvm-commits] [llvm] r93860 - in /llvm/trunk/lib: CodeGen/AsmPrinter/AsmPrinter.cpp MC/MCAsmStreamer.cpp

Chris Lattner sabre at nondot.org
Mon Jan 18 22:01:04 PST 2010


Author: lattner
Date: Tue Jan 19 00:01:04 2010
New Revision: 93860

URL: http://llvm.org/viewvc/llvm-project?rev=93860&view=rev
Log:
mc'ize some stuff, don't comment out .lcomm directive in -fverbose-asm mode.

Modified:
    llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
    llvm/trunk/lib/MC/MCAsmStreamer.cpp

Modified: llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp?rev=93860&r1=93859&r2=93860&view=diff

==============================================================================
--- llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp (original)
+++ llvm/trunk/lib/CodeGen/AsmPrinter/AsmPrinter.cpp Tue Jan 19 00:01:04 2010
@@ -169,26 +169,23 @@
       O.PadToColumn(MAI->getCommentColumn());
       O << MAI->getCommentString() << ' ';
       WriteAsOperand(O, GV, /*PrintType=*/false, GV->getParent());
+      O << '\n';
     }
     if (GVKind.isCommon()) {
       // .comm _foo, 42, 4
-      O << MAI->getCOMMDirective() << *GVSym << ',' << Size;
-      if (MAI->getCOMMDirectiveTakesAlignment())
-        O << ',' << (MAI->getAlignmentIsInBytes() ? (1 << AlignLog) : AlignLog);
+      OutStreamer.EmitCommonSymbol(GVSym, Size, 1 << AlignLog);
     } else if (const char *LComm = MAI->getLCOMMDirective()) {
       // .lcomm _foo, 42, 4
       O << LComm << *GVSym << ',' << Size;
       if (MAI->getLCOMMDirectiveTakesAlignment())
         O << ',' << AlignLog;
+      O << '\n';
     } else {
       // .local _foo
       O << "\t.local\t" << *GVSym << '\n';
       // .comm _foo, 42, 4
-      O << MAI->getCOMMDirective() << *GVSym << ',' << Size;
-      if (MAI->getCOMMDirectiveTakesAlignment())
-        O << ',' << (MAI->getAlignmentIsInBytes() ? (1 << AlignLog) : AlignLog);
+      OutStreamer.EmitCommonSymbol(GVSym, Size, 1 << AlignLog);
     }
-    O << '\n';
     return;
   }
   

Modified: llvm/trunk/lib/MC/MCAsmStreamer.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/MC/MCAsmStreamer.cpp?rev=93860&r1=93859&r2=93860&view=diff

==============================================================================
--- llvm/trunk/lib/MC/MCAsmStreamer.cpp (original)
+++ llvm/trunk/lib/MC/MCAsmStreamer.cpp Tue Jan 19 00:01:04 2010
@@ -151,9 +151,13 @@
 
 void MCAsmStreamer::EmitCommonSymbol(MCSymbol *Symbol, unsigned Size,
                                      unsigned ByteAlignment) {
-  OS << ".comm " << *Symbol << ',' << Size;
-  if (ByteAlignment != 0)
-    OS << ',' << Log2_32(ByteAlignment);
+  OS << MAI.getCOMMDirective() << *Symbol << ',' << Size;
+  if (ByteAlignment != 0 && MAI.getCOMMDirectiveTakesAlignment()) {
+    if (MAI.getAlignmentIsInBytes())
+      OS << ',' << ByteAlignment;
+    else
+      OS << ',' << Log2_32(ByteAlignment);
+  }
   OS << '\n';
 }
 





More information about the llvm-commits mailing list