How to get Function object in LLVM Pass

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??

Hi Rahul,