Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAG.cpp @@ -1063,8 +1063,8 @@ /// verification and other common operations when a new node is allocated. void SelectionDAG::InsertNode(SDNode *N) { AllNodes.push_back(N); -#ifndef NDEBUG N->PersistentId = NextPersistentId++; +#ifndef NDEBUG VerifySDNode(N); #endif for (DAGUpdateListener *DUL = UpdateListeners; DUL; DUL = DUL->Next) @@ -1268,9 +1268,7 @@ AllNodes.remove(AllNodes.begin()); while (!AllNodes.empty()) DeallocateNode(&AllNodes.front()); -#ifndef NDEBUG NextPersistentId = 0; -#endif } SDNode *SelectionDAG::FindNodeOrInsertPos(const FoldingSetNodeID &ID, Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGDumper.cpp @@ -503,13 +503,8 @@ } static Printable PrintNodeId(const SDNode &Node) { - return Printable([&Node](raw_ostream &OS) { -#ifndef NDEBUG - OS << 't' << Node.PersistentId; -#else - OS << (const void*)&Node; -#endif - }); + return Printable( + [&Node](raw_ostream &OS) { OS << 't' << Node.PersistentId; }); } // Print the MMO with more information from the SelectionDAG. Index: llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp =================================================================== --- llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp +++ llvm/lib/CodeGen/SelectionDAG/SelectionDAGPrinter.cpp @@ -77,11 +77,7 @@ const SelectionDAG *Graph) { std::string R; raw_string_ostream OS(R); -#ifndef NDEBUG OS << 't' << Node->PersistentId; -#else - OS << static_cast(Node); -#endif return R; }