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 eac574386b62aed61a70044586c221e0f716a543..f581bd6272df9b481387fbfd958e3c4aa81f36e3 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 d56f618d1ea15c29c0faa87bde4a3a1e0b5f1c6f..609b4c47daf4da79479551dcffcd46b36c9f51e9 100644 (file)
@@ -786,7 +786,6 @@ void ARMAsmPrinter::printMachineInstruction(const MachineInstr *MI) {
     case ARM::tPICADD:
       break;
     default:
-      O << "\t";
       break;
     }
   }}
index 5d825bc88c2f9ae454fc12cf1912ef364ffbcd3a..03ed3d6b68f1a179219ed2000b9ff7ab660fdaea 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 031e997b9c474289123d52b1ff2ba64ee9209930..e5e7d04fda17f2e68930cab7c910a8eb07bd25b5 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 d948557d4834b6e673cd195cdbaf7e7124ab6ae9..c6d662678b4fb8c9ae23e751960443a10e5e05e9 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 bd5d2b72af6a48b716cfde4e28bacfe04117262d..28cbdea1526b171d5b0dd83060c6af967ae60bf9 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 6f0e41aec5fc798280abf33ac9bc29a415ca2ab4..d2d7f53aed06f3214b580305463122b4bab996ed 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 265428365451436ca4dfa086a92d7fdcc18fcab3..12eae8ab95538cf817a0ac61882fb0bcd9420229 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 20f2f003722d72e0e73a79164fac270a6128b2ef..a5b1b796e1f6c0ce6149ab1f16aa4f8fb454a4be 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 39fc7a02f2585cfe372a2b00a59b13fb4fca157c..029533e9a6069d6326d5328ecef78b1562fe55bc 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 eac7bd63267cf80bed18c27df3ba16adf6ae5819..07ef2e5c8d0fe4d7e7cd652ff550e8819b2cab41 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"