From 6af02635a705dd6a20877a988a0ad77a769dd680 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Tue, 20 Dec 2005 06:22:03 +0000 Subject: Added a hook to print out names of target specific DAG nodes. llvm-svn: 24877 --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp') diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index ad8cca742a1..3438863c903 100644 --- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1835,15 +1835,18 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const { if (getOpcode() < ISD::BUILTIN_OP_END) return "<>"; else { - if (G) + if (G) { if (const TargetInstrInfo *TII = G->getTarget().getInstrInfo()) if (getOpcode()-ISD::BUILTIN_OP_END < TII->getNumOpcodes()) return TII->getName(getOpcode()-ISD::BUILTIN_OP_END); - std::string Name - = "<>"; - return Name.c_str(); + TargetLowering &TLI = G->getTargetLoweringInfo(); + const char *Name = + TLI.getTargetNodeName(getOpcode()); + if (Name) return Name; + } + + return "<>"; } case ISD::PCMARKER: return "PCMarker"; -- cgit v1.2.3