llvm.org GIT mirror llvm / 52fdaed
Make the SCC printing passes use errs() instead of outs(), as the other printing passes do, and update the documentation accordingly. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@111601 91177308-0d34-0410-b5e6-96231b3b80d8 Dan Gohman 9 years ago
2 changed file(s) with 13 addition(s) and 13 deletion(s). Raw diff Collapse all Expand all
648648
649649

650650 This pass, only available in opt, prints the call graph to
651 standard output in a human-readable form.
651 standard error in a human-readable form.
652652

653653
654654
659659
660660

661661 This pass, only available in opt, prints the SCCs of the call
662 graph to standard output in a human-readable form.
662 graph to standard error in a human-readable form.
663663

664664
665665
670670
671671

672672 This pass, only available in opt, prints the SCCs of each
673 function CFG to standard output in a human-readable form.
673 function CFG to standard error in a human-readable form.
674674

675675
676676
7272
7373 bool CFGSCC::runOnFunction(Function &F) {
7474 unsigned sccNum = 0;
75 outs() << "SCCs for Function " << F.getName() << " in PostOrder:";
75 errs() << "SCCs for Function " << F.getName() << " in PostOrder:";
7676 for (scc_iterator SCCI = scc_begin(&F),
7777 E = scc_end(&F); SCCI != E; ++SCCI) {
7878 std::vector &nextSCC = *SCCI;
79 outs() << "\nSCC #" << ++sccNum << " : ";
79 errs() << "\nSCC #" << ++sccNum << " : ";
8080 for (std::vector::const_iterator I = nextSCC.begin(),
8181 E = nextSCC.end(); I != E; ++I)
82 outs() << (*I)->getName() << ", ";
82 errs() << (*I)->getName() << ", ";
8383 if (nextSCC.size() == 1 && SCCI.hasLoop())
84 outs() << " (Has self-loop).";
84 errs() << " (Has self-loop).";
8585 }
86 outs() << "\n";
86 errs() << "\n";
8787
8888 return true;
8989 }
9393 bool CallGraphSCC::runOnModule(Module &M) {
9494 CallGraphNode* rootNode = getAnalysis().getRoot();
9595 unsigned sccNum = 0;
96 outs() << "SCCs for the program in PostOrder:";
96 errs() << "SCCs for the program in PostOrder:";
9797 for (scc_iterator SCCI = scc_begin(rootNode),
9898 E = scc_end(rootNode); SCCI != E; ++SCCI) {
9999 const std::vector &nextSCC = *SCCI;
100 outs() << "\nSCC #" << ++sccNum << " : ";
100 errs() << "\nSCC #" << ++sccNum << " : ";
101101 for (std::vector::const_iterator I = nextSCC.begin(),
102102 E = nextSCC.end(); I != E; ++I)
103 outs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr()
103 errs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr()
104104 : std::string("external node")) << ", ";
105105 if (nextSCC.size() == 1 && SCCI.hasLoop())
106 outs() << " (Has self-loop).";
106 errs() << " (Has self-loop).";
107107 }
108 outs() << "\n";
108 errs() << "\n";
109109
110110 return true;
111111 }