Add # of printed instructions statistic to both the SPARC and X86 LLC backends.
[oota-llvm.git] / lib / Target / X86 / X86AsmPrinter.cpp
index d36f298fe9962fa6a5ce0e43c36adba1ee1c69f1..fbc6b6e1aff8792c64a84f3fbc3108eb942e9d70 100644 (file)
 #include "llvm/CodeGen/MachineInstr.h"
 #include "llvm/Target/TargetMachine.h"
 #include "llvm/Support/Mangler.h"
+#include "Support/Statistic.h"
 #include "Support/StringExtras.h"
 #include "Support/CommandLine.h"
 
 namespace {
+  Statistic<> EmittedInsts("asm-printer", "Number of machine instrs printed");
+
   // FIXME: This should be automatically picked up by autoconf from the C
   // frontend
   cl::opt<bool> EmitCygwin("enable-cygwin-compatible-output", cl::Hidden,
@@ -573,6 +576,7 @@ void Printer::printMachineInstruction(const MachineInstr *MI) {
   const TargetInstrInfo &TII = TM.getInstrInfo();
   const TargetInstrDescriptor &Desc = TII.get(Opcode);
 
+  ++EmittedInsts;
   switch (Desc.TSFlags & X86II::FormMask) {
   case X86II::Pseudo:
     // Print pseudo-instructions as comments; either they should have been