summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-07-28 00:17:20 +0000
committerChris Lattner <sabre@nondot.org>2006-07-28 00:17:20 +0000
commit3390cbed2c74a69c355db9862f3b78ec2ba265a5 (patch)
treede28750b8820701dd6fb014353c0dda81f66321a /llvm/lib/CodeGen
parent3b5e0cafd12d8fcf0daa6fde93bd026aefb36a50 (diff)
downloadbcm5719-llvm-3390cbed2c74a69c355db9862f3b78ec2ba265a5.tar.gz
bcm5719-llvm-3390cbed2c74a69c355db9862f3b78ec2ba265a5.zip
Print empty inline asms as a blank line instead of:
# InlineAsm Start # InlineAsm End llvm-svn: 29372
Diffstat (limited to 'llvm/lib/CodeGen')
-rw-r--r--llvm/lib/CodeGen/AsmPrinter.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/AsmPrinter.cpp b/llvm/lib/CodeGen/AsmPrinter.cpp
index 489d3414de0..205c68751f6 100644
--- a/llvm/lib/CodeGen/AsmPrinter.cpp
+++ b/llvm/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;
OpenPOWER on IntegriCloud