llvm.org GIT mirror llvm / 6666a04
There is no reason for this to be a pass! git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@8214 91177308-0d34-0410-b5e6-96231b3b80d8 Chris Lattner 17 years ago
1 changed file(s) with 5 addition(s) and 5 deletion(s). Raw diff Collapse all Expand all
44 //===----------------------------------------------------------------------===//
55
66 #include "llvm/Pass.h"
7 #include "llvm/Module.h"
7 #include "llvm/Function.h"
88 #include "llvm/Support/InstVisitor.h"
99 #include "Support/Statistic.h"
1010
1818
1919 #include "llvm/Instruction.def"
2020
21 class InstCount : public Pass, public InstVisitor {
21 class InstCount : public FunctionPass, public InstVisitor {
2222 friend class InstVisitor;
2323
2424 void visitFunction (Function &F) { ++TotalFuncs; }
3434 abort();
3535 }
3636 public:
37 virtual bool run(Module &M);
37 virtual bool runOnFunction(Function &F);
3838
3939 virtual void getAnalysisUsage(AnalysisUsage &AU) const {
4040 AU.setPreservesAll();
5050 // InstCount::run - This is the main Analysis entry point for a
5151 // function.
5252 //
53 bool InstCount::run(Module &M) {
54 visit(M);
53 bool InstCount::runOnFunction(Function &F) {
54 visit(F);
5555 return false;
5656 }