<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;">Hi,<div><br></div><div>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.</div><div><br></div><div>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.</div><div><br></div><div>Currently I use External linkage which is implemented as following:</div><div><br></div><div>LLVMContext& context=M.getContext();</div><div>FunctionType* FT=FunctionType::get(Type::getInt32Ty(context),false);</div><div>Function* F=Function::Create(FT,Function::ExternalLinkage,"myFunctionCall",&M);</div><div><br></div><div>Is it OK? And also, where should I put the function "int myFunctionCall()"?</div><div><br></div><div>Thank you very much. I
 am expecting for your reply.</div><div><br></div><div>Regards</div><div>Andy</div></td></tr></table>