eliminate static ctors for Statistic objects.
authorChris Lattner <sabre@nondot.org>
Tue, 19 Dec 2006 22:59:26 +0000 (22:59 +0000)
committerChris Lattner <sabre@nondot.org>
Tue, 19 Dec 2006 22:59:26 +0000 (22:59 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32703 91177308-0d34-0410-b5e6-96231b3b80d8

21 files changed:
lib/Target/ARM/ARMAsmPrinter.cpp
lib/Target/Alpha/AlphaAsmPrinter.cpp
lib/Target/Alpha/AlphaCodeEmitter.cpp
lib/Target/Alpha/AlphaISelDAGToDAG.cpp
lib/Target/Alpha/AlphaLLRP.cpp
lib/Target/IA64/IA64AsmPrinter.cpp
lib/Target/IA64/IA64Bundling.cpp
lib/Target/IA64/IA64ISelDAGToDAG.cpp
lib/Target/PowerPC/PPCAsmPrinter.cpp
lib/Target/PowerPC/PPCBranchSelector.cpp
lib/Target/PowerPC/PPCISelDAGToDAG.cpp
lib/Target/Sparc/DelaySlotFiller.cpp
lib/Target/Sparc/FPMover.cpp
lib/Target/Sparc/SparcAsmPrinter.cpp
lib/Target/X86/X86ATTAsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.cpp
lib/Target/X86/X86AsmPrinter.h
lib/Target/X86/X86CodeEmitter.cpp
lib/Target/X86/X86FloatingPoint.cpp
lib/Target/X86/X86ISelDAGToDAG.cpp
lib/Target/X86/X86IntelAsmPrinter.cpp

index 291073e04cda137981dae49139fe2b39ab51c74b..d4c6634214a0c6cfb9d748a83c6f6234d0397c33 100644 (file)
@@ -13,6 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "asm-printer"
 #include "ARM.h"
 #include "ARMInstrInfo.h"
 #include "llvm/Constants.h"
@@ -33,9 +34,9 @@
 #include <cctype>
 using namespace llvm;
 
-namespace {
-  Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
+STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
+namespace {
   static const char *ARMCondCodeToString(ARMCC::CondCodes CC) {
     switch (CC) {
     default: assert(0 && "Unknown condition code");
@@ -144,6 +145,7 @@ bool ARMAsmPrinter::runOnMachineFunction(MachineFunction &MF) {
          II != E; ++II) {
       // Print the assembly for the instruction.
       O << "\t";
+      ++EmittedInsts;
       printInstruction(II);
     }
   }
index be8973a337a261f67e52f40e97aa82ba75f55b96..6e36f1152344f1041d1b9ba54c61e3c4e1a7c394 100644 (file)
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "asm-printer"
 #include "Alpha.h"
 #include "AlphaInstrInfo.h"
 #include "AlphaTargetMachine.h"
@@ -26,9 +27,9 @@
 #include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
+STATISTIC(EmittedInsts, "Number of machine instrs printed");
+
 namespace {
-  Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
-  
   struct VISIBILITY_HIDDEN AlphaAsmPrinter : public AsmPrinter {
 
     /// Unique incrementer for label values for referencing Global values.
index 6f5bc70f0583982e04839dc04772b5fe63088817..15aef8532d5fb4acbd8e0643d251ed0a539274a3 100644 (file)
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "alpha-emitter"
 #include "AlphaTargetMachine.h"
 #include "AlphaRelocations.h"
 #include "Alpha.h"
 #include "llvm/CodeGen/Passes.h"
 #include "llvm/Function.h"
 #include "llvm/Support/Debug.h"
-#include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
-namespace {
-  Statistic
-  NumEmitted("alpha-emitter", "Number of machine instructions emitted");
-}
-
 namespace {
   class AlphaCodeEmitter : public MachineFunctionPass {
     const AlphaInstrInfo  *II;
index fc752aa31f64ebde617f7e621028dfa055bffd49..14790456599dff6bfc8892e09eb657f827212564 100644 (file)
@@ -22,7 +22,6 @@
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGISel.h"
 #include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
 #include "llvm/Constants.h"
 #include "llvm/GlobalValue.h"
 #include "llvm/Intrinsics.h"
index 6e59e466b69e16c3dce1a5e5f2f58ab149b7d18c..a5c984eaf6c1cc6ba719aafb2b89b36b6fc26889 100644 (file)
@@ -8,10 +8,11 @@
 //===----------------------------------------------------------------------===//
 //
 // Here we check for potential replay traps introduced by the spiller
-// We also align some branch targets if we can do so for free
+// We also align some branch targets if we can do so for free.
+//
 //===----------------------------------------------------------------------===//
 
-
+#define DEBUG_TYPE "alpha-nops"
 #include "Alpha.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
 #include "llvm/Support/CommandLine.h"
 using namespace llvm;
 
-namespace {
-  Statistic nopintro("alpha-nops", "Number of nops inserted");
-  Statistic nopalign("alpha-nops-align", 
-                      "Number of nops inserted for alignment");
+STATISTIC(nopintro, "Number of nops inserted");
+STATISTIC(nopalign, "Number of nops inserted for alignment");
 
+namespace {
   cl::opt<bool>
   AlignAll("alpha-align-all", cl::Hidden,
                    cl::desc("Align all blocks"));
index 6915cbc5d95f8ae3cd4f171de58fcfee54bb211a..4f45dc7790c87d04f1c8e68f9a9d3b94487ed4ba 100644 (file)
@@ -16,6 +16,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "asm-printer"
 #include "IA64.h"
 #include "IA64TargetMachine.h"
 #include "llvm/Module.h"
@@ -28,9 +29,9 @@
 #include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
+STATISTIC(EmittedInsts, "Number of machine instrs printed");
+
 namespace {
-  Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
-  
   struct IA64AsmPrinter : public AsmPrinter {
     std::set<std::string> ExternalFunctionNames, ExternalObjectNames;
 
index 9b5e4c741e4f9fb676d21083d6181b257e325e39..7e37df022d7c5919fa76aee293be3cabcc3004cd 100644 (file)
@@ -20,6 +20,7 @@
 // 
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "ia64-codegen"
 #include "IA64.h"
 #include "IA64InstrInfo.h"
 #include "IA64TargetMachine.h"
@@ -31,9 +32,9 @@
 #include <set>
 using namespace llvm;
 
-namespace {
-  Statistic StopBitsAdded("ia64-codegen", "Number of stop bits added");
+STATISTIC(StopBitsAdded, "Number of stop bits added");
 
+namespace {
   struct IA64BundlingPass : public MachineFunctionPass {
     /// Target machine description which we query for reg. names, data
     /// layout, etc.
index 7a49418de647cae1651a3155c9d73261efe0b6cb..6185d380b544da8b636e54be1f3871a4c48a6864 100644 (file)
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "ia64-codegen"
 #include "IA64.h"
 #include "IA64TargetMachine.h"
 #include "IA64ISelLowering.h"
@@ -21,7 +22,6 @@
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGISel.h"
 #include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
 #include "llvm/Constants.h"
 #include "llvm/GlobalValue.h"
 #include "llvm/Intrinsics.h"
@@ -32,9 +32,6 @@
 using namespace llvm;
 
 namespace {
-  Statistic FusedFP ("ia64-codegen", "Number of fused fp operations");
-  Statistic FrameOff("ia64-codegen", "Number of frame idx offsets collapsed");
-    
   //===--------------------------------------------------------------------===//
   /// IA64DAGToDAGISel - IA64 specific code to select IA64 machine
   /// instructions for SelectionDAG operations.
index 1ffd65265f17af334f52bfe71b5f8201d450bf7b..3a1f945b33251f6e5fb39ec3552d49505e2207eb 100644 (file)
@@ -44,9 +44,9 @@
 #include <set>
 using namespace llvm;
 
-namespace {
-  Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
+STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
+namespace {
   struct VISIBILITY_HIDDEN PPCAsmPrinter : public AsmPrinter {
     std::set<std::string> FnStubs, GVStubs;
     const PPCSubtarget &Subtarget;
index 7a8b094bfff3f8e507ebb63d1fd31af437650a51..e8274f3b9e531e29814405b7a1cfa8c0b4b359c8 100644 (file)
@@ -15,6 +15,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "ppc-branch-select"
 #include "PPC.h"
 #include "PPCInstrBuilder.h"
 #include "PPCInstrInfo.h"
@@ -27,8 +28,7 @@
 #include "llvm/Support/MathExtras.h"
 using namespace llvm;
 
-static Statistic NumExpanded("ppc-branch-select",
-                               "Num branches expanded to long format");
+STATISTIC(NumExpanded, "Number of branches expanded to long format");
 
 namespace {
   struct VISIBILITY_HIDDEN PPCBSel : public MachineFunctionPass {
index 08cceecb5b0f0e8aad4526ca69015ba36349d32b..c8a7738372b7f09c8ba4dcba7d3fbd3da3336c63 100644 (file)
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "ppc-codegen"
 #include "PPC.h"
 #include "PPCPredicates.h"
 #include "PPCTargetMachine.h"
@@ -23,7 +24,6 @@
 #include "llvm/CodeGen/SelectionDAG.h"
 #include "llvm/CodeGen/SelectionDAGISel.h"
 #include "llvm/Target/TargetOptions.h"
-#include "llvm/ADT/Statistic.h"
 #include "llvm/Constants.h"
 #include "llvm/GlobalValue.h"
 #include "llvm/Intrinsics.h"
@@ -35,8 +35,6 @@
 using namespace llvm;
 
 namespace {
-  Statistic FrameOff("ppc-codegen", "Number of frame idx offsets collapsed");
-    
   //===--------------------------------------------------------------------===//
   /// PPCDAGToDAGISel - PPC specific code to select PPC machine
   /// instructions for SelectionDAG operations.
index 768b79b9fb101aa2bc4fcc717ae8c969c2a40374..898b23ab50fb9892b4697c65e5d9ed64cdda6663 100644 (file)
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "delayslotfiller"
 #include "Sparc.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/CodeGen/MachineInstrBuilder.h"
@@ -19,9 +20,9 @@
 #include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
-namespace {
-  Statistic FilledSlots("delayslotfiller", "Num. of delay slots filled");
+STATISTIC(FilledSlots, "Number of delay slots filled");
 
+namespace {
   struct Filler : public MachineFunctionPass {
     /// Target machine description which we query for reg. names, data
     /// layout, etc.
index b85d2a9da01ef4bc19b033592e9dc74ee025a828..f7e6506de4310963c8deea89714d77e85e9ea950 100644 (file)
@@ -11,6 +11,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "fpmover"
 #include "Sparc.h"
 #include "SparcSubtarget.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include "llvm/Support/Debug.h"
 using namespace llvm;
 
-namespace {
-  Statistic NumFpDs("fpmover", "Number of instructions translated");
-  Statistic NoopFpDs("fpmover", "Number of noop instructions removed");
+STATISTIC(NumFpDs , "Number of instructions translated");
+STATISTIC(NoopFpDs, "Number of noop instructions removed");
 
+namespace {
   struct FPMover : public MachineFunctionPass {
     /// Target machine description which we query for reg. names, data
     /// layout, etc.
index 458b1531915c6639f730b53ac5d9fd3cb34127e5..3bb003ad3d370cb1fa05ebd1d5f4150aaef65e51 100644 (file)
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "asm-printer"
 #include "Sparc.h"
 #include "SparcInstrInfo.h"
 #include "llvm/Constants.h"
@@ -32,9 +33,9 @@
 #include <cctype>
 using namespace llvm;
 
-namespace {
-  Statistic EmittedInsts("asm-printer", "Number of machine instrs printed");
+STATISTIC(EmittedInsts, "Number of machine instrs printed");
 
+namespace {
   struct VISIBILITY_HIDDEN SparcAsmPrinter : public AsmPrinter {
     SparcAsmPrinter(std::ostream &O, TargetMachine &TM, const TargetAsmInfo *T)
       : AsmPrinter(O, TM, T) {
index f9645b80d280f1c36bfcce48784a866afe9003a8..f9b03b2455f9b85545aec480d5b3ce24e271b112 100755 (executable)
@@ -13,6 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "asm-printer"
 #include "X86ATTAsmPrinter.h"
 #include "X86.h"
 #include "X86MachineFunctionInfo.h"
 #include "llvm/Support/Mangler.h"
 #include "llvm/Target/TargetAsmInfo.h"
 #include "llvm/Target/TargetOptions.h"
+#include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
+STATISTIC(EmittedInsts, "Number of machine instrs printed");
+
 /// getSectionForFunction - Return the section that we should emit the
 /// specified function body into.
 std::string X86ATTAsmPrinter::getSectionForFunction(const Function &F) const {
index 578e1aa9785ca8756835191a689df50306003c89..65d2e7d36a6f6b8609d6cfb58da96d00ceb417b7 100644 (file)
 #include "llvm/Assembly/Writer.h"
 #include "llvm/Support/Mangler.h"
 #include "llvm/Target/TargetAsmInfo.h"
-
 using namespace llvm;
 
-Statistic llvm::EmittedInsts("asm-printer",
-                               "Number of machine instrs printed");
-
 static X86FunctionInfo calculateFunctionInfo(const Function *F,
                                              const TargetData *TD) {
   X86FunctionInfo Info;
index af182fab259f3e94605bea5f7596ea9cd401ad71..c5f521bf786ebbe6e568d913c4412dd4715d45d8 100755 (executable)
 #include "llvm/CodeGen/AsmPrinter.h"
 #include "llvm/CodeGen/DwarfWriter.h"
 #include "llvm/CodeGen/MachineDebugInfo.h"
-#include "llvm/ADT/Statistic.h"
 #include "llvm/Support/Compiler.h"
 #include <set>
 
 
 namespace llvm {
 
-extern Statistic EmittedInsts;
-
 // FIXME: Move this to CodeGen/AsmPrinter.h
 namespace PICStyle {
   enum X86AsmPICStyle {
index dbbd66f491b8ab29e97b3f50a984f4ff3acf5e59..fa3cd57b8a32726c7faf386714097b1deb62dda6 100644 (file)
@@ -12,6 +12,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "x86-emitter"
 #include "X86InstrInfo.h"
 #include "X86Subtarget.h"
 #include "X86TargetMachine.h"
 #include "llvm/Target/TargetOptions.h"
 using namespace llvm;
 
-namespace {
-  Statistic
-  NumEmitted("x86-emitter", "Number of machine instructions emitted");
-}
+STATISTIC(NumEmitted, "Number of machine instructions emitted");
 
 namespace {
   class VISIBILITY_HIDDEN Emitter : public MachineFunctionPass {
index b70b6e2971228f2ce8ab48da4f88f34cbd2f466a..7bed30364fb3ff79440419994a47bcc540e8c9ff 100644 (file)
@@ -28,7 +28,7 @@
 //
 //===----------------------------------------------------------------------===//
 
-#define DEBUG_TYPE "fp"
+#define DEBUG_TYPE "x86-codegen"
 #include "X86.h"
 #include "X86InstrInfo.h"
 #include "llvm/CodeGen/MachineFunctionPass.h"
 #include <set>
 using namespace llvm;
 
-namespace {
-  Statistic NumFXCH("x86-codegen", "Number of fxch instructions inserted");
-  Statistic NumFP  ("x86-codegen", "Number of floating point instructions");
+STATISTIC(NumFXCH, "Number of fxch instructions inserted");
+STATISTIC(NumFP  , "Number of floating point instructions");
 
+namespace {
   struct VISIBILITY_HIDDEN FPS : public MachineFunctionPass {
     virtual bool runOnMachineFunction(MachineFunction &MF);
 
index 863e6d8a14de18063e3bd8556c48965fc056ae84..411bcbeb561c92ea1a5036130c089fc5a560228c 100644 (file)
 #include <set>
 using namespace llvm;
 
+STATISTIC(NumFPKill   , "Number of FP_REG_KILL instructions added");
+STATISTIC(NumLoadMoved, "Number of loads moved below TokenFactor");
+
+
 //===----------------------------------------------------------------------===//
 //                      Pattern Matcher Implementation
 //===----------------------------------------------------------------------===//
@@ -75,12 +79,6 @@ namespace {
 }
 
 namespace {
-  Statistic
-  NumFPKill("x86-codegen", "Number of FP_REG_KILL instructions added");
-
-  Statistic
-  NumLoadMoved("x86-codegen", "Number of loads moved below TokenFactor");
-
   //===--------------------------------------------------------------------===//
   /// ISel - X86 specific code to select X86 machine instructions for
   /// SelectionDAG operations.
index 142177c4ee22d0c339546865f6684600198b87b1..fa3529575025d1e9d4d57f1343449e5fd0d6f1c3 100755 (executable)
@@ -13,6 +13,7 @@
 //
 //===----------------------------------------------------------------------===//
 
+#define DEBUG_TYPE "asm-printer"
 #include "X86IntelAsmPrinter.h"
 #include "X86TargetAsmInfo.h"
 #include "X86.h"
 #include "llvm/Support/Mangler.h"
 #include "llvm/Target/TargetAsmInfo.h"
 #include "llvm/Target/TargetOptions.h"
+#include "llvm/ADT/Statistic.h"
 using namespace llvm;
 
+STATISTIC(EmittedInsts, "Number of machine instrs printed");
+
 std::string X86IntelAsmPrinter::getSectionForFunction(const Function &F) const {
   // Intel asm always emits functions to _text.
   return "_text";