From de202b3cda00f17ba2c047be7270b51f9585a413 Mon Sep 17 00:00:00 2001 From: Chris Lattner Date: Wed, 9 Nov 2005 23:47:37 +0000 Subject: Switch the allnodes list from a vector of pointers to an ilist of nodes.This eliminates the vector, allows constant time removal of a node froma graph, and makes iteration over the all nodes list stable when adding nodes to the graph. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@24263 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/CodeGen/SelectionDAG/DAGCombiner.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'lib/CodeGen/SelectionDAG/DAGCombiner.cpp') diff --git a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp index 2eca87c730..ca137431a0 100644 --- a/lib/CodeGen/SelectionDAG/DAGCombiner.cpp +++ b/lib/CodeGen/SelectionDAG/DAGCombiner.cpp @@ -514,7 +514,9 @@ void DAGCombiner::Run(bool RunningAfterLegalize) { AfterLegalize = RunningAfterLegalize; // Add all the dag nodes to the worklist. - WorkList.insert(WorkList.end(), DAG.allnodes_begin(), DAG.allnodes_end()); + for (SelectionDAG::allnodes_iterator I = DAG.allnodes_begin(), + E = DAG.allnodes_end(); I != E; ++I) + WorkList.push_back(I); // Create a dummy node (which is not added to allnodes), that adds a reference // to the root node, preventing it from being deleted, and tracking any -- cgit v1.2.3-18-g5258