<div dir="ltr">Hi,<div><br></div><div>I have been trying to write a checker using PreStmt<CallExpr> interface to get a context sensitive call graph with the SVal's of each argument at each call node (in other words with CheckerContext at that node).</div>
<div><br></div><div>To explain in detail, for example in the code below, I would like my checker to be invoked 3 times each for malloc and free calls (because they have been called thrice through alloc_mem), rather than just once for malloc and free, which is currently the case in PreStmt<CallExpr> and evalCall checkers including the MallocChecker. </div>
<div><br></div><div>void* alloc_mem(int x) {</div><div><br></div><div>       void *p = malloc(x);</div><div>       return p;</div><div>}</div><div><br></div><div>int main() {</div><div><br></div><div>     void *x = alloc_mem(4);</div>
<div>     free(x);</div><div>     x = alloc_mem(8);</div><div>     free(x);</div><div>     x = alloc_mem(12);</div><div>     free(x);</div><div>     return 0;</div><div>}</div><div><br></div><div><br></div><div>And as per my understanding, I do not just want to walk/traverse the AST as I would not get the state (checkerContext, SVal) at the call expression. </div>
<div>I also want to visit the calls made from within the member functions of the classes, in object oriented langs, which I could not find in any of the checkers.</div><div><br></div><div>If something like this has already been implemented in Clang, please direct me there, else please guide me to do so.</div>
<div><br></div><div>Thanks in advance!</div><div><br></div><div> ~ Tarun </div><div><div dir="ltr"><div><br></div></div><br>
</div></div>