diff --git a/docs/ProgrammersManual.html b/docs/ProgrammersManual.html index d51d958df05..36e59200683 100644 --- a/docs/ProgrammersManual.html +++ b/docs/ProgrammersManual.html @@ -383,11 +383,11 @@ more complex example
@@ -400,15 +400,16 @@ for each Function f in the ModuleAnd the actual code is (remember, since we're writing a -FunctionPass our FunctionPass-derived class simply +FunctionPass, our FunctionPass-derived class simply has to override the runOnFunction method...):
+ +Function* targetFunc = ...; + class OurFunctionPass : public FunctionPass { public: - OurFunctionPass(Function* func): m_func(func) { } - - virtual doInitialization(Module& M) { callCounter = 0; }; + OurFunctionPass(): callCounter(0) { } virtual runOnFunction(Function& F) { for(Function::iterator b = F.begin(), be = F.end(); b != be; ++b) { @@ -418,15 +419,14 @@ class OurFunctionPass : public FunctionPass { // need to determine if it's a call to the // function pointed to by m_func or not. - if(callInst->getCalledFunction() == m_func) + if(callInst->getCalledFunction() == targetFunc) ++callCounter; } } } private: - Function* m_func; // we're counting calls to this function. - static unsigned callCounter; + unsigned callCounter; };@@ -1280,6 +1280,6 @@ pointer to the parent Function. Chris Lattner -Last modified: Mon Sep 9 10:47:48 CDT 2002 +Last modified: Mon Sep 9 11:29:35 CDT 2002