diff options
author | Chris Lattner <sabre@nondot.org> | 2004-11-13 23:27:11 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2004-11-13 23:27:11 +0000 |
commit | 4b2c09fa2226010285937c0d402a556f3b38f9f8 (patch) | |
tree | 2c2d5ff1e5b057c38c7f71f1c3af6ab0fd0cdc6a /lib/Target/X86 | |
parent | c7185ac36aced783494d2a3969f81a80f71ed126 (diff) | |
download | external_llvm-4b2c09fa2226010285937c0d402a556f3b38f9f8.zip external_llvm-4b2c09fa2226010285937c0d402a556f3b38f9f8.tar.gz external_llvm-4b2c09fa2226010285937c0d402a556f3b38f9f8.tar.bz2 |
Don't print unneeded labels
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@17714 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Target/X86')
-rw-r--r-- | lib/Target/X86/X86AsmPrinter.cpp | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/Target/X86/X86AsmPrinter.cpp b/lib/Target/X86/X86AsmPrinter.cpp index 0ec5570..a57c2fe 100644 --- a/lib/Target/X86/X86AsmPrinter.cpp +++ b/lib/Target/X86/X86AsmPrinter.cpp @@ -242,9 +242,10 @@ bool X86IntelAsmPrinter::runOnMachineFunction(MachineFunction &MF) { // Print out code for the function. for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) { - // Print a label for the basic block. - O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t" - << CommentString << " " << I->getBasicBlock()->getName() << "\n"; + // Print a label for the basic block if there are any predecessors. + if (I->pred_begin() != I->pred_end()) + O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t" + << CommentString << " " << I->getBasicBlock()->getName() << "\n"; for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { // Print the assembly for the instruction. @@ -465,8 +466,9 @@ bool X86ATTAsmPrinter::runOnMachineFunction(MachineFunction &MF) { for (MachineFunction::const_iterator I = MF.begin(), E = MF.end(); I != E; ++I) { // Print a label for the basic block. - O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t" - << CommentString << " " << I->getBasicBlock()->getName() << "\n"; + if (I->pred_begin() != I->pred_end()) + O << ".LBB" << CurrentFnName << "_" << I->getNumber() << ":\t" + << CommentString << " " << I->getBasicBlock()->getName() << "\n"; for (MachineBasicBlock::const_iterator II = I->begin(), E = I->end(); II != E; ++II) { // Print the assembly for the instruction. |