From 7e57d18b79be55e64bd79b3af6b823dafafeb17e Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Tue, 16 Aug 2005 18:31:23 +0000 Subject: Use a extant helper to do this. llvm-svn: 22802 --- .../CodeGen/SelectionDAG/SelectionDAGPrinter.cpp | 26 ++++++---------------- 1 file changed, 7 insertions(+), 19 deletions(-) (limited to 'llvm') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp index a94aaa4aaa7..a60acc12080 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -47,26 +47,14 @@ namespace llvm { std::string DOTGraphTraits::getNodeLabel(const SDNode *Node, const SelectionDAG *G) { - std::string Op = Node->getOperationName(); - - 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; - } - } + std::string Op = Node->getOperationName(G); + 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(Node)) { Op += ": " + utostr(CSDN->getValue()); } else if (const ConstantFPSDNode *CSDN = dyn_cast(Node)) { -- cgit v1.2.3