[CodeGen] Use generic printAsOperand machinery instead of hand rolling it

We already know how to properly print out basic blocks in
printAsOperand, we should not roll it ourselves in
AsmPrinter::EmitBasicBlockStart.  No functionality change is intended.

llvm-svn: 256413
This commit is contained in:
David Majnemer 2015-12-25 09:37:26 +00:00
parent 498f558fcf
commit 11234ed7d3
1 changed files with 7 additions and 3 deletions

View File

@ -2503,9 +2503,13 @@ void AsmPrinter::EmitBasicBlockStart(const MachineBasicBlock &MBB) const {
// Print some verbose block comments.
if (isVerbose()) {
if (const BasicBlock *BB = MBB.getBasicBlock())
if (BB->hasName())
OutStreamer->AddComment("%" + BB->getName());
if (const BasicBlock *BB = MBB.getBasicBlock()) {
if (BB->hasName()) {
BB->printAsOperand(OutStreamer->GetCommentOS(),
/*PrintType=*/false, BB->getModule());
OutStreamer->GetCommentOS() << '\n';
}
}
emitBasicBlockLoopComments(MBB, LI, *this);
}