From: Chris Lattner Date: Mon, 9 May 2005 04:08:27 +0000 (+0000) Subject: Print SrcValue nodes correctly X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=2bf3c26b2bb783aada259f1c70be6dd0798f6126;p=oota-llvm.git Print SrcValue nodes correctly git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@21803 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index f4d7adcc4ed..965976cce3d 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1554,6 +1554,7 @@ const char *SDNode::getOperationName() const { switch (getOpcode()) { default: return "<>"; 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(this)) { std::cerr << " - Ty = " << MVT::getValueTypeString(M->getExtraValueType()); + } else if (const SrcValueSDNode *M = dyn_cast(this)) { + if (M->getValue()) + std::cerr << "<" << M->getValue() << ":" << M->getOffset() << ">"; + else + std::cerr << "getOffset() << ">"; } } diff --git a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index 2ed1fe47092..8d8e1fd3662 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -90,6 +90,11 @@ std::string DOTGraphTraits::getNodeLabel(const SDNode *Node, Op += "'" + std::string(ES->getSymbol()) + "'"; } else if (const MVTSDNode *M = dyn_cast(Node)) { Op = Op + " ty=" + MVT::getValueTypeString(M->getExtraValueType()); + } else if (const SrcValueSDNode *M = dyn_cast(Node)) { + if (M->getValue()) + Op += "<" + M->getValue()->getName() + ":" + itostr(M->getOffset()) + ">"; + else + Op += "getOffset()) + ">"; } return Op; }