OSDN Git Service

Get rid of the annoying blank lines before labels.
authorEvan Cheng <evan.cheng@apple.com>
Sat, 2 Feb 2008 08:39:46 +0000 (08:39 +0000)
committerEvan Cheng <evan.cheng@apple.com>
Sat, 2 Feb 2008 08:39:46 +0000 (08:39 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@46667 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/AsmPrinter.cpp
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/Alpha/AlphaAsmPrinter.cpp
lib/Target/CellSPU/SPUAsmPrinter.cpp
lib/Target/IA64/IA64AsmPrinter.cpp
lib/Target/Mips/MipsAsmPrinter.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/X86/X86ATTAsmPrinter.cpp
lib/Target/X86/X86IntelAsmPrinter.cpp
utils/TableGen/AsmWriterEmitter.cpp

index eac5743..f581bd6 100644 (file)
@@ -1281,18 +1281,18 @@ void AsmPrinter::printInlineAsm(const MachineInstr *MI) const {
 /// printLabel - This method prints a local label used by debug and
 /// exception handling tables.
 void AsmPrinter::printLabel(const MachineInstr *MI) const {
-  O << "\n" << TAI->getPrivateGlobalPrefix()
+  O << TAI->getPrivateGlobalPrefix()
     << "label" << MI->getOperand(0).getImm() << ":\n";
 }
 
 void AsmPrinter::printLabel(unsigned Id) const {
-  O << "\n" << TAI->getPrivateGlobalPrefix() << "label" << Id << ":\n";
+  O << TAI->getPrivateGlobalPrefix() << "label" << Id << ":\n";
 }
 
 /// printDeclare - This method prints a local variable declaration used by
 /// debug tables.
 void AsmPrinter::printDeclare(const MachineInstr *MI) const {
-  O << "\n";
+  // Do nothing.
 }
 
 /// PrintAsmOperand - Print the specified operand of MI, an INLINEASM
index d56f618..609b4c4 100644 (file)
@@ -786,7 +786,6 @@ void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
     case ARM::tPICADD:
       break;
     default:
-      O << "\t";
       break;
     }
   }}
index 5d825bc..03ed3d6 100644 (file)
@@ -177,7 +177,6 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
          II != E; ++II) {
       // Print the assembly for the instruction.
       ++EmittedInsts;
-      O << "\t";
       if (!printInstruction(II)) {
         assert(0 && "Unhandled instruction in asm writer!");
         abort();
index 031e997..e5e7d04 100644 (file)
@@ -465,7 +465,6 @@ LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF)
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printMachineInstruction(II);
     }
   }
index d948557..c6d6626 100644 (file)
@@ -154,7 +154,6 @@ bool IA64AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printMachineInstruction(II);
     }
   }
index bd5d2b7..28cbdea 100644 (file)
@@ -304,7 +304,6 @@ runOnMachineFunction(MachineFunction &MF)
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printInstruction(II);
       ++EmittedInsts;
     }
index 6f0e41a..d2d7f53 100644 (file)
@@ -610,7 +610,6 @@ bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printMachineInstruction(II);
     }
   }
@@ -833,7 +832,6 @@ bool DarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
          II != IE; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printMachineInstruction(II);
     }
   }
index 2654283..12eae8a 100644 (file)
@@ -76,7 +76,7 @@ FunctionPass *llvm::createSparcCodePrinterPass(std::ostream &o,
   return new SparcAsmPrinter(o, tm, tm.getTargetAsmInfo());
 }
 
-/// runOnMachineFunction - This uses the printMachineInstruction()
+/// runOnMachineFunction - This uses the printInstruction()
 /// method to print assembly for each instruction.
 ///
 bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
@@ -121,7 +121,6 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printInstruction(II);
       ++EmittedInsts;
     }
index 20f2f00..a5b1b79 100644 (file)
@@ -186,7 +186,6 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
          II != IE; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printMachineInstruction(II);
     }
   }
index 39fc7a0..029533e 100644 (file)
@@ -84,7 +84,6 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
          II != E; ++II) {
       // Print the assembly for the instruction.
-      O << "\t";
       printMachineInstruction(II);
     }
   }
index eac7bd6..07ef2e5 100644 (file)
@@ -620,6 +620,7 @@ void AsmWriterEmitter::run(std::ostream &O) {
   O << "\";\n\n";
 
   O << "  if (MI->getOpcode() == TargetInstrInfo::INLINEASM) {\n"
+    << "    O << \"\\t\";\n"
     << "    printInlineAsm(MI);\n"
     << "    return true;\n"
     << "  } else if (MI->getOpcode() == TargetInstrInfo::LABEL) {\n"
@@ -630,6 +631,8 @@ void AsmWriterEmitter::run(std::ostream &O) {
     << "    return true;\n"
     << "  }\n\n";
   
+  O << "  O << \"\\t\";\n\n";
+
   O << "  // Emit the opcode for the instruction.\n"
     << "  unsigned Bits = OpInfo[MI->getOpcode()];\n"
     << "  if (Bits == 0) return false;\n"