<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Mon, Mar 30, 2015 at 3:54 AM, David Chisnall <span dir="ltr"><<a href="mailto:David.Chisnall@cl.cam.ac.uk" target="_blank">David.Chisnall@cl.cam.ac.uk</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Is this a class assignment?</blockquote><div><br>Well spotted - I honestly wouldn't've called that. (we do see some number of these sort of questions on a regular basis, but you're right - two /very similar/ ones was noteworthy)<br><br>Hrm. Guess that's the price of popularity? Not that I have a problem helping people (even students doing homework) get started, but for the issues you quite correctly point out below \/<br> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"> Someone else was asking the same question recently, and it is impossible to help because the problem is poorly specified (for example, in optimised code this may end up being a small number of vector reads and writes, or a single memcpy call).<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
> On 27 Mar 2015, at 08:57, phongph <<a href="mailto:phongph.hut@gmail.com">phongph.hut@gmail.com</a>> wrote:<br>
><br>
> Hi everyone,<br>
><br>
> I am having a small problem as follows, please help me:<br>
><br>
> Implement, using LLVM/Clang, to count the number of memory operations<br>
> executed in a given function (recording reads and writes of fields and<br>
> arrays elements) of C programs. Here is an example:<br>
><br>
> int* test(int* b, int* c) {<br>
> ...<br>
> for (int i=0; i<10; i++) {<br>
> a[i] =b[i] + c[i];<br>
> }<br>
> return a;<br>
> }<br>
><br>
> After execution of the whole program, the output of the instrumentation<br>
> should return something like this for each method: "function test: reads =<br>
> 20; writes = 10".<br>
><br>
> Thank you very much!<br>
><br>
><br>
><br>
> --<br>
> View this message in context: <a href="http://clang-developers.42468.n3.nabble.com/Need-Help-A-small-problem-in-Clang-tp4044707.html" target="_blank">http://clang-developers.42468.n3.nabble.com/Need-Help-A-small-problem-in-Clang-tp4044707.html</a><br>
> Sent from the Clang Developers mailing list archive at Nabble.com.<br>
> _______________________________________________<br>
> cfe-dev mailing list<br>
> <a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
> <a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
<br>
<br>
_______________________________________________<br>
cfe-dev mailing list<br>
<a href="mailto:cfe-dev@cs.uiuc.edu">cfe-dev@cs.uiuc.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev</a><br>
</div></div></blockquote></div><br></div></div>