[cfe-dev] Can I write a standalone static analyzer?

Matthew Del Buono via cfe-dev cfe-dev at lists.llvm.org
Tue Dec 12 01:49:16 PST 2017


To further answer the question - I think meritozh may be saying "I wish I
could write checkers without modifying the clang source code" to which the
response is "you can!" You can compile your checker as a clang plugin to a
shared object file and then load that plugin. That way there's no need to
recompile clang, but you are still able to write your own custom checkers.

You need to implement the clang_registerCheckers function in your plugin.
See here: https://clang.llvm.org/doxygen/CheckerRegistry_8h_source.html

Does that answer your question?
-- Matthew P. Del Buono

On Mon, Dec 11, 2017 at 11:27 PM, Alexey Knyshev via cfe-dev <
cfe-dev at lists.llvm.org> wrote:

> Hi meritozh!
>
> CSA supports and encourage you to write custom opt-in checkers. Please
> explain what does mean "general purpose" statement and in which context you
> have to implement a new tool?
>
> Thanks, Alexey K
>
> 2017-12-12 9:33 GMT+03:00 gao ge via cfe-dev <cfe-dev at lists.llvm.org>:
>
>> Clang static analyzer is a great tool, but its checkers are only for
>> general purpose. I want write some customized checkers. As I know, static
>> analyzer is a port of clang, clang-tidy maybe a good choice, but it does
>> not support path sensitive checker. It seems that I must modify clang
>> source code? Can I write a standalone static analyzer which built on static
>> analyzer module, but also support path sensitive checking?
>>
>> Thanks,
>> meritozh
>>
>> _______________________________________________
>> cfe-dev mailing list
>> cfe-dev at lists.llvm.org
>> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>>
>>
>
>
> --
> linkedin.com/profile
> <https://www.linkedin.com/profile/view?id=AAMAABn6oKQBDhBteiQnWsYm-S9yxT7wQkfWhSw>
>
> github.com/alexeyknyshev
> bitbucket.org/alexeyknyshev
>
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-dev
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20171212/71621dbc/attachment-0001.html>


More information about the cfe-dev mailing list