<table cellspacing="0" cellpadding="0" border="0" ><tr><td valign="top" style="font: inherit;"><div id="yiv422548798"><table cellspacing="0" cellpadding="0" border="0" id="yiv422548798bodyDrftID" class="yiv422548798"><tbody><tr><td id="yiv422548798drftMsgContent" style="font:inherit;font-family:arial;font-size:10pt;"><div id="yiv422548798"><table cellspacing="0" cellpadding="0" border="0" id="yiv422548798bodyDrftID" class="yiv422548798"><tbody><tr><td id="yiv422548798drftMsgContent" style="font:inherit;font-family:arial;font-size:10pt;"><div id="yiv422548798"><table cellspacing="0" cellpadding="0" border="0" id="yiv422548798bodyDrftID" class="yiv422548798"><tbody><tr><td id="yiv422548798drftMsgContent" style="font:inherit;font-family:arial;font-size:10pt;">Hi, <div><div>I am trying to write a pass and add it into the LLVM optimizer so to insert functions for optimization before and after every function call.</div><div>For example, I create a test
 file test.c. There is  a function f1() just printing out "Print f1", which is called in the main function. That's all the test.c do. Now I want to
 insert optimazation function opt_begin() before f1() and opt_end() after by adding the command line of my pass in the compilation option of llvm-gcc. Does anyone  have any idea about how to implement this? I would really
 appreciate if anyone can help me out, since I was stuck by this question for really  a long time.<br></div><div><br></div><div>Jian</div><div><br></div></div></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></tbody></table></div></td></tr></table>