[llvm-commits] CVS: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
Evan Cheng
evan.cheng at apple.com
Mon Dec 19 22:22:16 PST 2005
Changes in directory llvm/lib/CodeGen/SelectionDAG:
SelectionDAG.cpp updated: 1.227 -> 1.228
---
Log message:
Added a hook to print out names of target specific DAG nodes.
---
Diffs of the changes: (+8 -5)
SelectionDAG.cpp | 13 ++++++++-----
1 files changed, 8 insertions(+), 5 deletions(-)
Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp
diff -u llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.227 llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.228
--- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp:1.227 Mon Dec 19 17:11:49 2005
+++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp Tue Dec 20 00:22:03 2005
@@ -1835,15 +1835,18 @@
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";
More information about the llvm-commits
mailing list