summaryrefslogtreecommitdiffstats
path: root/llvm/lib/CodeGen/SelectionDAG
diff options
context:
space:
mode:
Diffstat (limited to 'llvm/lib/CodeGen/SelectionDAG')
-rw-r--r--llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp17
1 files changed, 14 insertions, 3 deletions
diff --git a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
index 8c3a0f2d81e..d362f98d646 100644
--- a/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
+++ b/llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp
@@ -369,14 +369,25 @@ const char *SDNode::getIndexedModeName(ISD::MemIndexedMode AM) {
}
}
-static Printable PrintNodeId(const SDNode &Node) {
- return [&Node](raw_ostream &OS) {
+namespace {
+class PrintNodeId {
+ const SDNode &Node;
+public:
+ explicit PrintNodeId(const SDNode &Node)
+ : Node(Node) {}
+ void print(raw_ostream &OS) const {
#ifndef NDEBUG
OS << 't' << Node.PersistentId;
#else
OS << (const void*)&Node;
#endif
- };
+ }
+};
+
+static inline raw_ostream &operator<<(raw_ostream &OS, const PrintNodeId &P) {
+ P.print(OS);
+ return OS;
+}
}
void SDNode::dump() const { dump(nullptr); }
OpenPOWER on IntegriCloud