So im completely new to this llvm project and i been trying to play with the static analyzer checkers to see if i can create one of my own even if its a simple one. I been analyzing the division by zero and kinda understand how it works but i like to know how does one go about adding a new checker and making it appear in “clang -cc1 -analyzer-checker-help” because i did what the developer manual said but it did not work. And if anyone has any tips for a beginner on how to get started with llvm/clang it would be nice.
Another quick question, the makefile that I have to run for the checker to work is it the one located in this directory?
/build/tools/clang/lib/StaticAnalyzer/Checkers
Yes, See the first commit of other checkers’ implementation.
Normally you need four files.
include/clang/StaticAnalyzer/Checkers/Checkers.td
lib/StaticAnalyzer/Checkers/CMakeLists.txt
lib/StaticAnalyzer/Checkers/CloneChecker.cpp
clang/test/Analysis/copypaste/blocks.cpp