diff options
author | Chris Lattner <sabre@nondot.org> | 2006-07-28 00:17:20 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2006-07-28 00:17:20 +0000 |
commit | f26f5dde14dddb7540d4d8024ecdd7f5a8390b39 (patch) | |
tree | d272b81777d3c659b20966c011e8ac11c7de0d58 | |
parent | 63ce5682e29f62d5c779e54a6362ba8ff038d350 (diff) | |
download | external_llvm-f26f5dde14dddb7540d4d8024ecdd7f5a8390b39.zip external_llvm-f26f5dde14dddb7540d4d8024ecdd7f5a8390b39.tar.gz external_llvm-f26f5dde14dddb7540d4d8024ecdd7f5a8390b39.tar.bz2 |
Print empty inline asms as a blank line instead of:
# InlineAsm Start
# InlineAsm End
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@29372 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r-- | lib/CodeGen/AsmPrinter.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/CodeGen/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter.cpp index 489d341..205c687 100644 --- a/lib/CodeGen/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter.cpp @@ -615,7 +615,6 @@ 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 << "\n\t"; unsigned NumOperands = MI->getNumOperands(); // Count the number of register definitions. @@ -628,6 +627,14 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const { // Disassemble the AsmStr, printing out the literal pieces, the operands, etc. const char *AsmStr = MI->getOperand(NumDefs).getSymbolName(); + // If this asmstr is empty, don't bother printing the #APP/#NOAPP markers. + if (AsmStr[0] == 0) { + O << "\n"; // Tab already printed, avoid double indenting next instr. + return; + } + + O << InlineAsmStart << "\n\t"; + // The variant of the current asmprinter: FIXME: change. int AsmPrinterVariant = 0; |