eliminate static ctors from Statistics
authorChris Lattner <sabre@nondot.org>
Tue, 19 Dec 2006 22:30:33 +0000 (22:30 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 19 Dec 2006 22:30:33 +0000 (22:30 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32697 91177308-0d34-0410-b5e6-96231b3b80d8

lib/Analysis/IPA/Andersens.cpp
lib/Analysis/IPA/GlobalsModRef.cpp
lib/Analysis/InstCount.cpp
lib/Analysis/ScalarEvolution.cpp

index 69462279a9a486399d64cb5779d88c5b0343a5ed..5d2841187a63a6a31b7be732cce8695dcec7bb55 100644 (file)
 #include <set>
 using namespace llvm;
 
-namespace {
-  Statistic
-  NumIters("anders-aa", "Number of iterations to reach convergence");
-  Statistic
-  NumConstraints("anders-aa", "Number of constraints");
-  Statistic
-  NumNodes("anders-aa", "Number of nodes");
-  Statistic
-  NumEscapingFunctions("anders-aa", "Number of internal functions that escape");
-  Statistic
-  NumIndirectCallees("anders-aa", "Number of indirect callees found");
+STATISTIC(NumIters            , "Number of iterations to reach convergence");
+STATISTIC(NumConstraints      , "Number of constraints");
+STATISTIC(NumNodes            , "Number of nodes");
+STATISTIC(NumEscapingFunctions, "Number of internal functions that escape");
+STATISTIC(NumIndirectCallees  , "Number of indirect callees found");
 
+namespace {
   class Andersens : public ModulePass, public AliasAnalysis,
                     private InstVisitor<Andersens> {
     /// Node class - This class is used to represent a memory object in the
index 7ae5e5be3509ba13ad23452323bcfa819e13b6c5..7c305b7a5edef5bdfe68bc4f48ada407c73608b4 100644 (file)
@@ -14,6 +14,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "globalsmodref-aa"
 #include "llvm/Analysis/Passes.h"
 #include "llvm/Module.h"
 #include "llvm/Pass.h"
 #include <set>
 using namespace llvm;
 
+STATISTIC(NumNonAddrTakenGlobalVars,
+          "Number of global vars without address taken");
+STATISTIC(NumNonAddrTakenFunctions,"Number of functions without address taken");
+STATISTIC(NumNoMemFunctions, "Number of functions that do not access memory");
+STATISTIC(NumReadMemFunctions, "Number of functions that only read memory");
+STATISTIC(NumIndirectGlobalVars, "Number of indirect global objects");
+
 namespace {
-  Statistic
-  NumNonAddrTakenGlobalVars("globalsmodref-aa",
-                            "Number of global vars without address taken");
-  Statistic
-  NumNonAddrTakenFunctions("globalsmodref-aa",
-                           "Number of functions without address taken");
-  Statistic
-  NumNoMemFunctions("globalsmodref-aa",
-                    "Number of functions that do not access memory");
-  Statistic
-  NumReadMemFunctions("globalsmodref-aa",
-                      "Number of functions that only read memory");
-  Statistic
-  NumIndirectGlobalVars("globalsmodref-aa",
-                        "Number of indirect global objects");
-  
   /// FunctionRecord - One instance of this structure is stored for every
   /// function in the program.  Later, the entries for these functions are
   /// removed if the function is found to call an external function (in which
index 04dfbf4cf979c339ceabd43e11c86a791d4591e5..090dcdd57793ee33a3b6e5dd76503237f2971484 100644 (file)
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "instcount"
 #include "llvm/Analysis/Passes.h"
 #include "llvm/Pass.h"
 #include "llvm/Function.h"
 #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>;
 
index 6cc89bd8019f3d4308418d1efa1ea13bd58eba59..7d03eb9a94eeeecf5d406e09d0ab1e0d97dca6ac 100644 (file)
@@ -59,6 +59,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "scalar-evolution"
 #include "llvm/Analysis/ScalarEvolutionExpressions.h"
 #include "llvm/Constants.h"
 #include "llvm/DerivedTypes.h"
 #include <cmath>
 using namespace llvm;
 
+STATISTIC(NumBruteForceEvaluations,
+          "Number of brute force evaluations needed to "
+          "calculate high-order polynomial exit values");
+STATISTIC(NumArrayLenItCounts,
+          "Number of trip counts computed with array length");
+STATISTIC(NumTripCountsComputed,
+          "Number of loops with predictable loop counts");
+STATISTIC(NumTripCountsNotComputed,
+          "Number of loops without predictable loop counts");
+STATISTIC(NumBruteForceTripCountsComputed,
+          "Number of loops with trip counts computed by force");
+
+cl::opt<unsigned>
+MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
+                        cl::desc("Maximum number of iterations SCEV will "
+                                 "symbolically execute a constant derived loop"),
+                        cl::init(100));
+
 namespace {
   RegisterPass<ScalarEvolution>
   R("scalar-evolution", "Scalar Evolution Analysis");
-
-  Statistic
-  NumBruteForceEvaluations("scalar-evolution",
-                           "Number of brute force evaluations needed to "
-                           "calculate high-order polynomial exit values");
-  Statistic
-  NumArrayLenItCounts("scalar-evolution",
-                      "Number of trip counts computed with array length");
-  Statistic
-  NumTripCountsComputed("scalar-evolution",
-                        "Number of loops with predictable loop counts");
-  Statistic
-  NumTripCountsNotComputed("scalar-evolution",
-                           "Number of loops without predictable loop counts");
-  Statistic
-  NumBruteForceTripCountsComputed("scalar-evolution",
-                        "Number of loops with trip counts computed by force");
-
-  cl::opt<unsigned>
-  MaxBruteForceIterations("scalar-evolution-max-iterations", cl::ReallyHidden,
-                          cl::desc("Maximum number of iterations SCEV will "
-                              "symbolically execute a constant derived loop"),
-                          cl::init(100));
 }
 
 //===----------------------------------------------------------------------===//