All,<br><br>I have written a tutorial about how to create a plugin for
the static analyzer. The target audience is developers who reasonably
familiar with using Clang, but are unsure how they would go about
extending Clang for custom analysis cases.<br>
<br>The tutorial describes a complete example of a plugin that checks
for proper use of a trivial locking construct. This was the simplest
example I could think of that requires the use of stored program state.<br><br>The
tutorial covers in detail everything needed to write a plugin,
including: the interface between Clang and the plugin, how to subclass
Checker, defining and using custom program state data, reporting found
bugs, and compilation. As such, it is relatively self-contained.<br>
<br>Any feedback would be greatly appreciated. I hope to get this
integrated into the Clang documentation, but I am unsure about what the
best way to do that would be; any suggestions about that would also be
welcome.<br><br clear="all"><br>-- <br>===============================================================================<br>All opinions expressed in posts from this account are entirely my own, and not<br>those of any present or former employer. Furthermore, I assert that all works<br>
contributed to the Clang project (1) were developed using no equipment,<br>supplies, facility or trade secrets of any such employer, (2) were developed<br>entirely on my own time, and (3) do not result from any work performed for any<br>
such employer.<br><br>