aboutsummaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2003-08-31 19:51:38 +0000
committerChris Lattner <sabre@nondot.org>2003-08-31 19:51:38 +0000
commit9f2a06e76d173ea20891457a22dc0f55c361844f (patch)
tree4ac729f6c441b18768e5b43a147022b29e200140 /tools
parent94d1092c6a385ff077fb28773d9ba3ad15cb9a8d (diff)
downloadexternal_llvm-9f2a06e76d173ea20891457a22dc0f55c361844f.zip
external_llvm-9f2a06e76d173ea20891457a22dc0f55c361844f.tar.gz
external_llvm-9f2a06e76d173ea20891457a22dc0f55c361844f.tar.bz2
The SCC::HasLoop method is now in the main iterator
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8269 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools')
-rw-r--r--tools/analyze/PrintSCC.cpp14
-rw-r--r--tools/opt/PrintSCC.cpp14
2 files changed, 14 insertions, 14 deletions
diff --git a/tools/analyze/PrintSCC.cpp b/tools/analyze/PrintSCC.cpp
index 7affce6..80f6995 100644
--- a/tools/analyze/PrintSCC.cpp
+++ b/tools/analyze/PrintSCC.cpp
@@ -57,14 +57,14 @@ namespace {
bool CFGSCC::runOnFunction(Function &F) {
unsigned sccNum = 0;
std::cout << "SCCs for Function " << F.getName() << " in PostOrder:";
- for (TarjanSCC_iterator<Function*> I = tarj_begin(&F),
- E = tarj_end(&F); I != E; ++I) {
- SCC<Function*> &nextSCC = *I;
+ for (TarjanSCC_iterator<Function*> SCCI = tarj_begin(&F),
+ E = tarj_end(&F); SCCI != E; ++SCCI) {
+ SCC<Function*> &nextSCC = *SCCI;
std::cout << "\nSCC #" << ++sccNum << " : ";
- for (SCC<Function*>::const_iterator I = nextSCC.begin(),
+ for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
E = nextSCC.end(); I != E; ++I)
std::cout << (*I)->getName() << ", ";
- if (nextSCC.size() == 1 && nextSCC.HasLoop())
+ if (nextSCC.size() == 1 && SCCI.hasLoop())
std::cout << " (Has self-loop).";
}
std::cout << "\n";
@@ -82,11 +82,11 @@ bool CallGraphSCC::run(Module &M) {
E = tarj_end(rootNode); SCCI != E; ++SCCI) {
const SCC<CallGraphNode*> &nextSCC = *SCCI;
std::cout << "\nSCC #" << ++sccNum << " : ";
- for (SCC<CallGraphNode*>::const_iterator I = nextSCC.begin(),
+ for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),
E = nextSCC.end(); I != E; ++I)
std::cout << ((*I)->getFunction() ? (*I)->getFunction()->getName()
: std::string("Indirect CallGraph node")) << ", ";
- if (nextSCC.size() == 1 && nextSCC.HasLoop())
+ if (nextSCC.size() == 1 && SCCI.hasLoop())
std::cout << " (Has self-loop).";
}
std::cout << "\n";
diff --git a/tools/opt/PrintSCC.cpp b/tools/opt/PrintSCC.cpp
index 7affce6..80f6995 100644
--- a/tools/opt/PrintSCC.cpp
+++ b/tools/opt/PrintSCC.cpp
@@ -57,14 +57,14 @@ namespace {
bool CFGSCC::runOnFunction(Function &F) {
unsigned sccNum = 0;
std::cout << "SCCs for Function " << F.getName() << " in PostOrder:";
- for (TarjanSCC_iterator<Function*> I = tarj_begin(&F),
- E = tarj_end(&F); I != E; ++I) {
- SCC<Function*> &nextSCC = *I;
+ for (TarjanSCC_iterator<Function*> SCCI = tarj_begin(&F),
+ E = tarj_end(&F); SCCI != E; ++SCCI) {
+ SCC<Function*> &nextSCC = *SCCI;
std::cout << "\nSCC #" << ++sccNum << " : ";
- for (SCC<Function*>::const_iterator I = nextSCC.begin(),
+ for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
E = nextSCC.end(); I != E; ++I)
std::cout << (*I)->getName() << ", ";
- if (nextSCC.size() == 1 && nextSCC.HasLoop())
+ if (nextSCC.size() == 1 && SCCI.hasLoop())
std::cout << " (Has self-loop).";
}
std::cout << "\n";
@@ -82,11 +82,11 @@ bool CallGraphSCC::run(Module &M) {
E = tarj_end(rootNode); SCCI != E; ++SCCI) {
const SCC<CallGraphNode*> &nextSCC = *SCCI;
std::cout << "\nSCC #" << ++sccNum << " : ";
- for (SCC<CallGraphNode*>::const_iterator I = nextSCC.begin(),
+ for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),
E = nextSCC.end(); I != E; ++I)
std::cout << ((*I)->getFunction() ? (*I)->getFunction()->getName()
: std::string("Indirect CallGraph node")) << ", ";
- if (nextSCC.size() == 1 && nextSCC.HasLoop())
+ if (nextSCC.size() == 1 && SCCI.hasLoop())
std::cout << " (Has self-loop).";
}
std::cout << "\n";