Changes in directory llvm/lib/Analysis/DataStructure:
BottomUpClosure.cpp updated: 1.124 -> 1.125 CallTargets.cpp updated: 1.4 -> 1.5 DataStructure.cpp updated: 1.251 -> 1.252 DataStructureStats.cpp updated: 1.21 -> 1.22 EquivClassGraphs.cpp updated: 1.50 -> 1.51 GraphChecker.cpp updated: 1.21 -> 1.22 --- Log message: Convert to using llvm streams instead of iostreams. --- Diffs of the changes: (+35 -35) BottomUpClosure.cpp | 22 +++++++++++----------- CallTargets.cpp | 6 +++--- DataStructure.cpp | 3 ++- DataStructureStats.cpp | 7 ++++--- EquivClassGraphs.cpp | 7 +++---- GraphChecker.cpp | 25 ++++++++++++------------- 6 files changed, 35 insertions(+), 35 deletions(-) Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.124 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.125 --- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.124 Fri Nov 17 01:33:59 2006 +++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp Tue Nov 28 17:33:06 2006 @@ -13,6 +13,7 @@ // applications like alias analysis. // //===----------------------------------------------------------------------===// + #define DEBUG_TYPE "bu_dsa" #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" @@ -22,7 +23,6 @@ #include "llvm/Support/CommandLine.h" #include "llvm/Support/Debug.h" #include "llvm/Support/Timer.h" -#include <iostream> using namespace llvm; namespace { @@ -501,7 +501,7 @@ DSG->getNodeForValue(F->arg_begin()).mergeWith(N); } else { - std::cerr << "Unrecognized external function: " << F->getName() << "\n"; + llvm_cerr << "Unrecognized external function: " << F->getName() << "\n"; abort(); } @@ -588,21 +588,21 @@ ++NumBUInlines; } else { if (!Printed) - std::cerr << "In Fns: " << Graph.getFunctionNames() << "\n"; - std::cerr << " calls " << CalledFuncs.size() + llvm_cerr << "In Fns: " << Graph.getFunctionNames() << "\n"; + llvm_cerr << " calls " << CalledFuncs.size() << " fns from site: " << CS.getCallSite().getInstruction() << " " << *CS.getCallSite().getInstruction(); - std::cerr << " Fns ="; + llvm_cerr << " Fns ="; unsigned NumPrinted = 0; for (std::vector<Function*>::iterator I = CalledFuncs.begin(), E = CalledFuncs.end(); I != E; ++I) { - if (NumPrinted++ < 8) std::cerr << " " << (*I)->getName(); + if (NumPrinted++ < 8) llvm_cerr << " " << (*I)->getName(); // Add the call edges to the call graph. ActualCallees.insert(std::make_pair(TheCall, *I)); } - std::cerr << "\n"; + llvm_cerr << "\n"; // See if we already computed a graph for this set of callees. std::sort(CalledFuncs.begin(), CalledFuncs.end()); @@ -645,7 +645,7 @@ // Clean up the final graph! GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals); } else { - std::cerr << "***\n*** RECYCLED GRAPH ***\n***\n"; + llvm_cerr << "***\n*** RECYCLED GRAPH ***\n***\n"; } GI = IndCallGraph.first; @@ -685,7 +685,7 @@ E = MainSM.global_end(); I != E; ++I) RC.getClonedNH(MainSM[*I]); - //Graph.writeGraphToFile(std::cerr, "bu_" + F.getName()); + //Graph.writeGraphToFile(llvm_cerr, "bu_" + F.getName()); } static const Function *getFnForValue(const Value *V) { @@ -746,8 +746,8 @@ return; } - std::cerr << *From; - std::cerr << *To; + llvm_cerr << *From; + llvm_cerr << *To; assert(0 && "Do not know how to copy this yet!"); abort(); } Index: llvm/lib/Analysis/DataStructure/CallTargets.cpp diff -u llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.4 llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.5 --- llvm/lib/Analysis/DataStructure/CallTargets.cpp:1.4 Sun Aug 27 17:31:12 2006 +++ llvm/lib/Analysis/DataStructure/CallTargets.cpp Tue Nov 28 17:33:06 2006 @@ -23,9 +23,9 @@ #include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Analysis/DataStructure/CallTargets.h" #include "llvm/ADT/Statistic.h" -#include <iostream> +#include "llvm/Support/Streams.h" +#include <ostream> #include "llvm/Constants.h" - using namespace llvm; namespace { @@ -58,7 +58,7 @@ } if (N->isComplete() && !IndMap[cs].size()) { ++CompleteEmpty; - std::cerr << "Call site empty: '" + llvm_cerr << "Call site empty: '" << cs.getInstruction()->getName() << "' In '" << cs.getInstruction()->getParent()->getParent()->getName() Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.251 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.252 --- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.251 Sun Nov 26 19:05:09 2006 +++ llvm/lib/Analysis/DataStructure/DataStructure.cpp Tue Nov 28 17:33:06 2006 @@ -25,6 +25,7 @@ #include "llvm/ADT/STLExtras.h" #include "llvm/ADT/SCCIterator.h" #include "llvm/ADT/Statistic.h" +#include "llvm/Support/Streams.h" #include "llvm/Support/Timer.h" #include <iostream> #include <algorithm> @@ -1262,7 +1263,7 @@ } // dump - Allow inspection of graph in a debugger. -void DSGraph::dump() const { print(std::cerr); } +void DSGraph::dump() const { print(llvm_cerr); } /// remapLinks - Change all of the Links in the current node according to the Index: llvm/lib/Analysis/DataStructure/DataStructureStats.cpp diff -u llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.21 llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.22 --- llvm/lib/Analysis/DataStructure/DataStructureStats.cpp:1.21 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/DataStructure/DataStructureStats.cpp Tue Nov 28 17:33:06 2006 @@ -17,8 +17,9 @@ #include "llvm/Instructions.h" #include "llvm/Pass.h" #include "llvm/Support/InstVisitor.h" +#include "llvm/Support/Streams.h" #include "llvm/ADT/Statistic.h" -#include <iostream> +#include <ostream> using namespace llvm; namespace { @@ -91,7 +92,7 @@ totalNumCallees += Callees.size(); ++numIndirectCalls; } else - std::cerr << "WARNING: No callee in Function '" << F.getName() + llvm_cerr << "WARNING: No callee in Function '" << F.getName() << "' at call: \n" << *I->getCallSite().getInstruction(); } @@ -100,7 +101,7 @@ NumIndirectCalls += numIndirectCalls; if (numIndirectCalls) - std::cout << " In function " << F.getName() << ": " + llvm_cout << " In function " << F.getName() << ": " << (totalNumCallees / (double) numIndirectCalls) << " average callees per indirect call\n"; } Index: llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp diff -u llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.50 llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.51 --- llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.50 Fri Nov 17 01:33:59 2006 +++ llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp Tue Nov 28 17:33:06 2006 @@ -26,7 +26,6 @@ #include "llvm/ADT/Statistic.h" #include "llvm/ADT/EquivalenceClasses.h" #include "llvm/ADT/STLExtras.h" -#include <iostream> using namespace llvm; namespace { @@ -91,7 +90,7 @@ if (MainFunc && !MainFunc->isExternal()) { processSCC(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap); } else { - std::cerr << "Fold Graphs: No 'main' function found!\n"; + llvm_cerr << "Fold Graphs: No 'main' function found!\n"; } for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I) @@ -173,8 +172,8 @@ FuncECs.insert(I->second); // -- Make sure function has equiv class FirstFunc = I->second; // -- First callee at this site } else { // Else indirect call - // DEBUG(std::cerr << "CALLEE: " << I->second->getName() - // << " from : " << I->first); + // DOUT << "CALLEE: " << I->second->getName() + // << " from : " << I->first; if (I->first != LastInst) { // This is the first callee from this call site. LastInst = I->first; Index: llvm/lib/Analysis/DataStructure/GraphChecker.cpp diff -u llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.21 llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.22 --- llvm/lib/Analysis/DataStructure/GraphChecker.cpp:1.21 Sun Aug 27 17:30:17 2006 +++ llvm/lib/Analysis/DataStructure/GraphChecker.cpp Tue Nov 28 17:33:06 2006 @@ -26,10 +26,9 @@ #include "llvm/Analysis/DataStructure/DataStructure.h" #include "llvm/Analysis/DataStructure/DSGraph.h" #include "llvm/Support/CommandLine.h" +#include "llvm/Support/Streams.h" #include "llvm/Value.h" -#include <iostream> #include <set> - using namespace llvm; namespace { @@ -85,7 +84,7 @@ DSGC::DSGC() { if (!AbortIfAnyCollapsed && AbortIfCollapsed.empty() && CheckFlags.empty() && AbortIfMerged.empty()) { - std::cerr << "The -datastructure-gc is useless if you don't specify any" + llvm_cerr << "The -datastructure-gc is useless if you don't specify any" " -dsgc-* options. See the -help-hidden output for a list.\n"; abort(); } @@ -124,8 +123,8 @@ for (DSGraph::node_const_iterator I = G.node_begin(), E = G.node_end(); I != E; ++I) if (I->isNodeCompletelyFolded()) { - std::cerr << "Node is collapsed: "; - I->print(std::cerr, &G); + llvm_cerr << "Node is collapsed: "; + I->print(llvm_cerr, &G); abort(); } } @@ -143,7 +142,7 @@ E = CheckFlags.end(); I != E; ++I) { std::string::size_type ColonPos = I->rfind(':'); if (ColonPos == std::string::npos) { - std::cerr << "Error: '" << *I + llvm_cerr << "Error: '" << *I << "' is an invalid value for the --dsgc-check-flags option!\n"; abort(); } @@ -159,7 +158,7 @@ case 'M': Flags |= DSNode::Modified; break; case 'R': Flags |= DSNode::Read; break; case 'A': Flags |= DSNode::Array; break; - default: std::cerr << "Invalid DSNode flag!\n"; abort(); + default: llvm_cerr << "Invalid DSNode flag!\n"; abort(); } CheckFlagsM[std::string(I->begin(), I->begin()+ColonPos)] = Flags; } @@ -177,25 +176,25 @@ // Verify it is not collapsed if it is not supposed to be... if (N->isNodeCompletelyFolded() && AbortIfCollapsedS.count(Name)) { - std::cerr << "Node for value '%" << Name << "' is collapsed: "; - N->print(std::cerr, &G); + llvm_cerr << "Node for value '%" << Name << "' is collapsed: "; + N->print(llvm_cerr, &G); abort(); } if (CheckFlagsM.count(Name) && CheckFlagsM[Name] != N->getNodeFlags()) { - std::cerr << "Node flags are not as expected for node: " << Name + llvm_cerr << "Node flags are not as expected for node: " << Name << " (" << CheckFlagsM[Name] << ":" <<N->getNodeFlags() << ")\n"; - N->print(std::cerr, &G); + N->print(llvm_cerr, &G); abort(); } // Verify that it is not merged if it is not supposed to be... if (AbortIfMergedS.count(Name)) { if (AbortIfMergedNodes.count(N)) { - std::cerr << "Nodes for values '%" << Name << "' and '%" + llvm_cerr << "Nodes for values '%" << Name << "' and '%" << AbortIfMergedNodes[N] << "' is merged: "; - N->print(std::cerr, &G); + N->print(llvm_cerr, &G); abort(); } AbortIfMergedNodes[N] = Name; _______________________________________________ llvm-commits mailing list llvm-commits@cs.uiuc.edu http://lists.cs.uiuc.edu/mailman/listinfo/llvm-commits