remove use of compat_iterator.
authorChris Lattner <sabre@nondot.org>
Wed, 16 Mar 2005 22:42:19 +0000 (22:42 +0000)
committerChris Lattner <sabre@nondot.org>
Wed, 16 Mar 2005 22:42:19 +0000 (22:42 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@20643 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/DataStructure.cpp
lib/Analysis/DataStructure/GraphChecker.cpp
lib/Analysis/DataStructure/Printer.cpp

index 69b3da43dfc56a74f73746ed7a64a850f0080a3a..06ae9b046c60cdcb3b95777826f823c95274c2f6 100644 (file)
@@ -1091,7 +1091,7 @@ DSGraph::~DSGraph() {
 
   // Drop all intra-node references, so that assertions don't fail...
   for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI)
-    (*NI)->dropAllReferences();
+    NI->dropAllReferences();
 
   // Free all of the nodes.
   Nodes.clear();
@@ -1180,12 +1180,12 @@ void DSGraph::cloneInto(const DSGraph &G, DSScalarMap &OldValMap,
     | ((CloneFlags & StripIncompleteBit)? DSNode::Incomplete : 0);
   BitsToClear |= DSNode::DEAD;  // Clear dead flag...
 
-  for (node_iterator I = G.node_begin(), E = G.node_end(); I != E; ++I) {
-    assert(!(*I)->isForwarding() &&
+  for (node_const_iterator I = G.node_begin(), E = G.node_end(); I != E; ++I) {
+    assert(!I->isForwarding() &&
            "Forward nodes shouldn't be in node list!");
-    DSNode *New = new DSNode(**I, this);
+    DSNode *New = new DSNode(*I, this);
     New->maskNodeTypes(~BitsToClear);
-    OldNodeMap[*I] = New;
+    OldNodeMap[I] = New;
   }
   
 #ifndef NDEBUG
@@ -1668,9 +1668,9 @@ void DSGraph::removeTriviallyDeadNodes() {
   // forwarded nodes to be delete-able.
   { TIME_REGION(X, "removeTriviallyDeadNodes:node_iterate");
   for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI) {
-    DSNode *N = *NI;
-    for (unsigned l = 0, e = N->getNumLinks(); l != e; ++l)
-      N->getLink(l*N->getPointerSize()).getNode();
+    DSNode &N = *NI;
+    for (unsigned l = 0, e = N.getNumLinks(); l != e; ++l)
+      N.getLink(l*N.getPointerSize()).getNode();
   }
   }
 
@@ -2016,8 +2016,8 @@ void DSGraph::AssertAuxCallNodesInGraph() const {
 }
 
 void DSGraph::AssertGraphOK() const {
-  for (node_iterator NI = node_begin(), E = node_end(); NI != E; ++NI)
-    (*NI)->assertOK();
+  for (node_const_iterator NI = node_begin(), E = node_end(); NI != E; ++NI)
+    NI->assertOK();
 
   for (ScalarMapTy::const_iterator I = ScalarMap.begin(),
          E = ScalarMap.end(); I != E; ++I) {
index 8cef6b37bf1fe20c396c3d593a81247357866af2..ba3315b1c0196270fcb3549363990350fd7ed730 100644 (file)
@@ -116,10 +116,11 @@ bool DSGC::runOnFunction(Function &F) {
 void DSGC::verify(const DSGraph &G) {
   // Loop over all of the nodes, checking to see if any are collapsed...
   if (AbortIfAnyCollapsed) {
-    for (DSGraph::node_iterator I = G.node_begin(), E = G.node_end(); I!=E; ++I)
-      if ((*I)->isNodeCompletelyFolded()) {
+    for (DSGraph::node_const_iterator I = G.node_begin(), E = G.node_end();
+         I != E; ++I)
+      if (I->isNodeCompletelyFolded()) {
         std::cerr << "Node is collapsed: ";
-        (*I)->print(std::cerr, &G);
+        I->print(std::cerr, &G);
         abort();
       }
   }
index 05fba215d51d1073658eda9c5a179f843bfda245..cf1a53ebe1ca2c86cddff90b252b361284dddbf7 100644 (file)
@@ -292,7 +292,7 @@ static void printCollection(const Collection &C, std::ostream &O,
 
       for (DSGraph::node_iterator NI = Gr.node_begin(), E = Gr.node_end();
            NI != E; ++NI)
-        if ((*NI)->isNodeCompletelyFolded())
+        if (NI->isNodeCompletelyFolded())
           ++NumFoldedNodes;
     }