[llvm-commits] CVS: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp CompleteBottomUp.cpp DataStructure.cpp EquivClassGraphs.cpp Local.cpp TopDownClosure.cpp

Bill Wendling isanbard at gmail.com
Thu Nov 16 23:34:14 PST 2006



Changes in directory llvm/lib/Analysis/DataStructure:

BottomUpClosure.cpp updated: 1.123 -> 1.124
CompleteBottomUp.cpp updated: 1.37 -> 1.38
DataStructure.cpp updated: 1.249 -> 1.250
EquivClassGraphs.cpp updated: 1.49 -> 1.50
Local.cpp updated: 1.159 -> 1.160
TopDownClosure.cpp updated: 1.93 -> 1.94
---
Log message:

Replace DEBUG(std::cerr with DOUT. Removed some iostream #includes.


---
Diffs of the changes:  (+95 -106)

 BottomUpClosure.cpp  |   60 ++++++++++++++++++++++++---------------------------
 CompleteBottomUp.cpp |   23 +++++++++----------
 DataStructure.cpp    |   42 +++++++++++++++++------------------
 EquivClassGraphs.cpp |   37 ++++++++++++++-----------------
 Local.cpp            |   14 +++++------
 TopDownClosure.cpp   |   25 ++++++++-------------
 6 files changed, 95 insertions(+), 106 deletions(-)


Index: llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.123 llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.124
--- llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp:1.123	Mon Oct 23 14:55:24 2006
+++ llvm/lib/Analysis/DataStructure/BottomUpClosure.cpp	Fri Nov 17 01:33:59 2006
@@ -138,8 +138,8 @@
         DSNode *N = new DSNode(F->getType()->getElementType(), GI);   // Create the node
         N->addGlobal(F);
         NHF.setTo(N,0);
-        DEBUG(std::cerr << "Adding " << F->getName() << " to a call node in "
-             << D.getCaller().getName() << "\n");
+        DOUT << "Adding " << F->getName() << " to a call node in "
+             << D.getCaller().getName() << "\n";
       }
       DL.getCalleeNode()->mergeWith(NHF, 0);
     }
@@ -171,8 +171,8 @@
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal() && !DSInfo.count(I)) {
       if (MainFunc)
-        DEBUG(std::cerr << "*** BU: Function unreachable from main: "
-              << I->getName() << "\n");
+        DOUT << "*** BU: Function unreachable from main: "
+             << I->getName() << "\n";
       calculateGraphs(I, Stack, NextID, ValMap);     // Calculate all graphs.
     }
 
@@ -203,7 +203,7 @@
   BuildGlobalECs(*GlobalsGraph, ECGlobals);
   if (!ECGlobals.empty()) {
     NamedRegionTimer X("Bottom-UP EC Cleanup");
-    DEBUG(std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n");
+    DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n";
     for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(),
            E = DSInfo.end(); I != E; ++I)
       EliminateUsesOfECGlobals(*I->second, ECGlobals);
@@ -235,12 +235,12 @@
           ee = MainGraph.afc_end(); ii != ee; ++ii) {
       std::vector<Function*> Funcs;
       GetAllCalleesN(*ii, Funcs);
-      DEBUG(std::cerr << "Lost site\n");
+      DOUT << "Lost site\n";
       DEBUG(ii->getCallSite().getInstruction()->dump());
       for (std::vector<Function*>::iterator iif = Funcs.begin(), eef = Funcs.end();
            iif != eef; ++iif) {
         AddGlobalToNode(this, *ii, *iif);
-        DEBUG(std::cerr << "Adding\n");
+        DOUT << "Adding\n";
         ActualCallees.insert(std::make_pair(ii->getCallSite().getInstruction(), *iif));
       }
     }
@@ -383,15 +383,15 @@
 
   // If this is a new SCC, process it now.
   if (Stack.back() == F) {           // Special case the single "SCC" case here.
-    DEBUG(std::cerr << "Visiting single node SCC #: " << MyID << " fn: "
-                    << F->getName() << "\n");
+    DOUT << "Visiting single node SCC #: " << MyID << " fn: "
+         << F->getName() << "\n";
     Stack.pop_back();
     DSGraph &G = getDSGraph(*F);
-    DEBUG(std::cerr << "  [BU] Calculating graph for: " << F->getName()<< "\n");
+    DOUT << "  [BU] Calculating graph for: " << F->getName()<< "\n";
     calculateGraph(G);
-    DEBUG(std::cerr << "  [BU] Done inlining: " << F->getName() << " ["
-                    << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
-                    << "]\n");
+    DOUT << "  [BU] Done inlining: " << F->getName() << " ["
+         << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
+         << "]\n";
 
     if (MaxSCC < 1) MaxSCC = 1;
 
@@ -399,7 +399,7 @@
     // callees.
     GetAllAuxCallees(Graph, CalleeFunctions);
     if (!CalleeFunctions.empty()) {
-      DEBUG(std::cerr << "Recalculating " << F->getName() << " due to new knowledge\n");
+      DOUT << "Recalculating " << F->getName() << " due to new knowledge\n";
       ValMap.erase(F);
       return calculateGraphs(F, Stack, NextID, ValMap);
     } else {
@@ -440,8 +440,8 @@
     }
     Stack.pop_back();
 
-    DEBUG(std::cerr << "Calculating graph for SCC #: " << MyID << " of size: "
-                    << SCCSize << "\n");
+    DOUT << "Calculating graph for SCC #: " << MyID << " of size: "
+         << SCCSize << "\n";
 
     // Compute the Max SCC Size.
     if (MaxSCC < SCCSize)
@@ -453,10 +453,9 @@
     // Now that we have one big happy family, resolve all of the call sites in
     // the graph...
     calculateGraph(SCCGraph);
-    DEBUG(std::cerr << "  [BU] Done inlining SCC  [" << SCCGraph.getGraphSize()
-                    << "+" << SCCGraph.getAuxFunctionCalls().size() << "]\n");
-
-    DEBUG(std::cerr << "DONE with SCC #: " << MyID << "\n");
+    DOUT << "  [BU] Done inlining SCC  [" << SCCGraph.getGraphSize()
+         << "+" << SCCGraph.getAuxFunctionCalls().size() << "]\n"
+         << "DONE with SCC #: " << MyID << "\n";
 
     // We never have to revisit "SCC" processed functions...
     return MyID;
@@ -579,12 +578,11 @@
 
         // Get the data structure graph for the called function.
         GI = &getDSGraph(*Callee);  // Graph to inline
-        DEBUG(std::cerr << "    Inlining graph for " << Callee->getName());
-
-        DEBUG(std::cerr << "[" << GI->getGraphSize() << "+"
-              << GI->getAuxFunctionCalls().size() << "] into '"
-              << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() <<"+"
-              << Graph.getAuxFunctionCalls().size() << "]\n");
+        DOUT << "    Inlining graph for " << Callee->getName()
+             << "[" << GI->getGraphSize() << "+"
+             << GI->getAuxFunctionCalls().size() << "] into '"
+             << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() <<"+"
+             << Graph.getAuxFunctionCalls().size() << "]\n";
         Graph.mergeInGraph(CS, *Callee, *GI,
                            DSGraph::StripAllocaBit|DSGraph::DontCloneCallNodes);
         ++NumBUInlines;
@@ -653,11 +651,11 @@
         GI = IndCallGraph.first;
 
         // Merge the unified graph into this graph now.
-        DEBUG(std::cerr << "    Inlining multi callee graph "
-              << "[" << GI->getGraphSize() << "+"
-              << GI->getAuxFunctionCalls().size() << "] into '"
-              << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() <<"+"
-              << Graph.getAuxFunctionCalls().size() << "]\n");
+        DOUT << "    Inlining multi callee graph "
+             << "[" << GI->getGraphSize() << "+"
+             << GI->getAuxFunctionCalls().size() << "] into '"
+             << Graph.getFunctionNames() << "' [" << Graph.getGraphSize() <<"+"
+             << Graph.getAuxFunctionCalls().size() << "]\n";
 
         Graph.mergeInGraph(CS, IndCallGraph.second, *GI,
                            DSGraph::StripAllocaBit |


Index: llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp
diff -u llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.37 llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.38
--- llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp:1.37	Fri Oct 13 12:38:22 2006
+++ llvm/lib/Analysis/DataStructure/CompleteBottomUp.cpp	Fri Nov 17 01:33:59 2006
@@ -21,7 +21,6 @@
 #include "llvm/ADT/SCCIterator.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/STLExtras.h"
-#include <iostream>
 using namespace llvm;
 
 namespace {
@@ -52,14 +51,14 @@
     if (!MainFunc->isExternal())
       calculateSCCGraphs(getOrCreateGraph(*MainFunc), Stack, NextID, ValMap);
   } else {
-    DEBUG(std::cerr << "CBU-DSA: No 'main' function found!\n");
+    DOUT << "CBU-DSA: No 'main' function found!\n";
   }
 
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isExternal() && !DSInfo.count(I)) {
       if (MainFunc) {
-        DEBUG(std::cerr << "*** CBU: Function unreachable from main: "
-              << I->getName() << "\n");
+        DOUT << "*** CBU: Function unreachable from main: "
+             << I->getName() << "\n";
       }
       calculateSCCGraphs(getOrCreateGraph(*I), Stack, NextID, ValMap);
     }
@@ -218,14 +217,14 @@
         G.mergeInGraph(CS, *CalleeFunc, GI,
                        DSGraph::StripAllocaBit | DSGraph::DontCloneCallNodes |
                        DSGraph::DontCloneAuxCallNodes);
-        DEBUG(std::cerr << "    Inlining graph [" << i << "/"
-              << G.getFunctionCalls().size()-1
-              << ":" << TNum << "/" << Num-1 << "] for "
-              << CalleeFunc->getName() << "["
-              << GI.getGraphSize() << "+" << GI.getAuxFunctionCalls().size()
-              << "] into '" /*<< G.getFunctionNames()*/ << "' ["
-              << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
-              << "]\n");
+        DOUT << "    Inlining graph [" << i << "/"
+             << G.getFunctionCalls().size()-1
+             << ":" << TNum << "/" << Num-1 << "] for "
+             << CalleeFunc->getName() << "["
+             << GI.getGraphSize() << "+" << GI.getAuxFunctionCalls().size()
+             << "] into '" /*<< G.getFunctionNames()*/ << "' ["
+             << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
+             << "]\n";
       }
     }
   }


Index: llvm/lib/Analysis/DataStructure/DataStructure.cpp
diff -u llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.249 llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.250
--- llvm/lib/Analysis/DataStructure/DataStructure.cpp:1.249	Tue Nov  7 14:36:02 2006
+++ llvm/lib/Analysis/DataStructure/DataStructure.cpp	Fri Nov 17 01:33:59 2006
@@ -431,8 +431,7 @@
 ///
 bool DSNode::mergeTypeInfo(const Type *NewTy, unsigned Offset,
                            bool FoldIfIncompatible) {
-  DEBUG(std::cerr << "merging " << *NewTy << " at " << Offset 
-                  << " with " << *Ty << "\n");
+  DOUT << "merging " << *NewTy << " at " << Offset << " with " << *Ty << "\n";
   const TargetData &TD = getTargetData();
   // Check to make sure the Size member is up-to-date.  Size can be one of the
   // following:
@@ -521,9 +520,10 @@
       //handle some common cases:
       // Ty:    struct { t1, t2, t3, t4, ..., tn}
       // NewTy: struct { offset, stuff...}
-      // try merge with NewTy: struct {t1, t2, stuff...} if offset lands exactly on a field in Ty
+      // try merge with NewTy: struct {t1, t2, stuff...} if offset lands exactly
+      // on a field in Ty
       if (isa<StructType>(NewTy) && isa<StructType>(Ty)) {
-        DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n");
+        DOUT << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n";
         const StructType *STy = cast<StructType>(Ty);
         const StructLayout &SL = *TD.getStructLayout(STy);
         unsigned i = SL.getElementContainingOffset(Offset);
@@ -539,15 +539,16 @@
         nt.insert(nt.end(), STy->element_begin(), STy->element_end());
         //and merge
         STy = StructType::get(nt);
-        DEBUG(std::cerr << "Trying with: " << *STy << "\n");
+        DOUT << "Trying with: " << *STy << "\n";
         return mergeTypeInfo(STy, 0);
       }
 
       //Ty: struct { t1, t2, t3 ... tn}
       //NewTy T offset x
-      //try merge with NewTy: struct : {t1, t2, T} if offset lands on a field in Ty
+      //try merge with NewTy: struct : {t1, t2, T} if offset lands on a field
+      //in Ty
       if (isa<StructType>(Ty)) {
-        DEBUG(std::cerr << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n");
+        DOUT << "Ty: " << *Ty << "\nNewTy: " << *NewTy << "@" << Offset << "\n";
         const StructType *STy = cast<StructType>(Ty);
         const StructLayout &SL = *TD.getStructLayout(STy);
         unsigned i = SL.getElementContainingOffset(Offset);
@@ -562,12 +563,13 @@
         nt.push_back(NewTy);
         //and merge
         STy = StructType::get(nt);
-        DEBUG(std::cerr << "Trying with: " << *STy << "\n");
+        DOUT << "Trying with: " << *STy << "\n";
         return mergeTypeInfo(STy, 0);
       }
 
-      std::cerr << "UNIMP: Trying to merge a growth type into "
-                << "offset != 0: Collapsing!\n";
+      assert(0 &&
+             "UNIMP: Trying to merge a growth type into "
+             "offset != 0: Collapsing!");
       abort();
       if (FoldIfIncompatible) foldNodeCompletely();
       return true;
@@ -717,10 +719,11 @@
   Module *M = 0;
   if (getParentGraph()->retnodes_begin() != getParentGraph()->retnodes_end())
     M = getParentGraph()->retnodes_begin()->first->getParent();
-  DEBUG(std::cerr << "MergeTypeInfo Folding OrigTy: ";
-        WriteTypeSymbolic(std::cerr, Ty, M) << "\n due to:";
+
+  DOUT << "MergeTypeInfo Folding OrigTy: ";
+  DEBUG(WriteTypeSymbolic(std::cerr, Ty, M) << "\n due to:";
         WriteTypeSymbolic(std::cerr, NewTy, M) << " @ " << Offset << "!\n"
-                  << "SubType: ";
+                                               << "SubType: ";
         WriteTypeSymbolic(std::cerr, SubType, M) << "\n\n");
 
   if (FoldIfIncompatible) foldNodeCompletely();
@@ -926,8 +929,7 @@
   if (N == this) {
     // We cannot merge two pieces of the same node together, collapse the node
     // completely.
-    DEBUG(std::cerr << "Attempting to merge two chunks of"
-                    << " the same node together!\n");
+    DOUT << "Attempting to merge two chunks of the same node together!\n";
     foldNodeCompletely();
     return;
   }
@@ -1808,9 +1810,7 @@
       // eliminate it.
       if (Callee->getNumReferrers() == 1 && Callee->isComplete() &&
           Callee->getGlobalsList().empty()) {  // No useful info?
-#ifndef NDEBUG
-        std::cerr << "WARNING: Useless call site found.\n";
-#endif
+        DOUT << "WARNING: Useless call site found.\n";
         Calls.erase(OldIt);
         ++NumDeleted;
         continue;
@@ -1930,8 +1930,8 @@
   // Track the number of call nodes merged away...
   NumCallNodesMerged += NumDeleted;
 
-  DEBUG(if (NumDeleted)
-          std::cerr << "Merged " << NumDeleted << " call nodes.\n";);
+  if (NumDeleted)
+    DOUT << "Merged " << NumDeleted << " call nodes.\n";
 }
 
 
@@ -2263,7 +2263,7 @@
 #if 0
     if (CS.getNumPtrArgs() && CS.getCalleeNode() == CS.getPtrArg(0).getNode() &&
         CS.getCalleeNode() && CS.getCalleeNode()->getGlobals().empty())
-      std::cerr << "WARNING: WEIRD CALL SITE FOUND!\n";
+      DOUT << "WARNING: WEIRD CALL SITE FOUND!\n";
 #endif
   }
   AssertNodeInGraph(CS.getRetVal().getNode());


Index: llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp
diff -u llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.49 llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.50
--- llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp:1.49	Thu Nov  2 14:25:49 2006
+++ llvm/lib/Analysis/DataStructure/EquivClassGraphs.cpp	Fri Nov 17 01:33:59 2006
@@ -213,7 +213,7 @@
   // Now that all of the equivalences have been built, merge the graphs for
   // each equivalence class.
   //
-  DEBUG(std::cerr << "\nIndirect Function Equivalence Sets:\n");
+  DOUT << "\nIndirect Function Equivalence Sets:\n";
   for (EquivalenceClasses<Function*>::iterator EQSI = FuncECs.begin(), E =
          FuncECs.end(); EQSI != E; ++EQSI) {
     if (!EQSI->isLeader()) continue;
@@ -229,10 +229,10 @@
     Function* LF = *SI;
 
 #ifndef NDEBUG
-    DEBUG(std::cerr <<"  Equivalence set for leader " << LF->getName() <<" = ");
+    DOUT <<"  Equivalence set for leader " << LF->getName() <<" = ";
     for (SN = SI; SN != FuncECs.member_end(); ++SN)
-      DEBUG(std::cerr << " " << (*SN)->getName() << "," );
-    DEBUG(std::cerr << "\n");
+      DOUT << " " << (*SN)->getName() << "," ;
+    DOUT << "\n";
 #endif
 
     // This equiv class has multiple functions: merge their graphs.  First,
@@ -286,7 +286,7 @@
       DEBUG(MergedG.AssertGraphOK());
     }
   }
-  DEBUG(std::cerr << "\n");
+  DOUT << "\n";
 }
 
 
@@ -322,8 +322,7 @@
   if (It != ValMap.end() && It->first == &FG)
     return It->second;
 
-  DEBUG(std::cerr << "    ProcessSCC for function " << FG.getFunctionNames()
-                  << "\n");
+  DOUT << "    ProcessSCC for function " << FG.getFunctionNames() << "\n";
 
   unsigned Min = NextID++, MyID = Min;
   ValMap[&FG] = Min;
@@ -386,8 +385,7 @@
 /// processGraph - Process the CBU graphs for the program in bottom-up order on
 /// the SCC of the __ACTUAL__ call graph.  This builds final folded CBU graphs.
 void EquivClassGraphs::processGraph(DSGraph &G) {
-  DEBUG(std::cerr << "    ProcessGraph for function "
-                  << G.getFunctionNames() << "\n");
+  DOUT << "    ProcessGraph for function " << G.getFunctionNames() << "\n";
 
   hash_set<Instruction*> calls;
 
@@ -434,15 +432,15 @@
                        DSGraph::StripAllocaBit |
                        DSGraph::DontCloneCallNodes |
                        DSGraph::DontCloneAuxCallNodes);
-        DEBUG(std::cerr << "    Inlining graph [" << i << "/"
-              << G.getFunctionCalls().size()-1
-              << ":" << TNum << "/" << Num-1 << "] for "
-              << CalleeFunc->getName() << "["
-              << CalleeGraph->getGraphSize() << "+"
-              << CalleeGraph->getAuxFunctionCalls().size()
-              << "] into '" /*<< G.getFunctionNames()*/ << "' ["
-              << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
-              << "]\n");
+        DOUT << "    Inlining graph [" << i << "/"
+             << G.getFunctionCalls().size()-1
+             << ":" << TNum << "/" << Num-1 << "] for "
+             << CalleeFunc->getName() << "["
+             << CalleeGraph->getGraphSize() << "+"
+             << CalleeGraph->getAuxFunctionCalls().size()
+             << "] into '" /*<< G.getFunctionNames()*/ << "' ["
+             << G.getGraphSize() << "+" << G.getAuxFunctionCalls().size()
+             << "]\n";
       }
     }
 
@@ -476,6 +474,5 @@
          E = MainSM.global_end(); I != E; ++I)
     RC.getClonedNH(MainSM[*I]);
 
-  DEBUG(std::cerr << "  -- DONE ProcessGraph for function "
-                  << G.getFunctionNames() << "\n");
+  DOUT << "  -- DONE ProcessGraph for function " << G.getFunctionNames() <<"\n";
 }


Index: llvm/lib/Analysis/DataStructure/Local.cpp
diff -u llvm/lib/Analysis/DataStructure/Local.cpp:1.159 llvm/lib/Analysis/DataStructure/Local.cpp:1.160
--- llvm/lib/Analysis/DataStructure/Local.cpp:1.159	Tue Nov  7 14:39:05 2006
+++ llvm/lib/Analysis/DataStructure/Local.cpp	Fri Nov 17 01:33:59 2006
@@ -188,7 +188,7 @@
   : GlobalsGraph(GG), ScalarMap(ECs), TD(td) {
   PrintAuxCalls = false;
 
-  DEBUG(std::cerr << "  [Loc] Calculating graph for: " << F.getName() << "\n");
+  DOUT << "  [Loc] Calculating graph for: " << F.getName() << "\n";
 
   // Use the graph builder to construct the local version of the graph
   GraphBuilder B(F, *this, ReturnNodes[&F], FunctionCalls);
@@ -573,7 +573,7 @@
       N->setModifiedMarker();
     return true;
   default:
-    DEBUG(std::cerr << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n");
+    DOUT << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n";
     return false;
   }
 }
@@ -1047,8 +1047,8 @@
               break;
             }
         if (Warn) {
-          DEBUG(std::cerr << "WARNING: Call to unknown external function '"
-                << F->getName() << "' will cause pessimistic results!\n");
+          DOUT << "WARNING: Call to unknown external function '"
+               << F->getName() << "' will cause pessimistic results!\n";
         }
       }
 
@@ -1158,7 +1158,7 @@
         DSNodeHandle NewNH(NHN, NH.getOffset()+(unsigned)SL->MemberOffsets[i]);
         MergeConstantInitIntoNode(NewNH, cast<Constant>(CS->getOperand(i)));
       } else if (SL->MemberOffsets[i] == SL->StructSize) {
-        DEBUG(std::cerr << "Zero size element at end of struct\n");
+        DOUT << "Zero size element at end of struct\n";
         NHN->foldNodeCompletely();
       } else {
         assert(0 && "type was smaller than offsets of of struct layout indicate");
@@ -1280,7 +1280,7 @@
   // together the globals into equivalence classes.
   std::set<GlobalValue*> ECGlobals;
   BuildGlobalECs(*GlobalsGraph, ECGlobals);
-  DEBUG(std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n");
+  DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n";
   ECGlobals.clear();
 
   // Calculate all of the graphs...
@@ -1298,7 +1298,7 @@
   // program.
   BuildGlobalECs(*GlobalsGraph, ECGlobals);
   if (!ECGlobals.empty()) {
-    DEBUG(std::cerr << "Eliminating " << ECGlobals.size() << " EC Globals!\n");
+    DOUT << "Eliminating " << ECGlobals.size() << " EC Globals!\n";
     for (hash_map<Function*, DSGraph*>::iterator I = DSInfo.begin(),
            E = DSInfo.end(); I != E; ++I)
       EliminateUsesOfECGlobals(*I->second, ECGlobals);


Index: llvm/lib/Analysis/DataStructure/TopDownClosure.cpp
diff -u llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.93 llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.94
--- llvm/lib/Analysis/DataStructure/TopDownClosure.cpp:1.93	Tue Nov  7 14:35:11 2006
+++ llvm/lib/Analysis/DataStructure/TopDownClosure.cpp	Fri Nov 17 01:33:59 2006
@@ -21,7 +21,6 @@
 #include "llvm/Support/Debug.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/ADT/Statistic.h"
-#include <iostream>
 using namespace llvm;
 
 #if 0
@@ -241,8 +240,7 @@
       RC.getClonedNH(GG.getNodeForValue(*GI));
   }
 
-  DEBUG(std::cerr << "[TD] Inlining callers into '" << DSG.getFunctionNames()
-        << "'\n");
+  DOUT << "[TD] Inlining callers into '" << DSG.getFunctionNames() << "'\n";
 
   // Iteratively inline caller graphs into this graph.
   while (!EdgesFromCaller.empty()) {
@@ -258,16 +256,13 @@
     do {
       const DSCallSite &CS = *EdgesFromCaller.back().CS;
       Function &CF = *EdgesFromCaller.back().CalledFunction;
-      DEBUG(std::cerr << "   [TD] Inlining graph into Fn '"
-            << CF.getName() << "' from ");
+      DOUT << "   [TD] Inlining graph into Fn '" << CF.getName() << "' from ";
       if (CallerGraph.getReturnNodes().empty())
-        DEBUG(std::cerr << "SYNTHESIZED INDIRECT GRAPH");
+        DOUT << "SYNTHESIZED INDIRECT GRAPH";
       else
-        DEBUG (std::cerr << "Fn '"
-               << CS.getCallSite().getInstruction()->
-               getParent()->getParent()->getName() << "'");
-      DEBUG(std::cerr << ": " << CF.getFunctionType()->getNumParams()
-            << " args\n");
+        DOUT << "Fn '" << CS.getCallSite().getInstruction()->
+                            getParent()->getParent()->getName() << "'";
+      DOUT << ": " << CF.getFunctionType()->getNumParams() << " args\n";
 
       // Get the formal argument and return nodes for the called function and
       // merge them with the cloned subgraph.
@@ -371,8 +366,8 @@
 
     // If we already have this graph, recycle it.
     if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) {
-      DEBUG(std::cerr << "  [TD] *** Reuse of indcall graph for " << Callees.size()
-            << " callees!\n");
+      DOUT << "  [TD] *** Reuse of indcall graph for " << Callees.size()
+           << " callees!\n";
       IndCallGraph = IndCallRecI->second;
     } else {
       // Otherwise, create a new DSGraph to represent this.
@@ -464,8 +459,8 @@
     return;
   }
 
-  std::cerr << *From;
-  std::cerr << *To;
+  DOUT << *From;
+  DOUT << *To;
   assert(0 && "Do not know how to copy this yet!");
   abort();
 }






More information about the llvm-commits mailing list