diff options
author | Evan Cheng <evan.cheng@apple.com> | 2005-12-20 06:22:03 +0000 |
---|---|---|
committer | Evan Cheng <evan.cheng@apple.com> | 2005-12-20 06:22:03 +0000 |
commit | 7226158d7e3986e55b58214a749aa4eabb3fb6d5 (patch) | |
tree | 03b4e5b249ef9db846734225c9048faf8d371697 /lib/CodeGen/SelectionDAG/SelectionDAG.cpp | |
parent | dae87b65365a8a3dae8e41c2e836572388ec84ba (diff) |
Added a hook to print out names of target specific DAG nodes.
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24877 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/CodeGen/SelectionDAG/SelectionDAG.cpp')
-rw-r--r-- | lib/CodeGen/SelectionDAG/SelectionDAG.cpp | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp index ad8cca742a..3438863c90 100644 --- a/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ b/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1835,15 +1835,18 @@ const char *SDNode::getOperationName(const SelectionDAG *G) const { if (getOpcode() < ISD::BUILTIN_OP_END) return "<<Unknown DAG Node>>"; 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 - = "<<Unknown Target Node:" - + itostr((int)getOpcode()-ISD::BUILTIN_OP_END) + ">>"; - return Name.c_str(); + TargetLowering &TLI = G->getTargetLoweringInfo(); + const char *Name = + TLI.getTargetNodeName(getOpcode()); + if (Name) return Name; + } + + return "<<Unknown Target Node>>"; } case ISD::PCMARKER: return "PCMarker"; |