[llvm-dev] Want to write a static code analysis tool to locate all possible dangling pointer in c++ code

Subrata Dasgupta via llvm-dev llvm-dev at lists.llvm.org
Thu Aug 10 23:10:48 PDT 2017


Hi All,
I am new to LLVM and trying to learn it. Actually I want to solve dangling pointer problem in a very big and complex C++ project by static code analysis. My idea is to find all possible pointers which may point to a particular type of object within the data structure in the code. Application should be smart enough to understand normal C++ Up-casting or down-casting by dynamic-cast etc.  

It seems LLVM's "Alias Analysis Infrastructure" and CallGraphPass may be useful to do the above kind of job at least to some extent. But unfortunately I am not familiar how to write such a tool. If you think it is possible to implement my idea using LLVM then please let me know how I can write such a tool. Any kind of help or example is welcome. 

Thanks
Subrata
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20170811/78f039fa/attachment.html>


More information about the llvm-dev mailing list