[LLVMdev] How to detect all free() calls
270611649 at qq.com
Sun Mar 10 21:17:48 PDT 2013
I'm trying to write a pass to detect all free()/delete() call instructions in LLVM IR.The method is as follows.
First I find Call Instructions: CallInst *CI=dyn_cast<CallInst>(&*i);
then see if the Function name matches:
It worked but when something like this occurs
%call2 = call i32 bitcast (i32 (...)* @free to i32 (i8*)*)(i8* %call1) nounwind, !dbg !16
It seems like a indirect function call and I don't know how to detect free() in such situation.
By the way, is there any way that is more convenient to detect all free()/delete() call instructions in a module except by matching the function name?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the llvm-dev