Memset checker

Dear All,

I would like to create a tool, which could count the number of “memset” calls in the AST before and after the optimizations. Is there any existing tool which can do it? If there isn’t, where to place it? I found three possible ways: integrate into the compiler, clang plugin or an independent tool. Which one is the best?



Hello Gabor,

The optimizations don't affect AST - they are done by LLVM for the IR. You possibly want to look at the result bitcode instead.

27.04.2018 13:44, Gabor Borsik via cfe-dev пишет:


Thanks for the observation. The main goal is to indicate when the compiler optimizes out a memset call. Sometimes one uses it to delete e.g. passwords from the memory. This time delete the memset call causes a possible security vulnerability.