[LLVMdev] Finding call points to a function

Rakesh Komuravelli komurav1 at illinois.edu
Wed Sep 9 21:58:05 PDT 2009


Hi,

I am writing an LLVM Pass and I would like to know how would I do the
following:

1. I have a function foo, and I need to get all the call points calling this
function in each Function of the Module. The only way I can think of is to
iterate over the BasicBlocks of each Function, look for all the Call
Instructions and check if the called function is foo. I was wondering if
there is any other better way to do this.

2. Is it possible to distinguish a class method from a non class method
while analyzing the emitted LLVM code for a C++ program? Because, I need to
interpret the calls made to foo differently in a class method and in a non
class method.

Thanks,
Rakesh
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20090909/292649b8/attachment.html>


More information about the llvm-dev mailing list