[llvm-commits] [llvm] r111601 - in /llvm/trunk: docs/Passes.html tools/opt/PrintSCC.cpp
Dan Gohman
gohman at apple.com
Thu Aug 19 18:03:44 PDT 2010
Author: djg
Date: Thu Aug 19 20:03:44 2010
New Revision: 111601
URL: http://llvm.org/viewvc/llvm-project?rev=111601&view=rev
Log:
Make the SCC printing passes use errs() instead of outs(), as the
other printing passes do, and update the documentation accordingly.
Modified:
llvm/trunk/docs/Passes.html
llvm/trunk/tools/opt/PrintSCC.cpp
Modified: llvm/trunk/docs/Passes.html
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/docs/Passes.html?rev=111601&r1=111600&r2=111601&view=diff
==============================================================================
--- llvm/trunk/docs/Passes.html (original)
+++ llvm/trunk/docs/Passes.html Thu Aug 19 20:03:44 2010
@@ -649,7 +649,7 @@
<div class="doc_text">
<p>
This pass, only available in <code>opt</code>, prints the call graph to
- standard output in a human-readable form.
+ standard error in a human-readable form.
</p>
</div>
@@ -660,7 +660,7 @@
<div class="doc_text">
<p>
This pass, only available in <code>opt</code>, prints the SCCs of the call
- graph to standard output in a human-readable form.
+ graph to standard error in a human-readable form.
</p>
</div>
@@ -671,7 +671,7 @@
<div class="doc_text">
<p>
This pass, only available in <code>opt</code>, prints the SCCs of each
- function CFG to standard output in a human-readable form.
+ function CFG to standard error in a human-readable form.
</p>
</div>
Modified: llvm/trunk/tools/opt/PrintSCC.cpp
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/tools/opt/PrintSCC.cpp?rev=111601&r1=111600&r2=111601&view=diff
==============================================================================
--- llvm/trunk/tools/opt/PrintSCC.cpp (original)
+++ llvm/trunk/tools/opt/PrintSCC.cpp Thu Aug 19 20:03:44 2010
@@ -73,18 +73,18 @@
bool CFGSCC::runOnFunction(Function &F) {
unsigned sccNum = 0;
- outs() << "SCCs for Function " << F.getName() << " in PostOrder:";
+ errs() << "SCCs for Function " << F.getName() << " in PostOrder:";
for (scc_iterator<Function*> SCCI = scc_begin(&F),
E = scc_end(&F); SCCI != E; ++SCCI) {
std::vector<BasicBlock*> &nextSCC = *SCCI;
- outs() << "\nSCC #" << ++sccNum << " : ";
+ errs() << "\nSCC #" << ++sccNum << " : ";
for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(),
E = nextSCC.end(); I != E; ++I)
- outs() << (*I)->getName() << ", ";
+ errs() << (*I)->getName() << ", ";
if (nextSCC.size() == 1 && SCCI.hasLoop())
- outs() << " (Has self-loop).";
+ errs() << " (Has self-loop).";
}
- outs() << "\n";
+ errs() << "\n";
return true;
}
@@ -94,19 +94,19 @@
bool CallGraphSCC::runOnModule(Module &M) {
CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot();
unsigned sccNum = 0;
- outs() << "SCCs for the program in PostOrder:";
+ errs() << "SCCs for the program in PostOrder:";
for (scc_iterator<CallGraphNode*> SCCI = scc_begin(rootNode),
E = scc_end(rootNode); SCCI != E; ++SCCI) {
const std::vector<CallGraphNode*> &nextSCC = *SCCI;
- outs() << "\nSCC #" << ++sccNum << " : ";
+ errs() << "\nSCC #" << ++sccNum << " : ";
for (std::vector<CallGraphNode*>::const_iterator I = nextSCC.begin(),
E = nextSCC.end(); I != E; ++I)
- outs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr()
+ errs() << ((*I)->getFunction() ? (*I)->getFunction()->getNameStr()
: std::string("external node")) << ", ";
if (nextSCC.size() == 1 && SCCI.hasLoop())
- outs() << " (Has self-loop).";
+ errs() << " (Has self-loop).";
}
- outs() << "\n";
+ errs() << "\n";
return true;
}
More information about the llvm-commits
mailing list