From 5ff49d94103b10c94404dc789d2af5df96e10909 Mon Sep 17 00:00:00 2001 From: Evan Cheng Date: Thu, 12 Oct 2006 20:35:19 +0000 Subject: [PATCH] Use RemoveDeadNode to kill dead node. llvm-svn: 30917 --- utils/TableGen/DAGISelEmitter.cpp | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/utils/TableGen/DAGISelEmitter.cpp b/utils/TableGen/DAGISelEmitter.cpp index 5221fe025bf..fdc67a157bc 100644 --- a/utils/TableGen/DAGISelEmitter.cpp +++ b/utils/TableGen/DAGISelEmitter.cpp @@ -3741,16 +3741,6 @@ OS << " unsigned NumKilled = ISelKilled.size();\n"; OS << " RemoveKilled();\n"; OS << "}\n\n"; - OS << "void DeleteNode(SDNode *N) {\n"; - OS << " CurDAG->DeleteNode(N);\n"; - OS << " for (SDNode::op_iterator I = N->op_begin(), E = N->op_end(); " - << "I != E; ++I) {\n"; - OS << " SDNode *Operand = I->Val;\n"; - OS << " if (Operand->use_empty())\n"; - OS << " DeleteNode(Operand);\n"; - OS << " }\n"; - OS << "}\n"; - OS << "// SelectRoot - Top level entry to DAG isel.\n"; OS << "SDOperand SelectRoot(SDOperand Root) {\n"; OS << " SelectRootInit();\n"; @@ -3774,8 +3764,10 @@ OS << " unsigned NumKilled = ISelKilled.size();\n"; OS << " if (ResNode != Node) {\n"; OS << " if (ResNode)\n"; OS << " ReplaceUses(Node, ResNode);\n"; - OS << " if (Node->use_empty()) // Don't delete EntryToken, etc.\n"; - OS << " DeleteNode(Node);\n"; + OS << " if (Node->use_empty()) { // Don't delete EntryToken, etc.\n"; + OS << " CurDAG->RemoveDeadNode(Node, ISelKilled);\n"; + OS << " RemoveKilled();\n"; + OS << " }\n"; OS << " }\n"; OS << " }\n"; OS << " }\n";