replace printBasicBlockLabel with EmitBasicBlockStart,
authorChris Lattner <sabre@nondot.org>
Sun, 13 Sep 2009 18:25:37 +0000 (18:25 +0000)
committerChris Lattner <sabre@nondot.org>
Sun, 13 Sep 2009 18:25:37 +0000 (18:25 +0000)
now that printBasicBlockLabel is only used for starting
a MBB.  This allows elimination of a bunch of arguments.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@81684 91177308-0d34-0410-b5e6-96231b3b80d8

15 files changed:
include/llvm/CodeGen/AsmPrinter.h
lib/CodeGen/AsmPrinter/AsmPrinter.cpp
lib/Target/ARM/AsmPrinter/ARMAsmPrinter.cpp
lib/Target/Alpha/AsmPrinter/AlphaAsmPrinter.cpp
lib/Target/Blackfin/AsmPrinter/BlackfinAsmPrinter.cpp
lib/Target/CellSPU/AsmPrinter/SPUAsmPrinter.cpp
lib/Target/MSP430/AsmPrinter/MSP430AsmPrinter.cpp
lib/Target/Mips/AsmPrinter/MipsAsmPrinter.cpp
lib/Target/PIC16/AsmPrinter/PIC16AsmPrinter.cpp
lib/Target/PowerPC/AsmPrinter/PPCAsmPrinter.cpp
lib/Target/Sparc/AsmPrinter/SparcAsmPrinter.cpp
lib/Target/SystemZ/AsmPrinter/SystemZAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86ATTAsmPrinter.cpp
lib/Target/X86/AsmPrinter/X86IntelAsmPrinter.cpp
lib/Target/XCore/AsmPrinter/XCoreAsmPrinter.cpp

index cd30b39e36b0eec334f82465f7ea42dae11c8124..65090adfc68248945db0edbc71443608ea7a7f04 100644 (file)
@@ -350,12 +350,11 @@ namespace llvm {
     /// block label.
     MCSymbol *GetMBBSymbol(unsigned MBBID) const;
     
-    /// printBasicBlockLabel - This method prints the label for the specified
-    /// MachineBasicBlock
-    void printBasicBlockLabel(const MachineBasicBlock *MBB,
-                              bool printAlign = false,
-                              bool printColon = false,
-                              bool printComment = true) const;
+    /// EmitBasicBlockStart - This method prints the label for the specified
+    /// MachineBasicBlock, an alignment (if present) and a comment describing
+    /// it if appropriate.
+    void EmitBasicBlockStart(const MachineBasicBlock *MBB,
+                              bool printColon = true) const;
   protected:
     /// EmitZeros - Emit a block of zeros.
     ///
index 3af6dbf65c9655970710d995d478af84f0e5279d..c6339ebfc4ddd3fb06351925194cc12e9ae49672 100644 (file)
@@ -1644,22 +1644,20 @@ MCSymbol *AsmPrinter::GetMBBSymbol(unsigned MBBID) const {
 }
 
 
-/// printBasicBlockLabel - This method prints the label for the specified
-/// MachineBasicBlock
-void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
-                                      bool printAlign, bool printColon,
-                                      bool printComment) const {
-  if (printAlign) {
-    unsigned Align = MBB->getAlignment();
-    if (Align)
-      EmitAlignment(Log2_32(Align));
-  }
+/// EmitBasicBlockStart - This method prints the label for the specified
+/// MachineBasicBlock, an alignment (if present) and a comment describing
+/// it if appropriate.
+void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock *MBB,
+                                     bool PrintColon) const {
+  if (unsigned Align = MBB->getAlignment())
+    EmitAlignment(Log2_32(Align));
 
   GetMBBSymbol(MBB->getNumber())->print(O, MAI);
   
-  if (printColon)
+  if (PrintColon)
     O << ':';
-  if (printComment) {
+  
+  if (VerboseAsm) {
     if (const BasicBlock *BB = MBB->getBasicBlock())
       if (BB->hasName()) {
         O.PadToColumn(MAI->getCommentColumn());
@@ -1667,8 +1665,7 @@ void AsmPrinter::printBasicBlockLabel(const MachineBasicBlock *MBB,
         WriteAsOperand(O, BB, /*PrintType=*/false);
       }
 
-    if (printColon)
-      EmitComments(*MBB);
+    EmitComments(*MBB);
   }
 }
 
index b300a5c1bf869a17b1c932d922c78013144ce531..745faa7f3f59f46ca6a647c430ebea9a40b6ca69 100644 (file)
@@ -282,7 +282,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
        I != E; ++I) {
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true, true, VerboseAsm);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
index 2add269407c2f7daad3d531f19d32f4b2dabac32..f0b7fd7f615b5a016b172757d32bc544d4cd8fc3 100644 (file)
@@ -170,7 +170,7 @@ bool AlphaAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
   for (MachineFunction::const_iterator I = MF.begin(), E = MF.end();
        I != E; ++I) {
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true, true);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
index 62e28a4110404c59097642d19aa94c6fc0662256..d83d914ec583ba96a185c18d738f117d25a016af 100644 (file)
@@ -137,7 +137,7 @@ bool BlackfinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
       // This is an entry block or a block that's only reachable via a
       // fallthrough edge. In non-VerboseAsm mode, don't print the label.
     } else {
-      printBasicBlockLabel(I, true, true, VerboseAsm);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
 
index b4a9db40884c308890624d9a95e26dfeeb896d35..cc320e5a2bc4f43778cf9b6acc8ce0763456762e 100644 (file)
@@ -463,7 +463,7 @@ bool LinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
        I != E; ++I) {
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true, true);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
index 50a17549c11d64e5b7fae756fdc2d026429ea52c..cd0eb9cbde3359f473863ace68790df543dca6ae 100644 (file)
@@ -126,7 +126,7 @@ bool MSP430AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
       // This is an entry block or a block that's only reachable via a
       // fallthrough edge. In non-VerboseAsm mode, don't print the label.
     } else {
-      printBasicBlockLabel(I, true, true, VerboseAsm);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
 
index 4c7798d0c3c4cd2feab3a0f79449048a3d86dd9d..f4a9b36da8f7e0a4fa18a354c87be48f1b1e5f5d 100644 (file)
@@ -270,7 +270,7 @@ bool MipsAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
 
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true, true);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
 
index c1e3b3f295cabbab740d757f5699987caa1d2557..abec86509deafaecea9b318c8cf1ef77c92e9a24 100644 (file)
@@ -98,7 +98,7 @@ bool PIC16AsmPrinter::runOnMachineFunction(MachineFunction &MF) {
 
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true);
+      EmitBasicBlockStart(I, false);
       O << '\n';
     }
     
index e37313823db29967f86de721494b0bec16513a52..f21d371a4c3f5baf808d2ff84639e3706a5120ae 100644 (file)
@@ -670,7 +670,7 @@ bool PPCLinuxAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
        I != E; ++I) {
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true, true);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
@@ -854,7 +854,7 @@ bool PPCDarwinAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
        I != E; ++I) {
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true, true, VerboseAsm);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
index ff63542b703b6ed3281f57553281a8655b33f515..0d5b70dc899abdf3d6b700bb85aa0585b4e8bcbe 100644 (file)
@@ -122,7 +122,7 @@ bool SparcAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
        I != E; ++I) {
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true, true);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
index d3b1116079802bf5fa4c9025367ada96b5a356fa..8289010254465202527e811f98f886f428539ad9 100644 (file)
@@ -131,7 +131,7 @@ bool SystemZAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
       // This is an entry block or a block that's only reachable via a
       // fallthrough edge. In non-VerboseAsm mode, don't print the label.
     } else {
-      printBasicBlockLabel(I, true, true, VerboseAsm);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
 
index 4cdf875eb6cecf5190b0c7773fc815eab5cc60c8..8eac2df29b38c5b9d0749b75d7352ec52e0e7c9c 100644 (file)
@@ -245,7 +245,7 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
       // This is an entry block or a block that's only reachable via a
       // fallthrough edge. In non-VerboseAsm mode, don't print the label.
     } else {
-      printBasicBlockLabel(I, true, true, VerboseAsm);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), IE = I->end();
index 4ecab186c749fc842b76bf803912e44dd309b32a..3c0e12d71d932e22ea434298c85f2937c110a7a3 100644 (file)
@@ -170,7 +170,7 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
        I != E; ++I) {
     // Print a label for the basic block if there are any predecessors.
     if (!I->pred_empty()) {
-      printBasicBlockLabel(I, true, true);
+      EmitBasicBlockStart(I);
       O << '\n';
     }
     for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end();
index 233e762fb489a9d6a5c9fdc199eb147e31b1c5ba..bdb44efa2ee99dcb0f4e3cf052355d768b3399c5 100644 (file)
@@ -273,7 +273,7 @@ bool XCoreAsmPrinter::runOnMachineFunction(MachineFunction &MF)
 
     // Print a label for the basic block.
     if (I != MF.begin()) {
-      printBasicBlockLabel(I, true , true);
+      EmitBasicBlockStart(I);
       O << '\n';
     }