[LLVMdev] How to get Function object in LLVM Pass

Rahul rahul3527 at gmail.com
Thu Oct 25 02:51:08 PDT 2012


I am writing a llvm pass which inserts some code in a function.
In code generation, I want to insert code for a function call. But for
this, I need to get function object from list of functions available with
Module.
When I try to get the function object by specifying function name, it
returns null.
I suppose this happens because clang removes function prototypes if the
function is not called in source file.
Is there any way to retain the function prototypes in clang??
Or is there a way to get it during llvm pass??

-- 
Regards,
Rahul Patil.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20121025/28399d84/attachment.html>


More information about the llvm-dev mailing list