When the -only-print-main-ds option is specified, still print out graph size
authorChris Lattner <sabre@nondot.org>
Thu, 7 Nov 2002 01:54:44 +0000 (01:54 +0000)
committerChris Lattner <sabre@nondot.org>
Thu, 7 Nov 2002 01:54:44 +0000 (01:54 +0000)
statistics for skipped functions

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@4587 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/DataStructure/Printer.cpp

index e196535c25b1751d2bd69764c48d8e8b13e9ccf4..f5c1ec49cf1f52d9d20325ea8674937b53ab9c17 100644 (file)
@@ -168,8 +168,15 @@ static void printCollection(const Collection &C, std::ostream &O,
   }
 
   for (Module::const_iterator I = M->begin(), E = M->end(); I != E; ++I)
-    if (!I->isExternal() && (I->getName() == "main" || !OnlyPrintMain))
-      C.getDSGraph((Function&)*I).writeGraphToFile(O, Prefix+I->getName());
+    if (!I->isExternal()) {
+      DSGraph &Gr = C.getDSGraph((Function&)*I);
+      if (I->getName() == "main" || !OnlyPrintMain)
+        Gr.writeGraphToFile(O, Prefix+I->getName());
+      else {
+        O << "Skipped Writing '" << Prefix+I->getName() << ".dot'... ["
+          << Gr.getGraphSize() << "+" << Gr.getFunctionCalls().size() << "]\n";
+      }
+    }
 }