Add support for printing out statistics information when -stats is added to
the command line
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@2601 91177308-0d34-0410-b5e6-96231b3b80d8
diff --git a/lib/Transforms/Scalar/PiNodeInsertion.cpp b/lib/Transforms/Scalar/PiNodeInsertion.cpp
index d7bc08b..2e9c328 100644
--- a/lib/Transforms/Scalar/PiNodeInsertion.cpp
+++ b/lib/Transforms/Scalar/PiNodeInsertion.cpp
@@ -34,6 +34,9 @@
#include "llvm/iOperators.h"
#include "llvm/iPHINode.h"
#include "llvm/Support/CFG.h"
+#include "Support/StatisticReporter.h"
+
+static Statistic<> NumInserted("pinodes\t\t- Number of Pi nodes inserted");
namespace {
struct PiNodeInserter : public FunctionPass {
@@ -180,6 +183,8 @@
if (Rep == 0)
cast<PHINode>(Pi)->addIncoming(V, Pred);
+
+ ++NumInserted;
return true;
}