summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-02-08 23:41:56 +0000
committerChris Lattner <sabre@nondot.org>2006-02-08 23:41:56 +0000
commited87dcd45fce9416ee96250bc046773ba950f62b (patch)
treef959f0581bc773c0e21c9e6887d1b35ac80f91b8 /llvm/lib/CodeGen/AsmPrinter.cpp
parent26e385a623d4ee2517106d8e5f85d464ada5c71d (diff)
downloadbcm5719-llvm-ed87dcd45fce9416ee96250bc046773ba950f62b.tar.gz
bcm5719-llvm-ed87dcd45fce9416ee96250bc046773ba950f62b.zip
Add support for assembler directives that wrap inline asm
llvm-svn: 26065
Diffstat (limited to 'llvm/lib/CodeGen/AsmPrinter.cpp')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 6fa66235508..263b35cf4d2 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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
OpenPOWER on IntegriCloud