mc'ize comment printing around file scope inline asm.
authorChris Lattner <sabre@nondot.org>
Sat, 3 Apr 2010 21:13:18 +0000 (21:13 +0000)
committerChris Lattner <sabre@nondot.org>
Sat, 3 Apr 2010 21:13:18 +0000 (21:13 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100288 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter/AsmPrinter.cpp

index 625a2b95f205a8f59d600186229435b080b85a85..2cb4d01574a9de003ed6090cc27cbbae8dbe3be9 100644 (file)
@@ -126,11 +126,16 @@ bool AsmPrinter::doInitialization(Module &M) {
     if (GCMetadataPrinter *MP = GetOrCreateGCPrinter(*I))
       MP->beginAssembly(O, *this, *MAI);
   
-  if (!M.getModuleInlineAsm().empty())
-    O << MAI->getCommentString() << " Start of file scope inline assembly\n"
-      << M.getModuleInlineAsm()
-      << '\n' << MAI->getCommentString()
-      << " End of file scope inline assembly\n";
+  if (!M.getModuleInlineAsm().empty()) {
+    OutStreamer.AddComment("Start of file scope inline assembly");
+    OutStreamer.AddBlankLine();
+    O << M.getModuleInlineAsm();
+    
+    if (*M.getModuleInlineAsm().rbegin() != '\n')
+      OutStreamer.AddBlankLine();
+    OutStreamer.AddComment("End of file scope inline assembly");
+    OutStreamer.AddBlankLine();
+  }
 
   DW = getAnalysisIfAvailable<DwarfWriter>();
   if (DW)