<DIV>
<DIV>  
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Hi ,<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">I am using LLVM for my Post Graduate course project on Optimization. I am trying to do some insrtumentation to the bytecode.I 've been going through your Instrumentation code for the past few days<SPAN style="mso-spacerun: yes">  </SPAN>in /llvm/lib/Transforms/Instrumentation folder and finally found two ways of instrumentation :<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN style="mso-tab-count: 1">            </SPAN>1) injecting LLVM bytecode instructions<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"><SPAN style="mso-tab-count: 1">            </SPAN>2) calling an external C function.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">I am trying both and I am comfortable with the 2).<BR>My goal is to insert a global variable , which will count the total number of functions executed.At each method entry the global variable should be incremented and at the last method exit , it should print the count. The code compiled successfully, but when I used in the<SPAN style="mso-spacerun: yes">  </SPAN>opt tool, I get an error in the getElementPtr(..) statement and finally a<SPAN style="mso-spacerun: yes">  </SPAN>segmentation fault error. Please help me regarding this.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">I am sending the code as an attachment.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">I 've written a pass which will do instrumentation using the opt tool and then execute with lli JIT enabled.<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt"> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Thank you ,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Sandra Johnson , M.E. (C.S.E.)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Anna University,<o:p></o:p></SPAN></P>
<P class=MsoNormal style="mso-pagination: none; mso-layout-grid-align: none"><SPAN style="FONT-FAMILY: Arial; FONT-SIZE: 10pt">Chennai , India.<o:p></o:p></SPAN></P></DIV></DIV><p>
                <hr size=1> <a href="http://pa.yahoo.com/*http://us.rd.yahoo.com/evt=36035/*http://music.yahoo.com/unlimited/">Yahoo! Music Unlimited - Access over 1 million songs. Try it free.</a>