[cfe-dev] Tackling open project - BitwiseMaskingChecker
Devin Coughlin via cfe-dev
cfe-dev at lists.llvm.org
Mon Feb 29 17:37:34 PST 2016
Hi Yehuda,
> On Feb 20, 2016, at 8:26 AM, יהודה שפירא via cfe-dev <cfe-dev at lists.llvm.org> wrote:
>
> I have been working on the llvm project - more on the backend and I want to get more familiarized with the clang and especially with the static analyzer project.
> So I want to try and tackle one of the open projects that listed in the site http://clang-analyzer.llvm.org/open_projects.html <http://clang-analyzer.llvm.org/open_projects.html>.
> I want to start with something simple, and so I was thinking about working on the BitwiseMaskingChecker (PR16615 <http://llvm.org/bugs/show_bug.cgi?id=16615>) unless you think it not a good start.
If you are looking for something even simpler for your first project, here are a couple of suggestions:
1) Add modeling for the std::call_once() function. Tackling this would familiarize you with the “BodyFarm” approach the analyzer uses to synthesize simple, fake method bodies representing the behavior of important library functions. This is likely to be quite similar to the approach the analyzer takes for ‘dispatch_once()' in BodyFarm.cpp.
2) Extend the VforkChecker to mark the call to 'vfork()' in a BugReporterVisitor. There is a TODO in VforkChecker.cpp where this should be added. Tackling this would get you familiar with the approach the analyzer uses to keep its analysis state lean while still displaying helpful path-sensitive diagnostics. There is an example of how to do this in SuperDeallocBRVisitor::VisitNode() in ObjCSuperDeallocChecker.cpp.
3) If you are interested in how the analyzer does AST-based checks, one place to start is the ObjCMissingSuperCallChecker. There a bunch of TODOs in that file. But the simplest project is probably to tackle <https://llvm.org/bugs/show_bug.cgi?id=22562>, which adds a diagnostic for when an NSDocument subclass overrides -close without calling its superclass. There is a patch attached that to add the functionality — but it is missing tests. This would be a good project to see how the analyzer is tested!
Devin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20160229/fb624c40/attachment.html>
More information about the cfe-dev
mailing list