[cfe-dev] Need Help: A small problem in Clang

phongph phongph.hut at gmail.com
Fri Mar 27 01:57:22 PDT 2015


Hi everyone,

I am having a small problem as follows, please help me:

Implement, using LLVM/Clang, to count the number of memory operations
executed in a given function (recording reads and writes of fields and
arrays elements) of C programs. Here is an example: 

            int* test(int* b, int* c) { 
               ... 
               for (int i=0; i<10; i++) { 
                   a[i] =b[i] + c[i]; 
               } 
               return a; 
            } 

After execution of the whole program, the output of the instrumentation
should return something like this for each method: "function test: reads =
20; writes = 10". 

Thank you very much!



--
View this message in context: http://clang-developers.42468.n3.nabble.com/Need-Help-A-small-problem-in-Clang-tp4044707.html
Sent from the Clang Developers mailing list archive at Nabble.com.



More information about the cfe-dev mailing list