Use a extant helper to do this.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@22802 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2005-08-16 18:31:23 +00:00
parent 149c58ce0b
commit ad95d6ab20

View File

@ -47,25 +47,13 @@ namespace llvm {
std::string DOTGraphTraits<SelectionDAG*>::getNodeLabel(const SDNode *Node,
const SelectionDAG *G) {
std::string Op = Node->getOperationName();
std::string Op = Node->getOperationName(G);
for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i) {
switch (Node->getValueType(i)) {
default: Op += ":unknownvt!"; break;
case MVT::Other: Op += ":ch"; break;
case MVT::i1: Op += ":i1"; break;
case MVT::i8: Op += ":i8"; break;
case MVT::i16: Op += ":i16"; break;
case MVT::i32: Op += ":i32"; break;
case MVT::i64: Op += ":i64"; break;
case MVT::i128: Op += ":i128"; break;
case MVT::f32: Op += ":f32"; break;
case MVT::f64: Op += ":f64"; break;
case MVT::f80: Op += ":f80"; break;
case MVT::f128: Op += ":f128"; break;
case MVT::isVoid: Op += ":void"; break;
}
}
for (unsigned i = 0, e = Node->getNumValues(); i != e; ++i)
if (Node->getValueType(i) == MVT::Other)
Op += ":ch";
else
Op = Op + ":" + MVT::getValueTypeString(Node->getValueType(i));
if (const ConstantSDNode *CSDN = dyn_cast<ConstantSDNode>(Node)) {
Op += ": " + utostr(CSDN->getValue());