cleanup: scc_iterator consumers should use isAtEnd
[oota-llvm.git] / tools / opt / PrintSCC.cpp
index 9322cbceec3241463fc72214178803b01e12ff77..00282140730f1322a3c05ed485cbd2e471c53a01 100644 (file)
@@ -74,8 +74,7 @@ Z("print-callgraph-sccs", "Print SCCs of the Call Graph");
 bool CFGSCC::runOnFunction(Function &F) {
   unsigned sccNum = 0;
   errs() << "SCCs for Function " << F.getName() << " in PostOrder:";
-  for (scc_iterator<Function*> SCCI = scc_begin(&F),
-         E = scc_end(&F); SCCI != E; ++SCCI) {
+  for (scc_iterator<Function*> SCCI = scc_begin(&F); !SCCI.isAtEnd(); ++SCCI) {
     std::vector<BasicBlock*> &nextSCC = *SCCI;
     errs() << "\nSCC #" << ++sccNum << " : ";
     for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
@@ -95,8 +94,8 @@ bool CallGraphSCC::runOnModule(Module &M) {
   CallGraph &CG = getAnalysis<CallGraphWrapperPass>().getCallGraph();
   unsigned sccNum = 0;
   errs() << "SCCs for the program in PostOrder:";
-  for (scc_iterator<CallGraph*> SCCI = scc_begin(&CG),
-         E = scc_end(&CG); SCCI != E; ++SCCI) {
+  for (scc_iterator<CallGraph*> SCCI = scc_begin(&CG); !SCCI.isAtEnd();
+       ++SCCI) {
     const std::vector<CallGraphNode*> &nextSCC = *SCCI;
     errs() << "\nSCC #" << ++sccNum << " : ";
     for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),