<div style="line-height:1.7;color:#000000;font-size:14px;font-family:arial">Hi everyone<div><br></div><div>    I am a newbie to llvm. I want to record the execution (statement/instruction) trace of a program. For example, a C program is like this:</div><div><br></div><div>1:    sum = 0;</div><div>2:    for(i = 0; i < 2; i++)</div><div>3:        sum += i;</div><div>4:    printf("%d", sum);</div><div><br></div><div>    The execution trace would be something like 1->2->3->2->3->2->4.</div><div><br></div><div>    So how to achieve this goal? by writing a llvm pass?</div><div><br></div><div>    Is there an example about this in the codebase of llvm?</div><div><br></div><div>    Thank you in advance</div><div><br></div><div>    Ting Chen</div></div><br><br><span title="neteasefooter"><span id="netease_mail_footer"></span></span>