eliminate static ctors for Statistic objects.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@32703 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Chris Lattner 2006-12-19 22:59:26 +00:00
parent cecf56b069
commit 95b2c7da5e
21 changed files with 54 additions and 60 deletions

View 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);
}
}

View 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.

View File

@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "alpha-emitter"
#include "AlphaTargetMachine.h"
#include "AlphaRelocations.h"
#include "Alpha.h"
@ -22,14 +23,8 @@
#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;

View 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"

View 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"
@ -22,11 +23,10 @@
#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"));

View 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;

View 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.

View 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.

View 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;

View 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 {

View 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.

View 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.

View File

@ -11,6 +11,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "fpmover"
#include "Sparc.h"
#include "SparcSubtarget.h"
#include "llvm/CodeGen/MachineFunctionPass.h"
@ -21,10 +22,10 @@
#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.

View 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) {

View File

@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "asm-printer"
#include "X86ATTAsmPrinter.h"
#include "X86.h"
#include "X86MachineFunctionInfo.h"
@ -23,8 +24,11 @@
#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 {

View File

@ -27,12 +27,8 @@
#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;

View File

@ -22,15 +22,12 @@
#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 {

View File

@ -12,6 +12,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "x86-emitter"
#include "X86InstrInfo.h"
#include "X86Subtarget.h"
#include "X86TargetMachine.h"
@ -28,10 +29,7 @@
#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 {

View 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"
@ -47,10 +47,10 @@
#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);

View File

@ -38,6 +38,10 @@
#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.

View File

@ -13,6 +13,7 @@
//
//===----------------------------------------------------------------------===//
#define DEBUG_TYPE "asm-printer"
#include "X86IntelAsmPrinter.h"
#include "X86TargetAsmInfo.h"
#include "X86.h"
@ -23,8 +24,11 @@
#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";