aboutsummaryrefslogtreecommitdiff
path: root/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2010-04-03 21:13:18 +0000
committerChris Lattner <sabre@nondot.org>2010-04-03 21:13:18 +0000
commit47b7e5dae911bc98aa76fa5d2ee506c9304f941a (patch)
tree0495618b628df5468b844a1c27152262a7ba6c9b /lib/CodeGen
parent4d12fdc2d96cc02578df9bf27aef641e4a09373b (diff)
mc'ize comment printing around file scope inline asm.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@100288 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen')
-rw-r--r--lib/CodeGen/AsmPrinter/AsmPrinter.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 625a2b95f2..2cb4d01574 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -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)