[cfe-dev] organizing a clang static analyzer checker project

Nick Sumner via cfe-dev cfe-dev at lists.llvm.org
Fri Jun 9 15:18:22 PDT 2017


Dear Stefan,

I've posted a demo here:
https://github.com/nsumner/clang-plugins-demo

This shows how you can make a standalone executable that automatically
loads your own static analyzer plugins from your external project.
I've not tried it out on Windows (and expect it to require tweaks),
but it can point you along the way.

Best,
Nick


On Mon, Jun 5, 2017 at 11:29 PM, Stefan Ciobaca via cfe-dev
<cfe-dev at lists.llvm.org> wrote:
> Dear Clang Developers,
>
> I am wondering about the best way to organize a project with several custom
> Clang Static Analyzer checkers.
>
> Currently, we are compiling the custom checkers as plugins and load them
> dynamically with -load on the command line. This has the benefit of having a
> fast compile time, but it does not work (well) on Windows and it's not nice
> for the end user.
>
> The standard way, to add them in llvm/tools/clang/lib/StaticAnalyzer as
> described in https://clang-analyzer.llvm.org/checker_dev_manual.html, has
> the downsides of (1) having a large compilation time and (2) being in a
> place which is not directly under our source code control system.
>
> I am wondering if there is a third way to organize things. Ideally, we would
> like to have
> - fast compilation times;
> - our checkers in a directory outside of the clang tree;
> - easy on the end users (a static build of clang);
> - our checkers working nicely on Windows.
>
> The llvm tree has a "projects" directory under which they recommend to place
> external projects, but there are no guidelines on how to add CSA checkers
> there.
>
> I would appreciate if you could provide some pointers on how to best
> organize our project.
>
> Thank you!
>
> Best,
> Stefan
>
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>



More information about the cfe-dev mailing list