Print SrcValue nodes correctly
authorChris Lattner <sabre@nondot.org>
Mon, 9 May 2005 04:08:27 +0000 (04:08 +0000)
committerChris Lattner <sabre@nondot.org>
Mon, 9 May 2005 04:08:27 +0000 (04:08 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21803 91177308-0d34-0410-b5e6-96231b3b80d8

lib/CodeGen/SelectionDAG/SelectionDAG.cpp
lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp

index f4d7adcc4edee2e966ae070e85874d6a14b00451..965976cce3d0c6718032d4a58fc9b37eed78bf1b 100644 (file)
@@ -1554,6 +1554,7 @@ const char *SDNode::getOperationName() const {
   switch (getOpcode()) {
   default: return "<<Unknown>>";
   case ISD::PCMARKER:      return "PCMarker";
+  case ISD::SRCVALUE:      return "SrcValue";
   case ISD::EntryToken:    return "EntryToken";
   case ISD::TokenFactor:   return "TokenFactor";
   case ISD::Constant:      return "Constant";
@@ -1712,6 +1713,11 @@ void SDNode::dump() const {
     std::cerr << "'" << ES->getSymbol() << "'";
   } else if (const MVTSDNode *M = dyn_cast<MVTSDNode>(this)) {
     std::cerr << " - Ty = " << MVT::getValueTypeString(M->getExtraValueType());
+  } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(this)) {
+    if (M->getValue())
+      std::cerr << "<" << M->getValue() << ":" << M->getOffset() << ">";
+    else
+      std::cerr << "<null:" << M->getOffset() << ">";
   }
 }
 
index 2ed1fe470920a8df6152f89e1f0f466d84da3dab..8d8e1fd3662a2a267f32daeaf5bc3f0f7781f854 100644 (file)
@@ -90,6 +90,11 @@ std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
     Op += "'" + std::string(ES->getSymbol()) + "'";
   } else if (const MVTSDNode *M = dyn_cast<MVTSDNode>(Node)) {
     Op = Op + " ty=" + MVT::getValueTypeString(M->getExtraValueType());
+  } else if (const SrcValueSDNode *M = dyn_cast<SrcValueSDNode>(Node)) {
+    if (M->getValue())
+      Op += "<" + M->getValue()->getName() + ":" + itostr(M->getOffset()) + ">";
+    else
+      Op += "<null:" + itostr(M->getOffset()) + ">";
   }
   return Op;
 }