[LLVMdev] writing an llvm pass

Vasudev.Negi at microchip.com Vasudev.Negi at microchip.com
Wed Sep 2 10:48:01 PDT 2009


  I need to write a pass where I need to find all the predecessors of
each leaf node. I think the  options that I have is create a sub class
of ModulePass or CallGraphSCCPass. 

 I will need to traverse the call graph bottom up and by the description
of CallGraphSCCPass, it seems the Pass to use.  The problem that I am
facing is from a CallGraphNode, I don't see any way to get it's callers.


 

 So I think it will be better to use ModulePass. I start from the root.
For each function called  from root, I add root to its predecessor list.
Then I follow the same using BFS, and for each callee add the caller as
well as the predecessors of caller to callee's predecessor list.

 Any views or suggestions on this will be highly appreciated. 

 

Thanks

Vasudev

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090902/2b70e5ff/attachment.html>


More information about the llvm-dev mailing list