Include MachineBasicBlock numbers in viewCFG() output.

llvm-svn: 117765
This commit is contained in:
Jakob Stoklund Olesen 2010-10-30 01:26:19 +00:00
parent 0cfc497f19
commit 80717dd7c6
1 changed files with 6 additions and 8 deletions

View File

@ -347,17 +347,15 @@ namespace llvm {
std::string getNodeLabel(const MachineBasicBlock *Node,
const MachineFunction *Graph) {
if (isSimple () && Node->getBasicBlock() &&
!Node->getBasicBlock()->getName().empty())
return Node->getBasicBlock()->getNameStr() + ":";
std::string OutStr;
{
raw_string_ostream OSS(OutStr);
if (isSimple())
OSS << Node->getNumber() << ':';
else
if (isSimple()) {
OSS << "BB#" << Node->getNumber();
if (const BasicBlock *BB = Node->getBasicBlock())
OSS << ": " << BB->getName();
} else
Node->print(OSS);
}