LLVM  14.0.0git
Macros | Functions
InstCount.cpp File Reference
#include "llvm/Analysis/InstCount.h"
#include "llvm/ADT/Statistic.h"
#include "llvm/Analysis/Passes.h"
#include "llvm/IR/Function.h"
#include "llvm/IR/InstVisitor.h"
#include "llvm/InitializePasses.h"
#include "llvm/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/ErrorHandling.h"
#include "llvm/Support/raw_ostream.h"
#include "llvm/IR/Instruction.def"
Include dependency graph for InstCount.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "instcount"
 
#define HANDLE_INST(N, OPCODE, CLASS)   STATISTIC(Num##OPCODE##Inst, "Number of " #OPCODE " insts");
 
#define HANDLE_INST(N, OPCODE, CLASS)
 

Functions

 STATISTIC (TotalInsts, "Number of instructions (of all types)")
 
 STATISTIC (TotalBlocks, "Number of basic blocks")
 
 STATISTIC (TotalFuncs, "Number of non-external functions")
 
 INITIALIZE_PASS (InstCountLegacyPass, "instcount", "Counts the various types of Instructions", false, true) FunctionPass *llvm
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "instcount"

Definition at line 25 of file InstCount.cpp.

◆ HANDLE_INST [1/2]

#define HANDLE_INST (   N,
  OPCODE,
  CLASS 
)    STATISTIC(Num##OPCODE##Inst, "Number of " #OPCODE " insts");

Definition at line 43 of file InstCount.cpp.

◆ HANDLE_INST [2/2]

#define HANDLE_INST (   N,
  OPCODE,
  CLASS 
)
Value:
void visit##OPCODE(CLASS &) { \
++Num##OPCODE##Inst; \
++TotalInsts; \
}

Definition at line 43 of file InstCount.cpp.

Function Documentation

◆ INITIALIZE_PASS()

INITIALIZE_PASS ( InstCountLegacyPass  ,
"instcount"  ,
"Counts the various types of Instructions ,
false  ,
true   
)

Definition at line 91 of file InstCount.cpp.

◆ STATISTIC() [1/3]

STATISTIC ( TotalBlocks  ,
"Number of basic blocks"   
)

◆ STATISTIC() [2/3]

STATISTIC ( TotalFuncs  ,
"Number of non-external functions  
)

◆ STATISTIC() [3/3]

STATISTIC ( TotalInsts  ,
"Number of instructions (of all types)"   
)
OPCODE
#define OPCODE(NAME)