summaryrefslogtreecommitdiffstats
path: root/llvm/lib/Target/X86/X86AsmPrinter.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2004-11-13 23:27:11 +0000
committerChris Lattner <sabre@nondot.org>2004-11-13 23:27:11 +0000
commit56c4c99cca8704b276fc2c4e6c4a7da86fae5975 (patch)
treef5ad4639bece765c42fd70115eec2aac723770c0 /llvm/lib/Target/X86/X86AsmPrinter.cpp
parent79d046ba706ae530ab987b19433a551efdfabb8a (diff)
downloadbcm5719-llvm-56c4c99cca8704b276fc2c4e6c4a7da86fae5975.tar.gz
bcm5719-llvm-56c4c99cca8704b276fc2c4e6c4a7da86fae5975.zip
Don't print unneeded labels
llvm-svn: 17714
Diffstat (limited to 'llvm/lib/Target/X86/X86AsmPrinter.cpp')
-rw-r--r--llvm/lib/Target/X86/X86AsmPrinter.cpp12
1 files changed, 7 insertions, 5 deletions
diff --git a/llvm/lib/Target/X86/X86AsmPrinter.cpp b/llvm/lib/Target/X86/X86AsmPrinter.cpp
index 0ec55702539..a57c2fe6799 100644
--- a/llvm/lib/Target/X86/X86AsmPrinter.cpp
+++ b/llvm/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.
OpenPOWER on IntegriCloud