diff options
Diffstat (limited to 'llvm/lib/IR/AsmWriter.cpp')
-rw-r--r-- | llvm/lib/IR/AsmWriter.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/llvm/lib/IR/AsmWriter.cpp b/llvm/lib/IR/AsmWriter.cpp index 07dea403d56..ad6c2c8e883 100644 --- a/llvm/lib/IR/AsmWriter.cpp +++ b/llvm/lib/IR/AsmWriter.cpp @@ -3482,23 +3482,24 @@ void AssemblyWriter::printArgument(const Argument *Arg, AttributeSet Attrs) { /// printBasicBlock - This member is called for each basic block in a method. void AssemblyWriter::printBasicBlock(const BasicBlock *BB) { + bool IsEntryBlock = BB == &BB->getParent()->getEntryBlock(); if (BB->hasName()) { // Print out the label if it exists... Out << "\n"; PrintLLVMName(Out, BB->getName(), LabelPrefix); Out << ':'; - } else if (!BB->use_empty()) { // Don't print block # of no uses... - Out << "\n; <label>:"; + } else if (!IsEntryBlock) { + Out << "\n"; int Slot = Machine.getLocalSlot(BB); if (Slot != -1) Out << Slot << ":"; else - Out << "<badref>"; + Out << "<badref>:"; } if (!BB->getParent()) { Out.PadToColumn(50); Out << "; Error: Block without parent!"; - } else if (BB != &BB->getParent()->getEntryBlock()) { // Not the entry block? + } else if (!IsEntryBlock) { // Output predecessors for the block. Out.PadToColumn(50); Out << ";"; |