Change the asmprinter to print the comment character before the
"inlineasmstart/end" strings so that the contents of the directive
are separate from the comment character. This lets elf targets
get #APP/#NOAPP for free even if they don't use "#" as the comment
character. This also allows hoisting the darwin stuff up to the
shared TAI class.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@78737 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
index 50733e6..5530896 100644
--- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp
@@ -1336,11 +1336,12 @@
// If this asmstr is empty, just print the #APP/#NOAPP markers.
// These are useful to see where empty asm's wound up.
if (AsmStr[0] == 0) {
- O << TAI->getInlineAsmStart() << "\n\t" << TAI->getInlineAsmEnd() << '\n';
+ O << TAI->getCommentString() << TAI->getInlineAsmStart() << "\n\t";
+ O << TAI->getCommentString() << TAI->getInlineAsmEnd() << '\n';
return;
}
- O << TAI->getInlineAsmStart() << "\n\t";
+ O << TAI->getCommentString() << TAI->getInlineAsmStart() << "\n\t";
// The variant of the current asmprinter.
int AsmPrinterVariant = TAI->getAssemblerDialect();
@@ -1511,7 +1512,7 @@
}
}
}
- O << "\n\t" << TAI->getInlineAsmEnd() << '\n';
+ O << "\n\t" << TAI->getCommentString() << TAI->getInlineAsmEnd() << '\n';
}
/// printImplicitDef - This method prints the specified machine instruction