From ac95cc79ac0b899d566cc29c0f646f39c2fa35c0 Mon Sep 17 00:00:00 2001 From: Dan Gohman Date: Thu, 16 Jul 2009 15:30:09 +0000 Subject: 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 --- tools/opt/PrintSCC.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) (limited to 'tools/opt/PrintSCC.cpp') 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 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 SCCI = scc_begin(&F), E = scc_end(&F); SCCI != E; ++SCCI) { std::vector &nextSCC = *SCCI; - std::cout << "\nSCC #" << ++sccNum << " : "; + outs() << "\nSCC #" << ++sccNum << " : "; for (std::vector::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().getRoot(); unsigned sccNum = 0; - std::cout << "SCCs for the program in PostOrder:"; + outs() << "SCCs for the program in PostOrder:"; for (scc_iterator SCCI = scc_begin(rootNode), E = scc_end(rootNode); SCCI != E; ++SCCI) { const std::vector &nextSCC = *SCCI; - std::cout << "\nSCC #" << ++sccNum << " : "; + outs() << "\nSCC #" << ++sccNum << " : "; for (std::vector::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; } -- cgit v1.2.3