[cfe-dev] How to register a new checker in clang-analyzer?

Azat Khuzhin a3at.mail at gmail.com
Fri Apr 3 11:45:30 PDT 2015


On Thu, Apr 02, 2015 at 07:31:46PM +0800, Q Z wrote:
> Hello!
> I wrote a checker named "ReactorChecker" .After re-config, I got an error
> when I run "make" in the folder where I built LLVM and Clang.The error is:
> 
>  error: ‘void
> clang::ento::registerReactorChecker(clang::ento::CheckerManager&)’ should
> have been declared inside ‘clang::ento’
> 
> PS:the version of my LLVM is 3.6.
> Anybody help me ?Thank you very much!
> 
> zhaoqian

You could look at this example:
https://github.com/azat/clang/commit/6914e463518c2b4dd5403a957727e4b1d7bc7399

In short you should add next lines into lib/StaticAnalyzer/Checkers/Checkers.td:
def ReactorChecker : Checker<"Reactor">,
  HelpText<"Reactor">,
  DescFile<"ReactorChecker.cpp">;

And don't forget to add you module into CMakeLists.txt




More information about the cfe-dev mailing list