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
This commit is contained in:
Chris Lattner
2002-05-10 15:38:35 +00:00
parent 55547274bc
commit 3dec1f2722
17 changed files with 109 additions and 17 deletions
+5 -1
View File
@@ -19,6 +19,9 @@
#include "llvm/Support/InstIterator.h"
#include <set>
#include "Support/StatisticReporter.h"
static Statistic<> NumInstKilled("constprop - Number of instructions killed");
namespace {
struct ConstantPropogation : public FunctionPass {
const char *getPassName() const { return "Simple Constant Propogation"; }
@@ -55,9 +58,10 @@ bool ConstantPropogation::runOnFunction(Function *F) {
// Replace all of the uses of a variable with uses of the constant.
I->replaceAllUsesWith(C);
// We made a change to the function...
Changed = true;
++NumInstKilled;
}
}
return Changed;