OSDN Git Service

Include MachineBasicBlock numbers in viewCFG() output.
authorJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 30 Oct 2010 01:26:19 +0000 (01:26 +0000)
committerJakob Stoklund Olesen <stoklund@2pi.dk>
Sat, 30 Oct 2010 01:26:19 +0000 (01:26 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@117765 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/MachineFunction.cpp

index c329069..4a23d6e 100644 (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);
       }