diff options
author | Chris Lattner <sabre@nondot.org> | 2002-05-10 15:38:35 +0000 |
---|---|---|
committer | Chris Lattner <sabre@nondot.org> | 2002-05-10 15:38:35 +0000 |
commit | 3dec1f272219ee1f8e1499929cdf53f5bc3c2272 (patch) | |
tree | 5f1b55fbf194e79beb850cf398cc39d13071c0d7 /lib/Transforms/IPO/ConstantMerge.cpp | |
parent | 55547274bc3ef98165275da8b0f9af24c268dcf5 (diff) | |
download | llvm-3dec1f272219ee1f8e1499929cdf53f5bc3c2272.tar.gz llvm-3dec1f272219ee1f8e1499929cdf53f5bc3c2272.tar.bz2 llvm-3dec1f272219ee1f8e1499929cdf53f5bc3c2272.tar.xz |
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
Diffstat (limited to 'lib/Transforms/IPO/ConstantMerge.cpp')
-rw-r--r-- | lib/Transforms/IPO/ConstantMerge.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/Transforms/IPO/ConstantMerge.cpp b/lib/Transforms/IPO/ConstantMerge.cpp index 146911e818..11191f535a 100644 --- a/lib/Transforms/IPO/ConstantMerge.cpp +++ b/lib/Transforms/IPO/ConstantMerge.cpp @@ -19,6 +19,9 @@ #include "llvm/Module.h" #include "llvm/Function.h" #include "llvm/Pass.h" +#include "Support/StatisticReporter.h" + +static Statistic<> NumMerged("constmerge\t\t- Number of global constants merged"); // mergeDuplicateConstants - Workhorse for the pass. This eliminates duplicate // constants, starting at global ConstantNo, and adds vars to the map if they @@ -50,6 +53,7 @@ bool mergeDuplicateConstants(Module *M, unsigned &ConstantNo, delete GList.remove(GList.begin()+ConstantNo); --ConstantNo; // Don't skip the next constant. + ++NumMerged; MadeChanges = true; } } |