diff options
author | Dan Gohman <gohman@apple.com> | 2009-07-16 15:30:09 +0000 |
---|---|---|
committer | Dan Gohman <gohman@apple.com> | 2009-07-16 15:30:09 +0000 |
commit | ac95cc79ac0b899d566cc29c0f646f39c2fa35c0 (patch) | |
tree | a56cfb3fae390064970714d26d13dca84545c1fc /tools/opt/PrintSCC.cpp | |
parent | ad60f660c6fd1999a3e21823128d37aca62e9285 (diff) | |
download | llvm-ac95cc79ac0b899d566cc29c0f646f39c2fa35c0.tar.gz llvm-ac95cc79ac0b899d566cc29c0f646f39c2fa35c0.tar.bz2 llvm-ac95cc79ac0b899d566cc29c0f646f39c2fa35c0.tar.xz |
Convert more tools code from cerr and cout to errs() and outs().
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@76070 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'tools/opt/PrintSCC.cpp')
-rw-r--r-- | tools/opt/PrintSCC.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/tools/opt/PrintSCC.cpp b/tools/opt/PrintSCC.cpp index be652644a6..2d678ed0be 100644 --- a/tools/opt/PrintSCC.cpp +++ b/tools/opt/PrintSCC.cpp @@ -29,8 +29,8 @@ #include "llvm/Module.h" #include "llvm/Analysis/CallGraph.h" #include "llvm/Support/CFG.h" +#include "llvm/Support/raw_ostream.h" #include "llvm/ADT/SCCIterator.h" -#include <iostream> using namespace llvm; namespace { @@ -73,18 +73,18 @@ namespace { bool CFGSCC::runOnFunction(Function &F) { unsigned sccNum = 0; - std::cout << "SCCs for Function " << F.getName() << " in PostOrder:"; + outs() << "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; - std::cout << "\nSCC #" << ++sccNum << " : "; + outs() << "\nSCC #" << ++sccNum << " : "; for (std::vector<BasicBlock*>::const_iterator I = nextSCC.begin(), E = nextSCC.end(); I != E; ++I) - std::cout << (*I)->getName() << ", "; + outs() << (*I)->getName() << ", "; if (nextSCC.size() == 1 && SCCI.hasLoop()) - std::cout << " (Has self-loop)."; + outs() << " (Has self-loop)."; } - std::cout << "\n"; + outs() << "\n"; return true; } @@ -94,19 +94,19 @@ bool CFGSCC::runOnFunction(Function &F) { bool CallGraphSCC::runOnModule(Module &M) { CallGraphNode* rootNode = getAnalysis<CallGraph>().getRoot(); unsigned sccNum = 0; - std::cout << "SCCs for the program in PostOrder:"; + outs() << "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; - std::cout << "\nSCC #" << ++sccNum << " : "; + outs() << "\nSCC #" << ++sccNum << " : "; 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")) << ", "; + outs() << ((*I)->getFunction() ? (*I)->getFunction()->getName() + : std::string("Indirect CallGraph node")) << ", "; if (nextSCC.size() == 1 && SCCI.hasLoop()) - std::cout << " (Has self-loop)."; + outs() << " (Has self-loop)."; } - std::cout << "\n"; + outs() << "\n"; return true; } |