[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/DataStructure.cpp GraphChecker.cpp Printer.cpp
Chris Lattner
lattner at cs.uiuc.edu
Wed Mar 16 14:42:41 PST 2005
Changes in directory llvm/lib/Analysis/DataStructure:
DataStructure.cpp updated: 1.206 -> 1.207
GraphChecker.cpp updated: 1.16 -> 1.17
Printer.cpp updated: 1.77 -> 1.78
---
Log message:
remove use of compat_iterator.
---
Diffs of the changes: (+15 -14)
DataStructure.cpp | 20 ++++++++++----------
GraphChecker.cpp | 7 ++++---
Printer.cpp | 2 +-
3 files changed, 15 insertions(+), 14 deletions(-)
Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.206 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.207
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.206 Tue Mar 15 15:36:50 2005
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Wed Mar 16 16:42:19 2005
@@ -1091,7 +1091,7 @@
// 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 @@
| ((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 @@
// 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::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: llvm/lib/Analysis/DataStructure/GraphChecker.cpp
diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.16 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.17
--- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.16 Wed Sep 1 17:55:35 2004
+++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Wed Mar 16 16:42:19 2005
@@ -116,10 +116,11 @@
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: llvm/lib/Analysis/DataStructure/Printer.cpp
diff -u llvm/lib/Analysis/DataStructure/Printer.cpp:1.77 llvm/lib/Analysis/DataStructure/Printer.cpp:1.78
--- llvm/lib/Analysis/DataStructure/Printer.cpp:1.77 Tue Mar 15 10:55:04 2005
+++ llvm/lib/Analysis/DataStructure/Printer.cpp Wed Mar 16 16:42:19 2005
@@ -292,7 +292,7 @@
for (DSGraph::node_iterator NI = Gr.node_begin(), E = Gr.node_end();
NI != E; ++NI)
- if ((*NI)->isNodeCompletelyFolded())
+ if (NI->isNodeCompletelyFolded())
++NumFoldedNodes;
}
More information about the llvm-commits
mailing list