Improve debug output for MemOperandSDNode. PseudoSourceValue nodes
authorDan Gohman <gohman@apple.com>
Mon, 14 Jul 2008 17:51:24 +0000 (17:51 +0000)
committerDan Gohman <gohman@apple.com>
Mon, 14 Jul 2008 17:51:24 +0000 (17:51 +0000)
don't have value names, so use print instead of getName() to get a
useful string.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@53563 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

index db119a649549c0e42dd947410101b3ebfa451ad9..cdfdf6f9a222391fa3e9cdc8c50f5f4e0e2c09f6 100644 (file)
@@ -155,10 +155,13 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
     else
       Op += "<null>";
   } else if (const MemOperandSDNode *M = dyn_cast<MemOperandSDNode>(Node)) {
-    if (M->MO.getValue())
-      Op += "<" + M->MO.getValue()->getName() + ":" + itostr(M->MO.getOffset()) + ">";
-    else
-      Op += "<null:" + itostr(M->MO.getOffset()) + ">";
+    if (M->MO.getValue()) {
+      std::ostringstream SS;
+      M->MO.getValue()->print(SS);
+      Op += "<" + SS.str() + "+" + itostr(M->MO.getOffset()) + ">";
+    } else {
+      Op += "<(unknown)+" + itostr(M->MO.getOffset()) + ">";
+    }
   } else if (const ARG_FLAGSSDNode *N = dyn_cast<ARG_FLAGSSDNode>(Node)) {
     Op = Op + " AF=" + N->getArgFlags().getArgFlagsString();
   } else if (const VTSDNode *N = dyn_cast<VTSDNode>(Node)) {