Compute total number of nodes and # call nodes
authorChris Lattner <sabre@nondot.org>
Thu, 7 Nov 2002 02:18:46 +0000 (02:18 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 7 Nov 2002 02:18:46 +0000 (02:18 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4592 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/Printer.cpp

index f5c1ec49cf1f52d9d20325ea8674937b53ab9c17..edee17212d4b46e8397217f1dcd1f4619f138d4b 100644 (file)
@@ -167,9 +167,12 @@ static void printCollection(const Collection &C, std::ostream &O,
     return;
   }
 
+  unsigned TotalNumNodes = 0, TotalCallNodes = 0;
   for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
     if (!I->isExternal()) {
       DSGraph &Gr = C.getDSGraph((Function&)*I);
+      TotalNumNodes += Gr.getGraphSize();
+      TotalCallNodes += Gr.getFunctionCalls().size();
       if (I->getName() == "main" || !OnlyPrintMain)
         Gr.writeGraphToFile(O, Prefix+I->getName());
       else {
@@ -177,6 +180,9 @@ static void printCollection(const Collection &C, std::ostream &O,
           << Gr.getGraphSize() << "+" << Gr.getFunctionCalls().size() << "]\n";
       }
     }
+
+  O << "\nGraphs contain [" << TotalNumNodes << "+" << TotalCallNodes 
+    << "] nodes total\n";
 }