Switch over Transforms/Scalar to use the STATISTIC macro. For each statistic

converted, we lose a static initializer.  This also allows GCC to emit warnings
about unused statistics.


git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32690 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner
2006-12-19 21:40:18 +00:00
parent 193c88cb56
commit 0e5f499638
21 changed files with 101 additions and 102 deletions

View File

@@ -14,6 +14,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "gcse"
#include "llvm/Transforms/Scalar.h"
#include "llvm/BasicBlock.h"
#include "llvm/Constant.h"
@@ -27,15 +28,14 @@
#include <algorithm>
using namespace llvm;
STATISTIC(NumInstRemoved, "Number of instructions removed");
STATISTIC(NumLoadRemoved, "Number of loads removed");
STATISTIC(NumCallRemoved, "Number of calls removed");
STATISTIC(NumNonInsts , "Number of instructions removed due "
"to non-instruction values");
STATISTIC(NumArgsRepl , "Number of function arguments replaced "
"with constant values");
namespace {
Statistic NumInstRemoved("gcse", "Number of instructions removed");
Statistic NumLoadRemoved("gcse", "Number of loads removed");
Statistic NumCallRemoved("gcse", "Number of calls removed");
Statistic NumNonInsts ("gcse", "Number of instructions removed due "
"to non-instruction values");
Statistic NumArgsRepl ("gcse", "Number of function arguments replaced "
"with constant values");
struct GCSE : public FunctionPass {
virtual bool runOnFunction(Function &F);