aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/llvm/CodeGen/AsmPrinter.h5
-rw-r--r--lib/CodeGen/AsmPrinter.cpp5
2 files changed, 9 insertions, 1 deletions
diff --git a/include/llvm/CodeGen/AsmPrinter.h b/include/llvm/CodeGen/AsmPrinter.h
index 94c12f7a14..956e8864a0 100644
--- a/include/llvm/CodeGen/AsmPrinter.h
+++ b/include/llvm/CodeGen/AsmPrinter.h
@@ -86,6 +86,11 @@ namespace llvm {
const char *FunctionAddrPrefix; // Defaults to ""
const char *FunctionAddrSuffix; // Defaults to ""
+ /// InlineAsmStart/End - If these are nonempty, they contain a directive to
+ /// emit before and after an inline assmebly statement.
+ const char *InlineAsmStart; // Defaults to "#APP\n"
+ const char *InlineAsmEnd; // Defaults to "#NO_APP\n"
+
//===--- Data Emission Directives -------------------------------------===//
/// ZeroDirective - this should be set to the directive used to get some
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp
index 6fa6623550..263b35cf4d 100644
--- a/lib/CodeGen/AsmPrinter.cpp
+++ b/lib/CodeGen/AsmPrinter.cpp
@@ -32,6 +32,8 @@ AsmPrinter::AsmPrinter(std::ostream &o, TargetMachine &tm)
GlobalVarAddrSuffix(""),
FunctionAddrPrefix(""),
FunctionAddrSuffix(""),
+ InlineAsmStart("#APP\n"),
+ InlineAsmEnd("#NO_APP\n"),
ZeroDirective("\t.zero\t"),
AsciiDirective("\t.ascii\t"),
AscizDirective("\t.asciz\t"),
@@ -482,6 +484,7 @@ void AsmPrinter::EmitGlobalConstant(const Constant *CV) {
/// printInlineAsm - This method formats and prints the specified machine
/// instruction that is an inline asm.
void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
+ O << InlineAsmStart;
unsigned NumOperands = MI->getNumOperands();
// Count the number of register definitions.
@@ -613,7 +616,7 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
break;
}
}
- O << "\n";
+ O << "\n" << InlineAsmEnd;
}
/// PrintAsmOperand - Print the specified operand of MI, an INLINEASM