[LLVMdev] (no subject)

Vikram S. Adve vadve at cs.uiuc.edu
Tue Nov 12 17:37:01 PST 2002


P.S.  If anyone can take a little time to write a GraphTraits class for
the call graph, using the call sites returned by the TDGraph, that would
be great.

Then you could directly use the PostOrderIterator,
ReversePostOrderIterator, and TarjanSCCIterator on this call graph,
without having to do any extra work.  You can also do other things like
print out the call graph to dot files and view them.  All this comes for
free since they only need GraphTraits.

--Vikram
http://www.cs.uiuc.edu/~vadve


> -----Original Message-----
> From: Vikram S. Adve [mailto:vadve at cs.uiuc.edu] 
> Sent: Tuesday, November 12, 2002 5:34 PM
> To: 'Xiaodong Li'
> Cc: llvmdev at cs.uiuc.edu
> Subject: RE: [LLVMdev] (no subject)
> 
> 
> Chris told you how to get results of any pass 
> (BUDataStructure, TDDataStructure, etc.).
> 
> The CallGraph pass right now is very imprecise.  Instead, the 
> best way to get CallGraph information is to do the following:
> 	-- Get the TDGraph
> 	-- Call tdGraph->getFunctionCalls().  This returns a 
> list of call site objects, which contain information about 
> the potential callees at each call site (if it is a direct 
> call there is only one of course; if it is a call through a 
> function pointer, this tells you what callees may be called, 
> based on the results of the BU and TD analysis).
> 
> --Vikram
> http://www.cs.uiuc.edu/~vadve
> 
> 
> > -----Original Message-----
> > From: llvmdev-admin at cs.uiuc.edu
> > [mailto:llvmdev-admin at cs.uiuc.edu] On Behalf Of Chris Lattner
> > Sent: Tuesday, November 12, 2002 5:31 PM
> > To: Xiaodong Li
> > Cc: llvmdev at cs.uiuc.edu
> > Subject: Re: [LLVMdev] (no subject)
> > 
> > 
> > > I need to do interprocedural analysis for my project. I was
> > wondering
> > > if you can tell me how to create Bottom Up DSGraph and Call
> > Graph in
> > > the program. I know DSGraph *dsg = new DSGraph( F )
> > > can create a DSGraph, but looks like that's only local DSGraph. I 
> > > also need to know how to create the call graph for the
> > whole module in
> > > the program.
> > 
> > You get analysis graphs by using the pass subsystem.  You can
> > read all about this from here:
> > 
> http://llvm.cs.uiuc.edu/docs/WritingAnLLVMPass.html
> 
> If you want a concrete example of data structure usage, look 
> for an example in the code base, like IP Mod/Ref.
> 
> -Chris
> 
> -- 
> http://llvm.cs.uiuc.edu/
> http://www.nondot.org/~sabre/Projects/
> 
> _______________________________________________
> LLVM Developers mailing list
> LLVMdev at cs.uiuc.edu         http://llvm.cs.uiuc.edu
> http://mail.cs.uiuc.edu/mailman/listinfo/llvmdev
> 




More information about the llvm-dev mailing list