mirror of
https://github.com/c64scene-ar/llvm-6502.git
synced 2026-04-26 12:20:42 +00:00
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:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user