summaryrefslogtreecommitdiff
path: root/lib/Analysis/InstCount.cpp
diff options
context:
space:
mode:
authorChris Lattner <sabre@nondot.org>2006-12-19 22:30:33 +0000
committerChris Lattner <sabre@nondot.org>2006-12-19 22:30:33 +0000
commit3b27d68c6af2582df0962557f1fe5c3f70f46e3f (patch)
tree7e277599fc296b352ed0dec8ea930c2f6c7f094a /lib/Analysis/InstCount.cpp
parentcbfdd1f840630d8a899020e7fb05aa7fbdb52963 (diff)
downloadllvm-3b27d68c6af2582df0962557f1fe5c3f70f46e3f.tar.gz
llvm-3b27d68c6af2582df0962557f1fe5c3f70f46e3f.tar.bz2
llvm-3b27d68c6af2582df0962557f1fe5c3f70f46e3f.tar.xz
eliminate static ctors from Statistics
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32697 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Analysis/InstCount.cpp')
-rw-r--r--lib/Analysis/InstCount.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/Analysis/InstCount.cpp b/lib/Analysis/InstCount.cpp
index 04dfbf4cf9..090dcdd577 100644
--- a/lib/Analysis/InstCount.cpp
+++ b/lib/Analysis/InstCount.cpp
@@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
+#define DEBUG_TYPE "instcount"
#include "llvm/Analysis/Passes.h"
#include "llvm/Pass.h"
#include "llvm/Function.h"
@@ -20,17 +21,18 @@
#include <ostream>
using namespace llvm;
-namespace {
- Statistic TotalInsts ("instcount", "Number of instructions (of all types)");
- Statistic TotalBlocks("instcount", "Number of basic blocks");
- Statistic TotalFuncs ("instcount", "Number of non-external functions");
- Statistic TotalMemInst("instcount", "Number of memory instructions");
+STATISTIC(TotalInsts , "Number of instructions (of all types)");
+STATISTIC(TotalBlocks, "Number of basic blocks");
+STATISTIC(TotalFuncs , "Number of non-external functions");
+STATISTIC(TotalMemInst, "Number of memory instructions");
#define HANDLE_INST(N, OPCODE, CLASS) \
- Statistic Num##OPCODE##Inst("instcount", "Number of " #OPCODE " insts");
+ STATISTIC(Num ## OPCODE ## Inst, "Number of " #OPCODE " insts");
#include "llvm/Instruction.def"
+
+namespace {
class InstCount : public FunctionPass, public InstVisitor<InstCount> {
friend class InstVisitor<InstCount>;