[LLVMdev] Problem on instrumentation

Zhoujinguo zhoujinguo1988 at yahoo.cn
Sun Apr 8 20:27:26 PDT 2012


Hi,
I am instrumenting a piece of code. I want to insert a function call at the interested area, and do something in the called function which is written by myself.
I have succeed on implementing the pass, and getting the instrmented code. However, I am not sure where to put this function, and what kind of linkage I should use for this function.
Currently I use External linkage which is implemented as following:
LLVMContext& context=M.getContext();FunctionType* FT=FunctionType::get(Type::getInt32Ty(context),false);Function* F=Function::Create(FT,Function::ExternalLinkage,"myFunctionCall",&M);
Is it OK? And also, where should I put the function "int myFunctionCall()"?
Thank you very much. I am expecting for your reply.
RegardsAndy
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120409/434b017b/attachment.html>


More information about the llvm-dev mailing list