diff options
author | Chris Lattner <sabre@nondot.org> | 2002-11-07 02:18:46 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-11-07 02:18:46 +0000 |
commit | c03a377f6ae87a42da528486045b1f71fad28a92 (patch) | |
tree | e0795a371e7d7ba4e892d5dab17842d6bb4191d8 /llvm/lib/Analysis/DataStructure/Printer.cpp | |
parent | 1e3c2763753164814d29de63a96846bd1b932043 (diff) | |
download | bcm5719-llvm-c03a377f6ae87a42da528486045b1f71fad28a92.tar.gz bcm5719-llvm-c03a377f6ae87a42da528486045b1f71fad28a92.zip |
Compute total number of nodes and # call nodes
llvm-svn: 4592
Diffstat (limited to 'llvm/lib/Analysis/DataStructure/Printer.cpp')
-rw-r--r-- | llvm/lib/Analysis/DataStructure/Printer.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/llvm/lib/Analysis/DataStructure/Printer.cpp b/llvm/lib/Analysis/DataStructure/Printer.cpp index f5c1ec49cf1..edee17212d4 100644 --- a/llvm/lib/Analysis/DataStructure/Printer.cpp +++ b/llvm/lib/Analysis/DataStructure/Printer.cpp @@ -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"; } |