[llvm-commits] [poolalloc] r78088 - in /poolalloc/trunk/lib/DSA: BottomUpClosure.cpp CallTargets.cpp DataStructure.cpp DataStructureStats.cpp Local.cpp Printer.cpp StdLibPass.cpp TopDownClosure.cpp

Andrew Lenharth alenhar2 at cs.uiuc.edu
Tue Aug 4 12:09:04 PDT 2009


Author: alenhar2
Date: Tue Aug  4 14:08:49 2009
New Revision: 78088

URL: http://llvm.org/viewvc/llvm-project?rev=78088&view=rev
Log:
make build against head

Modified:
    poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
    poolalloc/trunk/lib/DSA/CallTargets.cpp
    poolalloc/trunk/lib/DSA/DataStructure.cpp
    poolalloc/trunk/lib/DSA/DataStructureStats.cpp
    poolalloc/trunk/lib/DSA/Local.cpp
    poolalloc/trunk/lib/DSA/Printer.cpp
    poolalloc/trunk/lib/DSA/StdLibPass.cpp
    poolalloc/trunk/lib/DSA/TopDownClosure.cpp

Modified: poolalloc/trunk/lib/DSA/BottomUpClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/BottomUpClosure.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/BottomUpClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/BottomUpClosure.cpp Tue Aug  4 14:08:49 2009
@@ -20,6 +20,8 @@
 #include "llvm/Module.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/FormattedStream.h"
+
 using namespace llvm;
 
 namespace {
@@ -52,15 +54,15 @@
     calculateGraphs(MainFunc, Stack, NextID, ValMap);
     CloneAuxIntoGlobal(getDSGraph(*MainFunc));
   } else {
-    DOUT << debugname << ": No 'main' function found!\n";
+    DEBUG(ferrs() << debugname << ": No 'main' function found!\n");
   }
 
   // Calculate the graphs for any functions that are unreachable from main...
   for (Module::iterator I = M.begin(), E = M.end(); I != E; ++I)
     if (!I->isDeclaration() && !hasDSGraph(*I)) {
       if (MainFunc)
-        DOUT << debugname << ": Function unreachable from main: "
-             << I->getName() << "\n";
+        DEBUG(ferrs() << debugname << ": Function unreachable from main: "
+	      << I->getName() << "\n");
       calculateGraphs(I, Stack, NextID, ValMap);     // Calculate all graphs.
       CloneAuxIntoGlobal(getDSGraph(*I));
     }
@@ -261,14 +263,14 @@
 
   // If this is a new SCC, process it now.
   if (Stack.back() == F) {           // Special case the single "SCC" case here.
-    DOUT << "Visiting single node SCC #: " << MyID << " fn: "
-         << F->getName() << "\n";
+    DEBUG(ferrs() << "Visiting single node SCC #: " << MyID << " fn: "
+	  << F->getName() << "\n");
     Stack.pop_back();
-    DOUT << "  [BU] Calculating graph for: " << F->getName()<< "\n";
+    DEBUG(ferrs() << "  [BU] Calculating graph for: " << F->getName()<< "\n");
     calculateGraph(Graph);
-    DOUT << "  [BU] Done inlining: " << F->getName() << " ["
-         << Graph->getGraphSize() << "+" << Graph->getAuxFunctionCalls().size()
-         << "]\n";
+    DEBUG(ferrs() << "  [BU] Done inlining: " << F->getName() << " ["
+	  << Graph->getGraphSize() << "+" << Graph->getAuxFunctionCalls().size()
+	  << "]\n");
 
     if (MaxSCC < 1) MaxSCC = 1;
 
@@ -295,7 +297,7 @@
     ResolvedFuncs.resize(uid - ResolvedFuncs.begin());
 
     if (ResolvedFuncs.size() || NewCalleeFuncs.size()) {
-      DOUT << "Recalculating " << F->getName() << " due to new knowledge\n";
+      DEBUG(ferrs() << "Recalculating " << F->getName() << " due to new knowledge\n");
       ValMap.erase(F);
       return calculateGraphs(F, Stack, NextID, ValMap);
     } else {
@@ -339,8 +341,8 @@
     }
     Stack.pop_back();
 
-    DOUT << "Calculating graph for SCC #: " << MyID << " of size: "
-         << SCCSize << "\n";
+    DEBUG(ferrs() << "Calculating graph for SCC #: " << MyID << " of size: "
+	  << SCCSize << "\n");
 
     // Compute the Max SCC Size.
     if (MaxSCC < SCCSize)
@@ -352,9 +354,9 @@
     // Now that we have one big happy family, resolve all of the call sites in
     // the graph...
     calculateGraph(SCCGraph);
-    DOUT << "  [BU] Done inlining SCC  [" << SCCGraph->getGraphSize()
-         << "+" << SCCGraph->getAuxFunctionCalls().size() << "]\n"
-         << "DONE with SCC #: " << MyID << "\n";
+    DEBUG(ferrs() << "  [BU] Done inlining SCC  [" << SCCGraph->getGraphSize()
+	  << "+" << SCCGraph->getAuxFunctionCalls().size() << "]\n"
+	  << "DONE with SCC #: " << MyID << "\n");
 
     // We never have to revisit "SCC" processed functions...
     //propagate incomplete call nodes
@@ -471,28 +473,30 @@
       // Get the data structure graph for the called function.
       GI = getDSGraph(*Callee);  // Graph to inline
       DEBUG(GI->AssertGraphOK(); GI->getGlobalsGraph()->AssertGraphOK());
-      DOUT << "    Inlining graph for " << Callee->getName()
-           << "[" << GI->getGraphSize() << "+"
-           << GI->getAuxFunctionCalls().size() << "] into '"
-           << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"
-           << Graph->getAuxFunctionCalls().size() << "]\n";
+      DEBUG(ferrs() << "    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|
                           (isComplete?0:DSGraph::DontCloneAuxCallNodes));
       ++NumInlines;
       DEBUG(Graph->AssertGraphOK(););
     } else if (CalledFuncs.size() > 1) {
-      DEBUG(std::cerr << "In Fns: " << Graph->getFunctionNames() << "\n");
-      DEBUG(std::cerr << "  calls " << CalledFuncs.size()
+      DEBUG(ferrs() << "In Fns: " << Graph->getFunctionNames() << "\n");
+      DEBUG(ferrs() << "  calls " << CalledFuncs.size()
             << " fns from site: " << CS.getCallSite().getInstruction()
             << "  " << *CS.getCallSite().getInstruction());
-      DEBUG(std::cerr << "   Fns =");
+      DEBUG(ferrs() << "   Fns =");
       unsigned NumPrinted = 0;
       
       for (std::vector<const Function*>::iterator I = CalledFuncs.begin(),
              E = CalledFuncs.end(); I != E; ++I)
-        if (NumPrinted++ < 8) DOUT << " " << (*I)->getName();
-      DOUT << "\n";
+        if (NumPrinted++ < 8) {
+	  DEBUG(ferrs() << " " << (*I)->getName());
+	}
+      DEBUG(ferrs() << "\n");
       
       if (!isComplete) {
         for (unsigned x = 0; x < CalledFuncs.size(); )
@@ -543,17 +547,17 @@
           // Clean up the final graph!
           GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
         } else {
-          DOUT << "***\n*** RECYCLED GRAPH ***\n***\n";
+          DEBUG(ferrs() << "***\n*** RECYCLED GRAPH ***\n***\n");
         }
         
         GI = IndCallGraph.first;
         
         // Merge the unified graph into this graph now.
-        DOUT << "    Inlining multi callee graph "
-             << "[" << GI->getGraphSize() << "+"
-             << GI->getAuxFunctionCalls().size() << "] into '"
-             << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"
-             << Graph->getAuxFunctionCalls().size() << "]\n";
+        DEBUG(ferrs() << "    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 |
@@ -618,26 +622,28 @@
       // Get the data structure graph for the called function.
       GI = getDSGraph(*Callee);  // Graph to inline
       if (GI == Graph) continue;
-      DOUT << "    Inlining graph for " << Callee->getName()
-           << "[" << GI->getGraphSize() << "+"
-           << GI->getAuxFunctionCalls().size() << "] into '"
-           << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"
-           << Graph->getAuxFunctionCalls().size() << "]\n";
+      DEBUG(ferrs() << "    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);
       ++NumInlines;
     } else {
-      DEBUG(std::cerr << "In Fns: " << Graph->getFunctionNames() << "\n");
+      DEBUG(ferrs() << "In Fns: " << Graph->getFunctionNames() << "\n");
       DEBUG(std::cerr << "  calls " << CalledFuncs.size()
             << " fns from site: " << CS.getCallSite().getInstruction()
             << "  " << *CS.getCallSite().getInstruction());
-      DEBUG(std::cerr << "   Fns =");
+      DEBUG(ferrs() << "   Fns =");
       unsigned NumPrinted = 0;
       
       for (std::vector<const Function*>::iterator I = CalledFuncs.begin(),
              E = CalledFuncs.end(); I != E; ++I)
-        if (NumPrinted++ < 8) DOUT << " " << (*I)->getName();
-      DOUT << "\n";
+        if (NumPrinted++ < 8) {
+	  DEBUG(ferrs() << " " << (*I)->getName());
+	}
+      DEBUG(ferrs() << "\n");
       
       for (unsigned x = 0; x < CalledFuncs.size(); )
         if (!hasDSGraph(*CalledFuncs[x]))
@@ -690,18 +696,17 @@
         // Clean up the final graph!
         GI->removeDeadNodes(DSGraph::KeepUnreachableGlobals);
       } else {
-        DOUT << "***\n*** RECYCLED GRAPH ***\n***\n";
+        DEBUG(ferrs() << "***\n*** RECYCLED GRAPH ***\n***\n");
       }
       
       GI = IndCallGraph.first;
       
       // Merge the unified graph into this graph now.
-      DEBUG(
-            DOUT << "    Inlining multi callee graph "
+      DEBUG(ferrs() << "    Inlining multi callee graph "
             << "[" << GI->getGraphSize() << "+"
             << GI->getAuxFunctionCalls().size() << "] into '"
             << Graph->getFunctionNames() << "' [" << Graph->getGraphSize() <<"+"
-            << Graph->getAuxFunctionCalls().size() << "]\n"; );
+            << Graph->getAuxFunctionCalls().size() << "]\n" );
       
       Graph->mergeInGraph(CS, IndCallGraph.second, *GI,
                           DSGraph::StripAllocaBit |

Modified: poolalloc/trunk/lib/DSA/CallTargets.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/CallTargets.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/CallTargets.cpp (original)
+++ poolalloc/trunk/lib/DSA/CallTargets.cpp Tue Aug  4 14:08:49 2009
@@ -24,7 +24,7 @@
 #include "dsa/CallTargets.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Support/Debug.h"
-#include "llvm/Support/Streams.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Constants.h"
 #include <ostream>
 using namespace llvm;
@@ -74,11 +74,11 @@
                 } 
                 if (N->isCompleteNode() && !IndMap[cs].size()) {
                   ++CompleteEmpty;
-                  cerr << "Call site empty: '"
-                       << cs.getInstruction()->getName() 
-                       << "' In '"
-                       << cs.getInstruction()->getParent()->getParent()->getName()
-                       << "'\n";
+                  DEBUG(ferrs() << "Call site empty: '"
+			<< cs.getInstruction()->getName() 
+			<< "' In '"
+			<< cs.getInstruction()->getParent()->getParent()->getName()
+			<< "'\n");
                 }
               }
             } else {
@@ -100,13 +100,13 @@
         O << "* ";
         CallSite cs = ii->first;
         cs.getInstruction()->dump();
-        O << cs.getInstruction()->getParent()->getParent()->getName() << " "
-          << cs.getInstruction()->getName() << " ";
+        O << cs.getInstruction()->getParent()->getParent()->getNameStr() << " "
+          << cs.getInstruction()->getNameStr() << " ";
       }
       O << ii->first.getInstruction() << ":";
       for (std::vector<const Function*>::const_iterator i = ii->second.begin(),
              e = ii->second.end(); i != e; ++i) {
-        O << " " << (*i)->getName();
+        O << " " << (*i)->getNameStr();
       }
       O << "\n";
     }

Modified: poolalloc/trunk/lib/DSA/DataStructure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructure.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructure.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructure.cpp Tue Aug  4 14:08:49 2009
@@ -1426,7 +1426,7 @@
     std::string Return;
     for (DSGraph::retnodes_iterator I = retnodes_begin();
          I != retnodes_end(); ++I)
-      Return += I->first->getName() + " ";
+      Return += I->first->getNameStr() + " ";
     Return.erase(Return.end()-1, Return.end());   // Remove last space character
     return Return;
   }

Modified: poolalloc/trunk/lib/DSA/DataStructureStats.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/DataStructureStats.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/DataStructureStats.cpp (original)
+++ poolalloc/trunk/lib/DSA/DataStructureStats.cpp Tue Aug  4 14:08:49 2009
@@ -20,6 +20,8 @@
 #include "llvm/Support/Streams.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/FormattedStream.h"
+
 #include <ostream>
 using namespace llvm;
 
@@ -94,19 +96,21 @@
       if (Callees.size() > 0) {
         totalNumCallees  += Callees.size();
         ++numIndirectCalls;
-      } else
-        cerr << "WARNING: No callee in Function '" << F.getName()
-             << "' at call: \n"
-             << *I->getCallSite().getInstruction();
+      } else {
+        DEBUG(ferrs() << "WARNING: No callee in Function '" 
+	      << F.getNameStr() << "' at call: \n"
+	      << *I->getCallSite().getInstruction());
+      }
     }
 
   TotalNumCallees  += totalNumCallees;
   NumIndirectCalls += numIndirectCalls;
 
-  if (numIndirectCalls)
-    cout << "  In function " << F.getName() << ":  "
-         << (totalNumCallees / (double) numIndirectCalls)
-         << " average callees per indirect call\n";
+  if (numIndirectCalls) {
+    DEBUG(ferrs() << "  In function " << F.getName() << ":  "
+	  << (totalNumCallees / (double) numIndirectCalls)
+	  << " average callees per indirect call\n");
+  }
 }
 
 DSNode *DSGraphStats::getNodeForValue(Value *V) {

Modified: poolalloc/trunk/lib/DSA/Local.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Local.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/Local.cpp (original)
+++ poolalloc/trunk/lib/DSA/Local.cpp Tue Aug  4 14:08:49 2009
@@ -23,6 +23,7 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/ADT/DenseSet.h"
@@ -249,7 +250,7 @@
       NH = getValueDest(*(cast<GlobalAlias>(C)->getAliasee()));
       return 0;
     } else {
-      llvm::cerr << "Unknown constant: " << *C << std::endl;
+      DEBUG(ferrs() << "Unknown constant: " << *C << "\n");
       assert(0 && "Unknown constant type!");
     }
     N = createNode(); // just create a shadow node
@@ -486,9 +487,9 @@
       } else {
         // Variable index into a node.  We must merge all of the elements of the
         // sequential type here.
-        if (isa<PointerType>(STy))
-          cerr << "Pointer indexing not handled yet!\n";
-        else {
+        if (isa<PointerType>(STy)) {
+          DEBUG(ferrs() << "Pointer indexing not handled yet!\n");
+	} else {
           const ArrayType *ATy = cast<ArrayType>(STy);
           unsigned ElSize = TD.getTypeAllocSize(CurTy);
           DSNode *N = Value.getNode();
@@ -535,8 +536,9 @@
     if (IGEP->getParent()->getParent()->getName() == "alloc_vfsmnt")
     {
       if (G.getPoolDescriptorsMap().count(N) != 0)
-        if (G.getPoolDescriptorsMap()[N])
-  std::cerr << "LLVA: GEP[" << 0 << "]: Pool for " << GEP.getName() << " is " << G.getPoolDescriptorsMap()[N]->getName() << "\n";
+        if (G.getPoolDescriptorsMap()[N]) {
+	  DEBUG(ferrs() << "LLVA: GEP[" << 0 << "]: Pool for " << GEP.getName() << " is " << G.getPoolDescriptorsMap()[N]->getName() << "\n");
+	}
     }
   }
 #endif
@@ -695,7 +697,7 @@
         return true;
     }
 
-    cerr << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n";
+    DEBUG(ferrs() << "[dsa:local] Unhandled intrinsic: " << F->getName() << "\n");
     assert(0 && "Unhandled intrinsic");
     return false;
   }
@@ -726,7 +728,7 @@
   if (!isa<Function>(Callee)) {
     CalleeNode = getValueDest(*Callee).getNode();
     if (CalleeNode == 0) {
-      cerr << "WARNING: Program is calling through a null pointer?\n"<< *I;
+      DEBUG(ferrs() << "WARNING: Program is calling through a null pointer?\n" << *I);
       return;  // Calling a null pointer?
     }
   }

Modified: poolalloc/trunk/lib/DSA/Printer.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/Printer.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/Printer.cpp (original)
+++ poolalloc/trunk/lib/DSA/Printer.cpp Tue Aug  4 14:08:49 2009
@@ -24,7 +24,7 @@
 #include "llvm/Support/Streams.h"
 #include "llvm/ADT/Statistic.h"
 #include "llvm/Config/config.h"
-#include "llvm/Support/raw_ostream.h"
+#include "llvm/Support/FormattedStream.h"
 #include <ostream>
 #include <fstream>
 #include <sstream>
@@ -190,7 +190,7 @@
         if (G->getReturnNodes().size() == 1)
           Label = "returning";
         else
-          Label = I->first->getName() + " ret node";
+          Label = I->first->getNameStr() + " ret node";
         // Output the return node...
         GW.emitSimpleNode((void*)I->first, "plaintext=circle", Label);
 
@@ -295,17 +295,17 @@
       if (I->getName() == "main" || !OnlyPrintMain) {
         const Function *SCCFn = Gr->retnodes_begin()->first;
         if (&*I == SCCFn) {
-          Gr->writeGraphToFile(O, Prefix+I->getName());
+          Gr->writeGraphToFile(O, Prefix+I->getNameStr());
         } else {
           IsDuplicateGraph = true; // Don't double count node/call nodes.
-          O << "Didn't write '" << Prefix+I->getName()
-            << ".dot' - Graph already emitted to '" << Prefix+SCCFn->getName()
+          O << "Didn't write '" << Prefix+I->getNameStr()
+            << ".dot' - Graph already emitted to '" << Prefix+SCCFn->getNameStr()
             << "\n";
         }
       } else {
         const Function *SCCFn = Gr->retnodes_begin()->first;
         if (&*I == SCCFn) {
-          O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... ["
+          O << "Skipped Writing '" << Prefix+I->getNameStr() << ".dot'... ["
             << Gr->getGraphSize() << "+" << NumCalls << "]\n";
         } else {
           IsDuplicateGraph = true; // Don't double count node/call nodes.
@@ -343,13 +343,13 @@
 void DataStructures::dumpCallGraph() const {
   for(  ActualCalleesTy::const_iterator ii = ActualCallees.begin(), ee = ActualCallees.end();
         ii != ee; ++ii) {
-    if (ii->first) cerr << ii->first->getParent()->getParent()->getName() << " ";
-    cerr << ii->first << ": [";
+    if (ii->first) ferrs() << ii->first->getParent()->getParent()->getName() << " ";
+    ferrs() << ii->first << ": [";
     for (callee_iterator cbi = ii->second.begin(), cbe = ii->second.end();
          cbi != cbe; ++cbi) {
-      cerr << (*cbi)->getName() << " ";
+      ferrs() << (*cbi)->getName() << " ";
     }
-    cerr << "]\n";
+    ferrs() << "]\n";
     if (ii->first) ii->first->dump();
   }
 }

Modified: poolalloc/trunk/lib/DSA/StdLibPass.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/StdLibPass.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/StdLibPass.cpp (original)
+++ poolalloc/trunk/lib/DSA/StdLibPass.cpp Tue Aug  4 14:08:49 2009
@@ -20,6 +20,7 @@
 #include "llvm/Target/TargetData.h"
 #include "llvm/Support/CommandLine.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Timer.h"
 #include <iostream>
 #include "llvm/Module.h"
@@ -182,7 +183,8 @@
       if (CI->getOperand(0) == F) {
         DSGraph* Graph = getDSGraph(*CI->getParent()->getParent());
         //delete the call
-        DOUT << "Removing " << F->getName() << " from " << CI->getParent()->getParent()->getName() << "\n";
+        DEBUG(ferrs() << "Removing " << F->getNameStr() << " from " 
+	      << CI->getParent()->getParent()->getNameStr() << "\n");
         Graph->removeFunctionCalls(*F);
       }
 }

Modified: poolalloc/trunk/lib/DSA/TopDownClosure.cpp
URL: http://llvm.org/viewvc/llvm-project/poolalloc/trunk/lib/DSA/TopDownClosure.cpp?rev=78088&r1=78087&r2=78088&view=diff

==============================================================================
--- poolalloc/trunk/lib/DSA/TopDownClosure.cpp (original)
+++ poolalloc/trunk/lib/DSA/TopDownClosure.cpp Tue Aug  4 14:08:49 2009
@@ -20,6 +20,7 @@
 #include "llvm/DerivedTypes.h"
 #include "dsa/DSGraph.h"
 #include "llvm/Support/Debug.h"
+#include "llvm/Support/FormattedStream.h"
 #include "llvm/Support/Timer.h"
 #include "llvm/ADT/Statistic.h"
 using namespace llvm;
@@ -197,7 +198,8 @@
       RC.getClonedNH(GG->getNodeForValue(*GI));
   }
 
-  DOUT << "[TD] Inlining callers into '" << DSG->getFunctionNames() << "'\n";
+  DEBUG(ferrs() << "[TD] Inlining callers into '" 
+	<< DSG->getFunctionNames() << "'\n");
 
   // Iteratively inline caller graphs into this graph.
   while (!EdgesFromCaller.empty()) {
@@ -213,13 +215,16 @@
     do {
       const DSCallSite &CS = *EdgesFromCaller.back().CS;
       const Function &CF = *EdgesFromCaller.back().CalledFunction;
-      DOUT << "   [TD] Inlining graph into Fn '" << CF.getName() << "' from ";
-      if (CallerGraph->getReturnNodes().empty())
-        DOUT << "SYNTHESIZED INDIRECT GRAPH";
-      else
-        DOUT << "Fn '" << CS.getCallSite().getInstruction()->
-                            getParent()->getParent()->getName() << "'";
-      DOUT << ": " << CF.getFunctionType()->getNumParams() << " args\n";
+      DEBUG(ferrs() << "   [TD] Inlining graph into Fn '" 
+	    << CF.getNameStr() << "' from ");
+      if (CallerGraph->getReturnNodes().empty()) {
+        DEBUG(ferrs() << "SYNTHESIZED INDIRECT GRAPH");
+      } else {
+        DEBUG(ferrs() << "Fn '" << CS.getCallSite().getInstruction()->
+	      getParent()->getParent()->getNameStr() << "'");
+      }
+      DEBUG(ferrs() << ": " << CF.getFunctionType()->getNumParams() 
+	    << " args\n");
 
       // Get the formal argument and return nodes for the called function and
       // merge them with the cloned subgraph.
@@ -334,8 +339,8 @@
 
     // If we already have this graph, recycle it.
     if (IndCallRecI != IndCallMap.end() && IndCallRecI->first == Callees) {
-      DOUT << "  [TD] *** Reuse of indcall graph for " << Callees.size()
-           << " callees!\n";
+      DEBUG(ferrs() << "  [TD] *** Reuse of indcall graph for " << Callees.size()
+	    << " callees!\n");
       IndCallGraph = IndCallRecI->second;
     } else {
       // Otherwise, create a new DSGraph to represent this.





More information about the llvm-commits mailing list