<div dir="ltr">Hi,<br><br>I have made my optimization as an extension of ModulePass as suggested in last mail. I included "addRequired<CallGraph>" in getAnalysisUsage function.<br>The application compiles fine but while linking,  I get following errors:<br>
"undefined reference to llvm::CallGraphLinkVar"<br>"undefined reference to llvm::CallGraph::ID<br><br>The above error is at point where I refer to individual instruction. I followed the conventions used in GlobalModRefPass, which is also an extension of ModulePass. Is there any other convention which needs to be followed?<br>
<br>Thanks<br><br>--Kapil<br><br><br><div class="gmail_quote">On Wed, Aug 20, 2008 at 1:59 PM, Bill Wendling <span dir="ltr"><<a href="mailto:isanbard@gmail.com">isanbard@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div></div><div class="Wj3C7c">On Wed, Aug 20, 2008 at 9:47 AM, kapil anand <<a href="mailto:kapilanand2@gmail.com">kapilanand2@gmail.com</a>> wrote:<br>
> Hi,<br>
><br>
> I have been working on implementing new analysis for a LLVM module. For<br>
> that, I need that Call Graph of the module. Inside the CallGraph file, the<br>
> constructor has been declared "protected" hence I can't define its instance<br>
> and thus use the CallGraph for further analysis.<br>
><br>
> So, what are the ways of building and using Call Graph of a module. Do I<br>
> need to make my new analysis as another PASS?<br>
><br>
</div></div>Yes, you should make it a pass, and then say that that pass requires<br>
call graph information like this:<br>
<br>
  AU.addRequired<CallGraph>();<br>
<br>
The pass manager's responsible for providing that analysis information<br>
for you. See how it's used in other passes for examples.<br>
<br>
-bw<br>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:LLVMdev@cs.uiuc.edu">LLVMdev@cs.uiuc.edu</a>         <a href="http://llvm.cs.uiuc.edu" target="_blank">http://llvm.cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/llvmdev</a><br>
</blockquote></div><br></div>