- static Statistic<> NumReturnInst("instcount","Number of ReturnInsts");
- static Statistic<> NumBranchInst("instcount", "Number of BranchInsts");
- static Statistic<> NumPHINode("instcount", "Number of PHINodes");
- static Statistic<> NumCastInst("instcount", "Number of CastInsts");
- static Statistic<> NumCallInst("instcount", "Number of CallInsts");
- static Statistic<> NumMallocInst("instcount", "Number of MallocInsts");
- static Statistic<> NumAllocaInst("instcount", "Number of AllocaInsts");
- static Statistic<> NumFreeInst("instcount", "Number of FreeInsts");
- static Statistic<> NumLoadInst("instcount", "Number of LoadInsts");
- static Statistic<> NumStoreInst("instcount", "Number of StoreInsts");
- static Statistic<> NumGetElementPtrInst("instcount",
- "Number of GetElementPtrInsts");
-
- static Statistic<> NumSwitchInst("instcount", "Number of SwitchInsts");
- static Statistic<> NumInvokeInst("instcount", "Number of InvokeInsts");
- static Statistic<> NumBinaryOperator("instcount",
- "Total Number of BinaryOperators");
-
- static Statistic<> NumShiftInst("instcount", " Total Number of ShiftInsts");
- static Statistic<> NumShlInst("instcount", "Number of Left ShiftInsts");
-
- static Statistic<> NumShrInst("instcount", "Number of Right ShiftInsts");
-
+ Statistic<> TotalInsts ("instcount", "Number of instructions (of all types)");
+ Statistic<> TotalBlocks("instcount", "Number of basic blocks");
+ Statistic<> TotalFuncs ("instcount", "Number of non-external functions");
+
+#define HANDLE_INST(N, OPCODE, CLASS) \
+ Statistic<> Num##OPCODE##Inst("instcount", "Number of " #OPCODE " insts");