Revert "raw_ostream: << operator for callables with raw_stream argument"
[oota-llvm.git] / lib / CodeGen / SelectionDAG / SelectionDAGDumper.cpp
index 8c3a0f2d81eca794ac76980300266d125d3660dd..d362f98d6464e6297bc1e57e80afa779161c66a9 100644 (file)
@@ -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); }