From 5af873932e6623acbafe9a9101117621ace755ec Mon Sep 17 00:00:00 2001 From: David Majnemer Date: Fri, 25 Dec 2015 09:37:26 +0000 Subject: [PATCH] [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. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@256413 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/AsmPrinter/AsmPrinter.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp index 73149441935..be7eafbeb83 100644 --- a/lib/CodeGen/AsmPrinter/AsmPrinter.cpp +++ b/lib/CodeGen/AsmPrinter/AsmPrinter.cpp @@ -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); } -- 2.34.1