<div dir="ltr">Hi Shulin,<div><br></div><div>It seems to me what you'll need is your own inter-procedural analysis to deal with data-flow between functions. That is, you'll need to figure out the callgraph between all the functions and the dataflow inside all the functions. In this case, you'll need to find where foo is called (probably multiple places), what are the use cases for all this callsites in the dataflow in foo's parent function, and all the functions where the pointer a's content could be modified. If there're other pointers pointing to the same address a's pointing to, you may also need pointer analysis, where things could get really tricky.</div><div><br></div><div>To deal with different IR files, you'll either have to implement an LTO pass, or use llvm-link to link multiple IRs to a combined IR for analysis run it through your OPT pass like a regular IR.</div><div><br></div><div>Regards,</div><div>Kevin</div></div><br><div class="gmail_quote"><div dir="ltr">On Thu, Jan 21, 2016 at 2:21 AM 周书林 via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div><div>As mentioned in the title, I want to do some control-flow and dataflow analysis. I can only find the assignment statement in a function, but the assigned variable is just a parameter of this function.<br></div>For example,<br>****************************************<br></div>int foo(struct A* a, int b, ...){<br> ...<br></div> a->Int_field = b;<br> ...<br></div> return 0;<br><div><div>}<br>*****************************************<br>in the code above, I want to do some analysis for struct A* a's Int_field, but in this function, it is only assigned, I want to find its <span>Use scenario and fetch some constraints about it.<br></span></div><div><span>So, could I achieve this goal via IR?<br></span></div><div><span>Thanks a lot!<br></span></div></div></div>
_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" rel="noreferrer" target="_blank">http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><br>
</blockquote></div>