aboutsummaryrefslogtreecommitdiff
path: root/llvm/tools/opt/PrintSCC.cpp
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
committerDimitry Andric <dim@FreeBSD.org>2020-07-26 19:36:28 +0000
commitcfca06d7963fa0909f90483b42a6d7d194d01e08 (patch)
tree209fb2a2d68f8f277793fc8df46c753d31bc853b /llvm/tools/opt/PrintSCC.cpp
parent706b4fc47bbc608932d3b491ae19a3b9cde9497b (diff)
Notes
Diffstat (limited to 'llvm/tools/opt/PrintSCC.cpp')
-rw-r--r--llvm/tools/opt/PrintSCC.cpp11
1 files changed, 6 insertions, 5 deletions
diff --git a/llvm/tools/opt/PrintSCC.cpp b/llvm/tools/opt/PrintSCC.cpp
index 419886d6cc60..1ca52745ff40 100644
--- a/llvm/tools/opt/PrintSCC.cpp
+++ b/llvm/tools/opt/PrintSCC.cpp
@@ -76,10 +76,11 @@ bool CFGSCC::runOnFunction(Function &F) {
for (scc_iterator<Function*> SCCI = scc_begin(&F); !SCCI.isAtEnd(); ++SCCI) {
const std::vector<BasicBlock *> &nextSCC = *SCCI;
errs() << "\nSCC #" << ++sccNum << " : ";
- for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
- E = nextSCC.end(); I != E; ++I)
- errs() << (*I)->getName() << ", ";
- if (nextSCC.size() == 1 && SCCI.hasLoop())
+ for (BasicBlock *BB : nextSCC) {
+ BB->printAsOperand(errs(), false);
+ errs() << ", ";
+ }
+ if (nextSCC.size() == 1 && SCCI.hasCycle())
errs() << " (Has self-loop).";
}
errs() << "\n";
@@ -101,7 +102,7 @@ bool CallGraphSCC::runOnModule(Module &M) {
E = nextSCC.end(); I != E; ++I)
errs() << ((*I)->getFunction() ? (*I)->getFunction()->getName()
: "external node") << ", ";
- if (nextSCC.size() == 1 && SCCI.hasLoop())
+ if (nextSCC.size() == 1 && SCCI.hasCycle())
errs() << " (Has self-loop).";
}
errs() << "\n";